diff --git a/apps/web/src/arcade-games/card-sorting/components/PlayingPhaseDrag.tsx b/apps/web/src/arcade-games/card-sorting/components/PlayingPhaseDrag.tsx index f93f1792..5881da47 100644 --- a/apps/web/src/arcade-games/card-sorting/components/PlayingPhaseDrag.tsx +++ b/apps/web/src/arcade-games/card-sorting/components/PlayingPhaseDrag.tsx @@ -826,6 +826,8 @@ export function PlayingPhaseDrag() { // Spectator educational mode (show correctness indicators) const [spectatorEducationalMode, setSpectatorEducationalMode] = useState(false) + // Spectator stats sidebar collapsed state + const [spectatorStatsCollapsed, setSpectatorStatsCollapsed] = useState(false) const containerRef = useRef(null) const dragStateRef = useRef<{ @@ -1343,6 +1345,180 @@ export function PlayingPhaseDrag() { )} + {/* Spectator Stats Sidebar */} + {isSpectating && ( +
+ {/* Collapse/Expand Toggle */} + + + {/* Stats Content */} +
+

+ 📊 Live Stats +

+ + {/* Time Elapsed */} +
+
+ ⏱️ Time Elapsed +
+
+ {Math.floor(elapsedTime / 60)}:{(elapsedTime % 60).toString().padStart(2, '0')} +
+
+ + {/* Cards Placed */} +
+
+ 🎯 Cards Placed +
+
+ {state.placedCards.filter((c) => c !== null).length} / {state.cardCount} +
+
+ {Math.round( + (state.placedCards.filter((c) => c !== null).length / state.cardCount) * 100 + )} + % complete +
+
+ + {/* Current Accuracy */} +
+
+ ✨ Current Accuracy +
+
+ {(() => { + const placedCards = state.placedCards.filter((c): c is SortingCard => c !== null) + if (placedCards.length === 0) return '0%' + const correctCount = placedCards.filter( + (c, i) => state.correctOrder[i]?.id === c.id + ).length + return `${Math.round((correctCount / placedCards.length) * 100)}%` + })()} +
+
+ Cards in correct position +
+
+ + {/* Numbers Revealed */} +
+
+ 👁️ Numbers Revealed +
+
+ {state.numbersRevealed ? '✓ Yes' : '✗ No'} +
+
+
+
+ )} + {/* Floating action buttons */} {!isSpectating && (