Skip to content

feat: sync /races filters to the URL and make /courses navigable#254

Merged
rootulp merged 1 commit into
mainfrom
worktree-velvet-seeking-nova
Jul 16, 2026
Merged

feat: sync /races filters to the URL and make /courses navigable#254
rootulp merged 1 commit into
mainfrom
worktree-velvet-seeking-nova

Conversation

@rootulp

@rootulp rootulp commented Jul 16, 2026

Copy link
Copy Markdown
Owner

Summary

Addresses Reddit feedback on tritimes.org with two UX improvements:

1. /races search updates the URL

Previously the distance/year/search filters lived only in client state, so a filtered view couldn't be shared and hitting Back from a race lost your filters.

Now the filters are reflected in the URL (/races?distance=140.6&q=wisconsin):

  • Shareable — send someone a link to exactly the races you're looking at.
  • Back-button friendly — click a race, hit Back, and your filters are still there (no re-typing when comparing multiple years of the same race).

Implemented by making the URL the single source of truth (derived during render via useSearchParams), so back/forward restoration is free. Uses router.replace so typing doesn't spam history.

2. /courses is now navigable

The redditor noted the Courses page was "a bit deceiving" — it only listed the 10 fastest courses and nothing was clickable.

  • Added a full, alphabetical, clickable list of every course for the selected distance, below the existing charts.
  • The existing top-10 chart bars are now clickable too.
  • Clicking any course lands on a pre-filtered /races view (e.g. /races?distance=140.6&q=Wisconsin), reusing improvement Back to search link on result page should navigate to home #1.

Implementation notes

  • New pure module app/src/lib/races-url.ts handles filter↔URL (de)serialization and the course-link helper, with unit tests (races-url.test.ts).
  • /races wraps RaceList in <Suspense> (required for useSearchParams); the route stays statically rendered.
  • The full CourseList is the accessible, keyboard-navigable path; clickable chart bars are a convenience enhancement.

Testing

  • 14 new unit tests for races-url (171 total passing).
  • Verified end-to-end in a browser (Playwright): URL sync on type, reload pre-populates, Back restores filters, and course links land pre-filtered.
  • npm run build succeeds; /races and /courses remain static.

🤖 Generated with Claude Code

https://claude.ai/code/session_01DLbmbQZFx5Ffuu4LUhPj6p

@vercel

vercel Bot commented Jul 16, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
tritimes Ready Ready Preview, Comment Jul 16, 2026 4:42am

@rootulp rootulp self-assigned this Jul 16, 2026
@coderabbitai

coderabbitai Bot commented Jul 16, 2026

Copy link
Copy Markdown

Warning

Review limit reached

@rootulp, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 31 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 2ff7a3b9-c523-4b1a-9806-2be97777a662

📥 Commits

Reviewing files that changed from the base of the PR and between e473a25 and 019a816.

📒 Files selected for processing (8)
  • app/src/app/courses/course-charts.tsx
  • app/src/app/courses/course-list.tsx
  • app/src/app/courses/page.tsx
  • app/src/app/races/page.tsx
  • app/src/app/races/race-list.tsx
  • app/src/components/CourseBarChart.tsx
  • app/src/lib/__tests__/races-url.test.ts
  • app/src/lib/races-url.ts
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch worktree-velvet-seeking-nova

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

Addresses Reddit feedback on tritimes.org:

- The /races filters (distance, year, search) now live in the URL, so a
  filtered view is shareable and Back from a race detail restores it. The
  URL is the single source of truth (derived during render), replacing the
  local useState mirror.
- The /courses page gains a full, alphabetical, clickable list of every
  course per distance (previously only the top-10 charts were shown, and
  nothing was clickable). Chart bars are now clickable too. Both link to a
  pre-filtered /races view for that course.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DLbmbQZFx5Ffuu4LUhPj6p
@rootulp
rootulp force-pushed the worktree-velvet-seeking-nova branch from a1135b5 to 019a816 Compare July 16, 2026 04:38
@rootulp
rootulp marked this pull request as ready for review July 16, 2026 04:41
@rootulp
rootulp enabled auto-merge (squash) July 16, 2026 04:41
@rootulp
rootulp merged commit f464965 into main Jul 16, 2026
7 checks passed
@rootulp
rootulp deleted the worktree-velvet-seeking-nova branch July 16, 2026 04:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant