feat(search): group results by main book with variants and related material #11
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "feat/cleaner-search-results"
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?
Cleaner search results
Search and series pages now group each fetched page so that main books come first. Known variants collapse under their main result, and collections, box sets, study guides and adaptations move to a "Related material" section that is collapsed by default. Grouping runs on the client from data already in the response and the reader's library, so it adds no Open Library request.
Changes
shared/utils/result-grouping.ts:groupBookResults(books, { links, collectionHints, rejectedPairs, canonicalWork, ungrouped })returns main groups, related groups and per-main related counts.BookGroupedResultsandBookResultGroupInfocomponents:BookLibraryGrid: anextraslot,itemClass, andresultBooks, so relationship pickers and same-page links cover the whole page when it is split into two grids.useBookRelationships().rejectedPairs(): pairs rejected in responses or locally since the responses were fetched.editionCount(edition_countadded to the existing search field list; it is accepted in save payloads but not stored).docs/current-project.md.Grouping rules (for each result, first match wins)
part_ofmakes a variant;contains,adaptation_ofandstudy_guide_formake related material.Groups are placed at the position of their earliest member. The main result of a group is the mapped or parent book when known. Otherwise it is chosen in this order: has authors, has no part label, most ratings, most editions, earliest in catalogue order. Every grouped card says why it was grouped and whether that was recorded or a heuristic. Confirm, Not related, Same book as… and the Related menu work on every card and regroup immediately.
Pagination
numFound.Verification
pnpm lint-fullpasses.Known limits