fix: races page — nav link, detail 404s, table UX improvements#3246
fix: races page — nav link, detail 404s, table UX improvements#3246
Conversation
The /races page exists with full data but was missing from the header navigation. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (4)
📝 WalkthroughWalkthroughUpdated the race detail page to use improved data fetching with granular error handling distinguishing between 404 and other failures. Added runtime rendering mode, enhanced source link display, and improved the race listing UI with resolved count metric, expandable rows with chevron indicators, and party column in candidate sub-table. Added Races link to primary navigation. Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Poem
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
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. Comment |
Test Coverage Report
Coverage is advisory only — no thresholds enforced. Generated by |
The total is already obvious from the table. Showing Resolved alongside Upcoming and Active gives a more useful status breakdown (total = upcoming + active + resolved). The API already returns stats.races.resolved. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
… codes - Replace max-w-xs truncate on AI Angle column with line-clamp-2 and hover tooltip - Add ChevronRight/ChevronDown icons as expand affordance on each row - Add Party column to expanded candidate sub-table with capitalize class - Show (state) fallback for ballot measures that lack district codes Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Switch from fetchFromWikiServer to fetchDetailed for proper error discrimination: true 404s (race not found) still trigger notFound(), but connection errors and server failures show a user-friendly message instead of a misleading 404 - Add dynamic = "force-dynamic" so Next.js does not attempt to statically generate these wiki-server-dependent pages during build - Extract domain from source URLs for compact display (e.g., "prospect.org" instead of the full URL) while keeping full URL as href Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
revalidate is ignored when dynamic = "force-dynamic". The fetch-level revalidate: 300 in the fetchDetailed call handles caching correctly. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Summary
/races/[id]) returned 404 on direct navigation — switched toforce-dynamicrendering withfetchDetailedfor proper error handling instead of misleading 404smax-w-xs truncatewithline-clamp-2+ hover tooltip so the most informative column is readableAlso ran production data fixes (not in this PR):
Test plan
pnpm buildpassespnpm testpasses (no races-specific tests to add — pure UI changes)🤖 Generated with Claude Code
Summary by CodeRabbit
Release Notes
New Features
Bug Fixes
UI Improvements