From 8671bb255398168ae5c93da938bffeb1febbafbc Mon Sep 17 00:00:00 2001 From: Halit Aksoy Date: Fri, 16 Oct 2026 01:40:05 +0300 Subject: [PATCH] feat(frontend): show the clocks in replays Each player's clock after the shown move, from the saved move times; games saved before the game clock show none. --- .../src/components/history/ReplayView.tsx | 15 +++++++++++++-- docs/specs/game-clock/tasks.md | 2 +- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/apps/frontend/src/components/history/ReplayView.tsx b/apps/frontend/src/components/history/ReplayView.tsx index bcf3dfa..f3a2f4f 100644 --- a/apps/frontend/src/components/history/ReplayView.tsx +++ b/apps/frontend/src/components/history/ReplayView.tsx @@ -7,6 +7,7 @@ import { DEFAULT_ANIMATION_INTERVAL, GameRecord, getBoardAfterMove, + getClockAtMove, getColorByBrightness, getPlayerDisplayName, PitAnimator, @@ -28,6 +29,7 @@ import HeaderbarIcon from "../headerbar/HeaderbarIcon"; import HeaderbarTitle from "../headerbar/HeaderbarTitle"; import ThemeSwitchMenu from "../headerbar/ThemeSwitchMenu"; import PageContainer from "../PageContainer"; +import GameClockView from "../GameClockView"; import Row from "../Row"; import MoveList from "./MoveList"; @@ -149,6 +151,12 @@ const ReplayView: FunctionComponent<{ context: Context, theme: Theme, record: Ga ? [record.player1, stones[PLAYER1_STORE], record.player2, stones[PLAYER2_STORE]] : [record.player2, stones[PLAYER2_STORE], record.player1, stones[PLAYER1_STORE]]; const atEnd = moveNumber >= total; + // Each player's clock after the shown move; games saved before the game clock have none. + const clockTimes = getClockAtMove(record, moveNumber); + const renderClock = (player: PlayerSummary) => clockTimes && ( + + ); const controlButton = (label: string, title: string, onClick: () => void, disabled = false) => (