Skip to content

Add drivers page - #5

Merged
dfloo merged 2 commits into
mainfrom
dev/drivers-page
Mar 21, 2026
Merged

dfloo merged 2 commits into
mainfrom
dev/drivers-page

Conversation

@dfloo

@dfloo dfloo commented Mar 21, 2026

Copy link
Copy Markdown
Owner

No description provided.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a drivers season explorer (UI + API) backed by existing CSV mock data, enabling /drivers to list drivers for a selected year.

Changes:

  • Introduces drivers season response/types and a new /api/drivers endpoint backed by a new server service.
  • Extends championship mocks to derive per-season driver lists + ordering, and adds a dedicated driver-season mock accessor.
  • Adds drivers UI components (explorer + cards) and test coverage for the explorer and API route.

Reviewed changes

Copilot reviewed 11 out of 11 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
src/types/championship.ts Adds driver-season DTO/types used by API + UI.
src/lib/server/drivers.ts New server service for fetching driver season data (mock-backed) + error mapping.
src/lib/mocks/championships.ts Refactors driver ID collection, adds sorting helper, and adds getDriverSeasonFromMocks.
src/components/drivers/DriversExplorer.tsx Client-side explorer component that fetches and renders driver season cards.
src/components/drivers/DriversExplorer.spec.tsx Tests for explorer: ordering, refetch on season change, error state.
src/components/drivers/DriverCard.tsx Driver card link to /drivers/[id].
src/app/layout.tsx Adjusts main layout sizing (min-h-0) for scroll behavior.
src/app/drivers/page.tsx Implements drivers page UI and client-side fetching (currently duplicating explorer logic).
src/app/api/drivers/route.ts Adds /api/drivers GET route (mirrors championships route behavior).
src/app/api/drivers/route.spec.ts Tests for /api/drivers route behavior (valid/invalid/default year).
src/app/championships/[year]/page.tsx Removes the dynamic championship year page route.

Comment thread src/app/drivers/page.tsx Outdated
Comment thread src/components/drivers/DriversExplorer.tsx
Comment thread src/app/drivers/page.tsx Outdated
@dfloo
dfloo merged commit 53990c2 into main Mar 21, 2026
1 check passed
@dfloo
dfloo deleted the dev/drivers-page branch March 21, 2026 00:57
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.

2 participants