Movies and Series: Enter adds, a no longer does

The status bar only ever named Enter, while the hint for searching
releases of a title not in the library said (a). Enter is now the one
key for adding, and the hint says Enter.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-10-23 23:23:34 +02:00
co-authored by Claude Opus 5.5
parent 9b8d59bd48
commit 8775c27aab
6 changed files with 30 additions and 8 deletions
+23
View File
@@ -128,3 +128,26 @@ func TestListNumbersAreRightAligned(t *testing.T) {
t.Errorf("after resize: numbers end in columns %v", e)
}
}
func TestEnterAddsAndAIsAnOrdinaryKey(t *testing.T) {
a := newTestApp(t)
v := a.searches[0]
v.setResults([]result{movieResult{Movie: radarr.Movie{Title: "Dune", Year: 2021, TMDBID: 1}}})
// a is no longer a key of the list: it goes on to the list (which ignores it).
if got := v.list.GetInputCapture()(tcell.NewEventKey(tcell.KeyRune, 'a', 0)); got == nil {
t.Error("a is still taken by the list")
}
// The hint for releases of a title not in the library names Enter.
v.interactive(0)
if msg := plainText(a.status.GetText(false)) + toastText(a); !strings.Contains(msg, "first (Enter)") {
t.Errorf("hint: %q", msg)
}
}
func toastText(a *App) string {
var b strings.Builder
for _, t := range a.toasts {
b.WriteString(t.text)
}
return b.String()
}
+1 -1
View File
@@ -27,7 +27,7 @@ var helpSections = []helpSection{
}},
{title: "Movies and Series", items: []helpItem{
{"/", "focus the search box"},
{"Enter, a", "add the selected title (dialog: ↑↓ move, ←→ change a dropdown, Space toggles, Enter/Space opens a list)"},
{"Enter", "add the selected title (dialog: ↑↓ move, ←→ change a dropdown, Space toggles, Enter/Space opens a list)"},
{"i", "interactive release search (library titles)"},
{"[ ]", "with an empty search box: previous / next Trakt list (trending now, most watched this week, anticipated, popular; movies also the US box office); needs a Trakt client ID (Config view)"},
{"r", "reload the Trakt list"},
+1 -4
View File
@@ -125,9 +125,6 @@ func newSearchView(app *App, be backend) *searchView {
v.reloadList()
return nil
}
case 'a':
v.add(v.list.GetCurrentItem())
return nil
case 'i':
v.interactive(v.list.GetCurrentItem())
return nil
@@ -347,7 +344,7 @@ func (v *searchView) interactive(i int) {
}
r := v.results[i]
if !r.inLibrary() {
v.app.SetMessage(fmt.Sprintf("[yellow]Add %s to %s first (a), then search for releases", tview.Escape(r.title()), v.be.name()))
v.app.SetMessage(fmt.Sprintf("[yellow]Add %s to %s first (Enter), then search for releases", tview.Escape(r.title()), v.be.name()))
return
}
v.be.interactive(v, r)