-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Description
Summary
Allow users to select 2 or more players and compare their stats side-by-side.
Details
Backend
GET /api/v1/compare?players={platform1}:{tag1},{platform2}:{tag2},...- Fetches stats for all specified players (in parallel)
- Returns an array of player stat objects
- Max 4 players per comparison (to keep UI manageable)
Frontend — Compare Flow
- Entry points:
- "Compare" button on any player's stats page → adds them as first comparison target
/compareroute with empty state prompting user to add players- Direct URL with query params:
/compare?p=uno:player1,xbl:player2
- Player selection:
- Search bar to add players (reuse search component from [Feature] Player search — gamertag input and platform selection #9)
- "Add Player" chips showing selected players with remove (X) button
- Quick-add from squad members if a squad exists
- Comparison table:
- Rows = stats (K/D, Wins, Kills, etc.)
- Columns = players
- Highlight best value in each row (green bold) and worst (red subtle)
- Percentage difference from the "best" shown in each cell
Frontend — Compare Visualizations
- Overlaid radar chart: All players on one radar chart with different colors
- Grouped bar chart: Side-by-side bars per stat per player
- Toggle between table view and chart view
Pinia Store (useCompareStore)
interface CompareStore {
players: PlayerIdentifier[] // { platform, gamertag }
statsMap: Map<string, PlayerStats>
addPlayer(platform: string, gamertag: string): void
removePlayer(gamertag: string): void
fetchAllStats(): Promise<void>
}Acceptance Criteria
- Can add 2-4 players for comparison
- Side-by-side stat table with best/worst highlighting
- Overlaid radar chart with per-player colors
- Grouped bar chart comparison
- Players addable from search or squad quick-add
- Handles mixed results (one player private, others public)
Reactions are currently unavailable