Search model
There is one library query. Both search fields show it and both set it (D-322d T-41, CHECKLIST 8.1).
- Header search (every page): Enter or the search button opens the library with the query in the URL (
/?q=…), so a query can be shared as a link. - Filter panel search (library; the navbar filter toggle or
/?filters=1opens the panel): sets the query in place, together with the other filters. - Both fields always show the current query,
filterPanelState.query, which the library sets whenever it loads tracks. Typing changes only the field until you search. - Clear in the filter panel removes the query and the other filters, and both fields become empty.
- The URL
qonly carries a query into the library. A later panel search or Clear does not rewrite it, because changing the URL would re-run the page’s server load on every search.
Code: src/lib/core/state/filterPanelState.svelte.js (query), src/lib/components/EnhancedInterface.svelte (sets it in loadTracks), src/lib/ui/layout/Navigation.svelte and src/lib/features/library/components/QuickFilters.svelte (show it). Test: tests/search-model.spec.js.