Skip to content

Add full Player Roster (CRUD) with AI integration and Dashboard UI#20

Open
DigitalBlueprint239 wants to merge 1 commit intomasterfrom
codex/checkpoint-claude-s-branch-and-create-codex-branch
Open

Add full Player Roster (CRUD) with AI integration and Dashboard UI#20
DigitalBlueprint239 wants to merge 1 commit intomasterfrom
codex/checkpoint-claude-s-branch-and-create-codex-branch

Conversation

@DigitalBlueprint239
Copy link
Copy Markdown
Owner

Motivation

  • Provide a first-class player roster feature so coaches can manage players and let the AI produce roster-aware practice plans.
  • Surface roster data in the dashboard and practice planner so AI-generated plans can account for positions, availability, and injuries.
  • Store roster data as a Firestore subcollection under teams/{teamId}/players for per-team isolation and real-time sync.

Description

  • Added roster types and utilities in src/types/roster.ts including FootballPosition, PositionGroup, RosterPlayer, and RosterSummary used across the app.
  • Implemented Firestore CRUD and real-time subscription in src/services/roster-service.ts using the teams/{teamId}/players subcollection plus jersey-number uniqueness check.
  • Introduced RosterContext (src/contexts/RosterContext.tsx) to provide real-time players, computed summary, CRUD wrappers, isJerseyNumberTaken, and getRosterContextForAI() which builds a natural-language roster summary for prompts.
  • Added roster UI components: PlayerRoster, PlayerCard, PlayerDetail, AddPlayerForm, and RosterSummaryBar under src/features/roster/ with depth-chart grouping and a FAB to add players.
  • Integrated roster into the app shell and dashboard by wrapping RosterProvider in App.tsx and adding a Roster tab, roster stat card, and quick-action shortcuts in src/components/Dashboard.tsx.
  • Updated PracticePlanner to use useRoster() and pass teamContext.rosterSummary into AI calls, and switched to ai.generatePracticePlan(...) to consume the new team context.
  • Tied roster into AI prompt generation by enhancing buildPracticePlanPrompt in src/services/ai-service.ts to inject the roster block when available.
  • Updated Firestore schema/types in src/types/firestore-schema.ts to include TeamContext.rosterSummary and added TEAM_PLAYERS helper; added project tracking MASTER_TRACKER.md documenting progress and known issues.

Testing

  • Performed TypeScript type-check with tsc --noEmit, which completed successfully.
  • No new automated unit tests were added for this change and no test suite failures were observed during the type-check step.

Codex Task

Build complete player roster feature end-to-end:
- Football-specific types (22 positions, position groups, experience levels)
- Firestore subcollection at teams/{teamId}/players/{playerId} with real-time listener
- Roster UI with depth-chart layout grouped by Offense/Defense/Special Teams
- Add/edit/delete players with jersey number uniqueness validation
- Availability status with color-coded indicators (green/yellow/red/grey)
- Roster summary bar with live counts pinned at top
- AI connection: getRosterContextForAI() feeds roster state into practice plan prompts
- Practice Planner shows empty-roster prompt when no players exist
- Dashboard stat card shows real player count from Firestore
- Fix PracticePlanner to use correct generatePracticePlan method

Files created:
- src/types/roster.ts
- src/services/roster-service.ts
- src/contexts/RosterContext.tsx
- src/features/roster/ (5 components)
- MASTER_TRACKER.md

Files modified:
- src/App.tsx (add RosterProvider)
- src/components/Dashboard.tsx (add Roster tab + live stats)
- src/features/practice-planner/PracticePlanner.tsx (fix AI method + roster context)
- src/services/ai-service.ts (add roster block to prompt)
- src/types/firestore-schema.ts (add subcollection path + rosterSummary field)

https://claude.ai/code/session_011J8e3UovjUyiKd1u5f8DWE
@netlify
Copy link
Copy Markdown

netlify Bot commented Feb 27, 2026

Deploy Preview for magical-starlight-0c1207 failed.

Name Link
🔨 Latest commit 4a414eb
🔍 Latest deploy log https://app.netlify.com/projects/magical-starlight-0c1207/deploys/69a10d033394e900081dc47f

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant