Skip to content

feat(search): jump from library search into Add New for the same term - #991

Open
dny238 wants to merge 2 commits into
Listenarrs:canaryfrom
dny238:feat/library-search-add-new-affordance
Open

dny238 wants to merge 2 commits into
Listenarrs:canaryfrom
dny238:feat/library-search-add-new-affordance

Conversation

@dny238

@dny238 dny238 commented Sep 16, 2026

Copy link
Copy Markdown

Summary

The header search bar searches the library you already have. When the book you want isn't added yet, it just shows "No matches", with no hint that you should go to Add New — two separate search entry points that are easy to confuse.

This mirrors Sonarr: whenever a term is present, the header dropdown now also offers a "Search for '<term>'" affordance that jumps straight into the Add New metadata search, pre-filled and auto-run.

Behavior

  • The affordance appears in the header search dropdown whenever a term is typed — shown alongside local library matches, and in place of the bare "No matches" state.
  • Clicking it navigates to the Add New page (/add-new?q=<term>); the query auto-runs there.
  • Enter with no local match now falls through to the same jump (so typing a not-yet-owned title + Enter takes you to Add New instead of doing nothing).
  • Using the affordance again while already on Add New re-runs the search (route-query watch), since the view isn't remounted.

Changes

  • fe/src/App.vue — affordance row + styles in the header dropdown, searchExternally() handler (router.push({ name: 'add-new', query: { q } })), Enter fallthrough.
  • fe/src/views/content/AddNewView.vue — read ?q= on mount and auto-run; watch route.query.q for subsequent jumps.

No backend changes — performSearch() already auto-detects the search type from the term.

Verification

vue-tsc type-check, ESLint, and Prettier all clean on the changed files.

Note

Screenshot reference: Sonarr's global search showing an "Add New … / Search for X" item in the same dropdown as existing-library matches — this brings the same escape hatch to Listenarr.

🤖 Generated with Claude Code

…to Add New

The header search bar only ever searches the library you already have, which is
confusing when the book you want isn't added yet — it just shows "No matches".
Mirror Sonarr: whenever a term is present, the dropdown now also offers a
"Search for '<term>'" affordance that jumps into the Add New metadata search
with the term pre-filled and auto-run.

- App.vue: add the affordance row in the header search dropdown (shown alongside
  local matches and in place of the bare "No matches" state), a searchExternally()
  handler that pushes to the `add-new` route with ?q=<term>, and Enter now falls
  through to it when there is no local match.
- AddNewView.vue: read ?q= on mount and auto-run the search; also watch the query
  so using the affordance again while already on the page re-runs it.

No backend changes; performSearch() already auto-detects the search type.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@dny238
dny238 requested a review from a team September 16, 2026 14:20
…n view

Two follow-up fixes to the library-search Add New affordance:

- When the affordance runs a search while already on /add-new, the results
  updated further down the page with no viewport change, so it read as a no-op.
  The query-driven search now scrolls the results into view after running.
- The affordance sat after the results inside the max-height:300px scrollable
  dropdown, so a full list of local matches pushed it out of view entirely —
  which hid it on the narrow mobile overlay. It's now a sticky footer pinned to
  the bottom of the dropdown with a solid background, always reachable.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant