JamesReviewsMusic
JRM-47Make the URL the single source of truth for filters and sorting
Description
Several pages keep local component state alongside the URL search params and the two drift. The stats page calls setSelectedGenre during render (a React anti-pattern that forces double renders), keeps selectedResource in useState so the URL param is ignored on load, SortDropdown seeds its own internal state and never syncs back, so browser back/forward desyncs every dropdown. The albums route also omits genres from loaderDeps, so genre-filtered visits preload the wrong data.
- validateSearch on every list route (albums, bookmarks, search, stats), only /artists has it today
- Filters, sort and genre selection read from Route.useSearch() and write via navigate, no shadow useState copies
- Fix the stats setState-in-render and derive the selected genre instead
- SortDropdown becomes controlled by props from the URL
- Add genres to the albums route loaderDeps
Sub-tickets
0No sub-tickets yet.
Links
No links.
Comments
0No comments yet.