Add player roster management with AI integration#16
Open
DigitalBlueprint239 wants to merge 1 commit into
Open
Conversation
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
❌ Deploy Preview for magical-starlight-0c1207 failed.
|
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.
Summary
Implement a complete player roster management system with Firestore persistence and AI awareness. Players are stored as subcollections under teams (
teams/{teamId}/players/{playerId}), enabling multi-team support and real-time synchronization. The roster feeds structured player availability and position data into AI-generated practice plans.Key Changes
New Roster Types & Services
src/types/roster.ts: Comprehensive football roster types including:FootballPositionenum (22 positions: QB, RB, WR, TE, OL, DL, LB, DB, K, P, LS)PositionGroupenum (Offense, Defense, Special Teams)RosterPlayerinterface with availability status, experience level, injury notesRosterSummaryfor AI consumption with position group breakdownssrc/services/roster-service.ts: Firestore CRUD operationssubscribeToRoster()for live updatespositionGroupbased on position selectionteams/{teamId}/players/{playerId}Roster Context & State Management
src/contexts/RosterContext.tsx: React context providerRosterSummarycomputation with injury tracking and position group statsgetRosterContextForAI()method that formats roster data for AI promptsuseRoster()for component accessUI Components
src/features/roster/PlayerRoster.tsx: Main roster viewsrc/features/roster/AddPlayerForm.tsx: Slide-over formsrc/features/roster/PlayerDetail.tsx: Edit/delete slide-oversrc/features/roster/PlayerCard.tsx: Compact player displaysrc/features/roster/RosterSummaryBar.tsx: Stats barAI Integration
Practice Planner enhancement (
src/features/practice-planner/PracticePlanner.tsx):rosterSummaryto AI service for roster-aware practice plan generationAI Service update (
src/services/ai-service.ts):Dashboard Integration
src/components/Dashboard.tsx:PlayerRostercomponentApp Setup
src/App.tsx: Wrapped withRosterProviderfor global roster statesrc/types/firestore-schema.ts: Updated collection references to note subcollection usageNotable Implementation Details
2
https://claude.ai/code/session_011J8e3UovjUyiKd1u5f8DWE