feat(series): add series navigation across cards, author pages, library and /series #10
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "feat/series-navigation"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
Series navigation: series can now be found directly, and every path (book cards,
/seriesbrowse and search, author pages, library) leads to the same series page.Changes
series:<name>subject tags. Search normalization now also readssubjectand adds tag series with the stable IDtag:<slug>(e.g.tag:the-murderbot-diaries). A tag with the same name as a linked series on the same work is dropped. Tag series have no position, so none is ever invented./series/OL…Lpage is unchanged. The new/series/tags/<slug>page uses the sameBookBibliographyUI and is labelled "positions unknown", listed by first publication year. Both pages now show the reader's saved state (e.g. "4 saved · 1 read · 1 reading · 2 to read", plus a "Show in my library" link) and per-book list controls as before./seriesbrowse and search. It lists the series of saved books from the already-loaded library, with covers, authors, saved and reading-status counts and positions. Typing filters this list locally. Submitting a search also queries Open Library and shows two lists: series whose names match the search, and series of the matching books. Results that are already in the library are marked.?series=,?group=series), and switching list tabs keeps it. Bulk edit works across groups.lg; below that the existing drawer is used.docs/current-project.md.Decisions
tag:<slug>, where the slug is the NFKC-lowercased name with non-alphanumeric runs replaced by-.series:Harry_Potterandseries:Harry Pottertherefore share one page. Only canonical slugs are accepted, so each tag has exactly one URL and cache key. The upstream querysubject:"series:<words>"is a phrase match that also matches longer tags ("Skyward Flight" for "Skyward"), so results are filtered to the exact slug./search/lists.json) only returns user lists, and/series/_autocompletecovers linked series only (it returns nothing for "mistborn")./api/series?q=therefore runs one/search.jsonwork search (the 100 most relevant works, with series and subject fields only) and collects the linked and tagged series of those works.Request counts (all through the existing persistent cache)
/seriessaved list, saved-state summarysubjectis now requested/series?q=submit/series/OL…L/series/tags/<slug>Changing the field list changes cache keys, so existing cached search responses are refetched once.
Known limitations
Verification
pnpm lint-fullpasses on every commit.chrisp_w2_series./series/tags/the-murderbot-diarieswith 10 books and "4 saved · 1 read · 1 reading · 2 to read"./seriesfilter and the "sanderson" search (8 series). On the Sanderson author page, every series heading links (/series/tags/skyward, …). Library grouped by series with "No series (65)", filtered to Harry Potter, and the Read tab keeps the filter. Navbar checked at 660px and 1024px./api/series/OL326110L(9 books,source: catalog), and/api/series/tags/Bad%20Slugreturns 400./seriesis fixed in6ae8640.Demo
Download the demo video
Reviewed the 12 commits in
feat/series-navigationagainstgit merge-base origin/master HEAD, excluding the unrelated master changes.Important — fix before merge
Preserve Unicode tag identities and produce valid slugs —
shared/utils/series.ts:13, also used byserver/utils/open-library.ts:80andserver/api/series/tags/[slug].get.ts:14–21.The slug keeps Unicode letters and numbers but removes combining marks, which are meaningful parts of many writing systems. For example,
tagSeriesSlug('शिवा')andtagSeriesSlug('शिव')both returnश-व. These distinct tag names therefore get the same saved series ID, library group, filter and page; the route also reconstructs the upstream phrase asseries:श व, losing the original spelling. This goes beyond the intended underscore/space equivalence.There is also a Unicode boundary failure in the same function:
.slice(0, 120)counts UTF-16 code units. For'x'.repeat(119) + '𐐀', the generated slug ends in an unpaired surrogate,isTagSeriesSlug(slug)returns false, andseriesPath({ id: 'tag:' + slug })throwsURIError: URI malformed. A returned subject tag can consequently break card rendering and cannot be saved as a valid series ID.Please preserve meaningful Unicode marks and use an identity/query representation that retains the tag name (while still intentionally merging underscore/space variants). Bound it without splitting Unicode characters, and ensure every generated ID passes its validator and can be passed to
seriesPath. This should preserve the one-upstream-request budget.Other categories
Validation:
pnpm lint-fullpassed; reproduced the Unicode cases directly against the shared utility without adding tests or modifying repository files. Reviewed route/query validation, submitted-search request flow, raw subject handling, grouping/filtering and bulk-selection code. Subjects are retained in the upstream cache but stripped from normalized client/library book metadata. The field-list change causes cold cache misses and larger upstream responses as documented; no additional upstream fetch loop was found. No dev server or containers were started.Fixed in
ce671b3(docs:9109c62).tagSeriesSlugnow keeps combining marks ([^\p{L}\p{M}\p{N}]+→-), soशिवाandशिवget distinct IDs. The upstream phrase rebuilt from the slug keeps their spelling. Underscore/space/punctuation variants still merge (series:Harry_Potter=series:Harry Potter).seriesNameKeykeeps marks too, so tag/linked-name matching doesn't merge them either.isTagSeriesSlugcaps the slug at 120 code points, andseriesTagNameskips tags whose slug is empty or too long. Every generatedtag:ID therefore passesisSeriesIdand works withseriesPath. Truncating would also have merged distinct names, which is why over-long tags are skipped. Lone surrogates aren't letters, marks or digits, so they become separators and never reachencodeURIComponent.'x'.repeat(119) + '𐐀'is valid and routable, a 121-character tag is skipped,İstanbul→i̇stanbulis valid. Request counts are unchanged, still one upstream request per tag page and language.pnpm lint-fullpasses.9109c62b49toa5964f5e36