Config view: rename Test connections to Test; center Save and Revert

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-10-21 00:01:17 +02:00
co-authored by Claude Sonnet 5.5
parent 26e1679e4e
commit b40ee8b61c
5 changed files with 8 additions and 7 deletions
+1 -1
View File
@@ -70,7 +70,7 @@ var helpSections = []helpSection{
{"↑↓", "move through all fields, one below the other, in the sections Radarr, Sonarr, SABnzbd and Interface; ↓ after the last field reaches Save and Revert"},
{"Tab", "jump between the fields and Save / Revert"},
{"Space", "toggle a checkbox; press a button"},
{"Test connections", "(below the SABnzbd settings) checks the three services with the values typed in"},
{"Test", "(button below the SABnzbd settings) checks the three services with the values typed in"},
{"Save, Revert", "(at the bottom) Save writes the file and applies everything at once; Revert discards edits"},
{"q", "is typed here as text (it does not quit); F9 opens this help"},
}},
+3 -2
View File
@@ -103,7 +103,7 @@ type settingsView struct {
root *tview.Flex
form *tview.Form // every field, one below the other, with section headings
testItem *formAction // the Test connections button, below the service settings
testItem *formAction // the Test button, below the service settings
actions *tview.Form // the buttons below it
groups []*tview.Form // keyboard order: the fields, then the buttons
status *tview.TextView
@@ -160,7 +160,7 @@ func newSettingsView(app *App) *settingsView {
service("Sonarr", "sonarr", true)
service("SABnzbd", "sabnzbd", false)
// Right below the connection settings it checks.
v.testItem = newFormAction("Test connections", v.test)
v.testItem = newFormAction("Test", v.test)
f.AddFormItem(v.testItem)
f.AddFormItem(newFormHeading("Interface"))
@@ -181,6 +181,7 @@ func newSettingsView(app *App) *settingsView {
v.actions = tview.NewForm().SetItemPadding(0)
v.actions.SetBorder(true).SetTitle(" Actions ")
v.actions.SetBorderPadding(0, 0, 1, 1)
v.actions.SetButtonsAlign(tview.AlignCenter)
v.actions.AddButton("Save", v.save)
v.actions.AddButton("Revert", v.revert)
+2 -2
View File
@@ -285,7 +285,7 @@ func TestTestConnectionsButtonSitsBelowTheServices(t *testing.T) {
send(v.form, tcell.KeyDown)
}
if focusedItem() != tview.FormItem(v.testItem) {
t.Fatalf("↓ after the SABnzbd API key reached %T %q, want the Test connections button", focusedItem(), focusedItem().GetLabel())
t.Fatalf("↓ after the SABnzbd API key reached %T %q, want the Test button", focusedItem(), focusedItem().GetLabel())
}
send(v.form, tcell.KeyDown)
if got := focusedItem().GetLabel(); got != "Downloads refresh (seconds)" {
@@ -296,7 +296,7 @@ func TestTestConnectionsButtonSitsBelowTheServices(t *testing.T) {
t.Error("↑ must come back to the button")
}
// Save and Revert stay below everything; Test connections is not among them.
// Save and Revert stay below everything; Test is not among them.
if v.actions.GetButtonCount() != 2 || v.actions.GetButton(0).GetLabel() != "Save" || v.actions.GetButton(1).GetLabel() != "Revert" {
t.Errorf("actions bar has %d buttons", v.actions.GetButtonCount())
}