Repository navigation
Add championship progress chart - #4
Merged
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
Adds a Championships Explorer page that fetches season data from a new API endpoint and renders a cumulative points progression line chart for drivers/constructors using CSV-backed mock data.
Changes:
- Introduces
/api/championshipsendpoint + server/mock service to build season payloads fromtemp-data/*.csv. - Adds new championships UI (year picker, category tabs, points progression chart with legend expansion) and wires it into
/championships. - Adds
rechartsdependency and test coverage for the explorer component and API route.
Reviewed changes
Copilot reviewed 20 out of 29 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| temp-data/status.csv | Adds status lookup data used by the CSV dataset. |
| temp-data/sprint_results.csv | Adds sprint results dataset (not yet consumed by mocks). |
| temp-data/seasons.csv | Adds seasons metadata dataset. |
| temp-data/drivers.csv | Adds drivers dataset used to build driver display names. |
| temp-data/constructors.csv | Adds constructors dataset used for constructor names/colors. |
| temp-data/circuits.csv | Adds circuits dataset (not yet consumed by mocks). |
| src/types/championship.ts | Introduces shared types for championship payloads/progress. |
| src/lib/server/championships.ts | Adds server service wrapper, year validation, and error mapping. |
| src/lib/mocks/championships.ts | Builds/caches dataset from CSVs and derives year payloads. |
| src/components/championships/championshipTransforms.ts | Transforms year payload into drivers/constructors chart series. |
| src/components/championships/YearSelect.tsx | Adds season dropdown control. |
| src/components/championships/PointsProgressChart.tsx | Adds Recharts-based cumulative points line chart + legend. |
| src/components/championships/ChampionshipsExplorer.tsx | Adds client-side data fetching + category/year controls. |
| src/components/championships/ChampionshipsExplorer.spec.tsx | Adds UI behavior tests for fetching, switching tabs, and errors. |
| src/components/championships/CategoryTabs.tsx | Adds drivers/constructors tab UI. |
| src/app/layout.tsx | Adjusts layout to prevent overflow issues for full-height pages. |
| src/app/championships/page.tsx | Replaces placeholder page with the Championships Explorer. |
| src/app/api/championships/route.ts | Adds GET endpoint for championship year payloads. |
| src/app/api/championships/route.spec.ts | Adds API route tests for valid/invalid/default year behavior. |
| package.json | Adds recharts dependency. |
| package-lock.json | Locks recharts and transitive dependencies. |
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.
No description provided.