Category menu now filters the grid and scrolls down to it#12
Merged
Conversation
The category row links navigated with a #browse hash that neither re-applied the filter nor scrolled when already on the home page. Replace them with a CategoryNav client component whose buttons: - on the home page, dispatch a filter event (BrowseSection applies the theme) and smooth-scroll down to the grid - on a guide page, navigate home with ?theme=<Category> BrowseSection now listens for the filter event in addition to reading the query param, and #browse gets scroll-mt so it clears the sticky two-row header when scrolled into view.
Rework the home filter box to use the full width and offer more to click: - Three grouped, space-filling grids (Theme, Genre, Awards) instead of a single left-column Theme list - One-word labels everywhere (Power, Dystopian, Pulitzer, …) with the full canonical name on hover (title=) - A book count badge on every pill - New Awards facet derived from existing book.awards (Pulitzer, Booker, National, Newbery, Bestseller); adds ActiveFilters.award + filterBooks award clause + facetOptions()/counts helpers in filters.ts - Header category row now uses the same one-word labels with counts Pill gains optional count badge + full-width (block) variant.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Make the category menu filter and scroll to the books
The screenshot showed the bug: clicking a category (e.g. Power & Politics) did nothing — it still read "50 of 50" and didn't move the page. The old links used a
#browsehash that neither re-applied the filter nor scrolled when you were already on the home page.Fix
CategoryNav.tsxclient component replaces the static category links. Each category is now a button that:sparky:filter-themeevent) and smooth-scrolls down to the book grid, so you immediately see the filtered books.?theme=<Category>.BrowseSection.tsxnow listens for the filter event (in addition to reading the?theme=query param), so the grid updates instantly.scroll-mt-24to the#browsesection so it isn't tucked under the sticky two-row header when scrolled into view.Verify
npm run buildsucceeds (50 routes export); the PRbuildCI job runs it too.https://claude.ai/code/session_01Egnnw9v4T3ppsAQveFnijo
Generated by Claude Code