Persist dashboard periods and explore genre filters in URL via nuqs

- Add `nuqs` dependency; define `dashboardSearchParams` and
  `exploreSearchParams` loaders in new `search-params.ts` files
- Thread `moviePeriod`/`episodePeriod` from URL into `StatsSection`
  and `StatsDisplay`, replacing local `useState` with `useQueryStates`
- Rename `getUserStats` fields `moviesThisMonth`/`episodesThisWeek` →
  `movieCount`/`episodeCount` and accept period args so SSR stats
  match the active URL params
- Pre-fetch genre-filtered results server-side on the explore page
  when `movieGenre`/`tvGenre` params are present; pass as
  `initialGenreItems` to `FilterableTitleRow` so first paint is
  already populated
- Render genre chips as `<Link>` elements (with click-handler
  fallback) so genre selections produce shareable, bookmarkable URLs
This commit is contained in:
2026-03-08 14:32:09 -04:00
parent 0838e5fb74
commit 2bb5af042b
12 changed files with 213 additions and 70 deletions
+1
View File
@@ -36,6 +36,7 @@
"motion": "12.35.1",
"next": "16.1.6",
"node-vibrant": "4.0.4",
"nuqs": "2.8.9",
"openapi-fetch": "0.17.0",
"react": "19.2.4",
"react-day-picker": "9.14.0",