feat(series): multi-field search, sort-direction toggle, apply placement

Toolbar feedback round: the series search box now matches whatever the
main search matches for a group — series NAME, any book's AUTHOR, and
any book's TITLE inside the series (WHERE EXISTS per group-row, so
counts stay true); the separate author input is gone from the toolbar
(the author= param stays live for the JSON API and deep links). The
sort control becomes a base-key select (Date added/Name/Author/Books/
Progress/Last read) plus a chevron direction toggle that flips and
resubmits; sort/dir compose through ResolveSeriesSort (full registry
keys keep working for back-compat, unknown base keys fall to recent).
The search/apply button moved next to the search box as requested, and
default URLs stay clean (sort/dir only emitted once the user chooses).
This commit is contained in:
John O'Keefe committed 2026-10-27 19:05:23 -04:00
1 parent 14285ff314
commit 96c1228805
11 files changed
+504 -149

No files matched your search

+22 -2
View File
@@ -4104,7 +4104,19 @@ WHERE (sqlc.narg('library_id')::uuid IS NULL OR library_id = sqlc.narg('library_
AND archived_at IS NULL
AND missing_scan_count = 0
AND series IS NOT NULL AND series != ''
AND (sqlc.narg('series_query')::text IS NULL OR series ILIKE '%' || sqlc.narg('series_query')::text || '%')
-- Multi-field search (series page): the query matches the series
-- NAME, any book's AUTHOR, or any book's TITLE in the group. It is
-- a WHERE filter: a group qualifies when ANY of its rows matches,
-- so COUNT(*) keeps reporting the whole series.
AND (sqlc.narg('series_query')::text IS NULL OR
series ILIKE '%' || sqlc.narg('series_query')::text || '%'
OR author ILIKE '%' || sqlc.narg('series_query')::text || '%'
OR EXISTS (
SELECT 1 FROM media_items sib
WHERE sib.library_id = media_items.library_id
AND sib.series = media_items.series
AND sib.title ILIKE '%' || sqlc.narg('series_query')::text || '%'
))
GROUP BY library_id, series
HAVING (sqlc.narg('author_query')::text IS NULL OR BOOL_OR(author ILIKE '%' || sqlc.narg('author_query')::text || '%'))
AND (
@@ -4152,7 +4164,15 @@ SELECT COUNT(*)::int FROM (
AND archived_at IS NULL
AND missing_scan_count = 0
AND series IS NOT NULL AND series != ''
AND (sqlc.narg('series_query')::text IS NULL OR series ILIKE '%' || sqlc.narg('series_query')::text || '%')
AND (sqlc.narg('series_query')::text IS NULL OR
series ILIKE '%' || sqlc.narg('series_query')::text || '%'
OR author ILIKE '%' || sqlc.narg('series_query')::text || '%'
OR EXISTS (
SELECT 1 FROM media_items sib
WHERE sib.library_id = media_items.library_id
AND sib.series = media_items.series
AND sib.title ILIKE '%' || sqlc.narg('series_query')::text || '%'
))
GROUP BY library_id, series
HAVING (sqlc.narg('author_query')::text IS NULL OR BOOL_OR(author ILIKE '%' || sqlc.narg('author_query')::text || '%'))
AND (