mirror of
https://github.com/AmanTahiliani/box-box.git
synced 2026-08-07 19:56:18 -04:00
Consolidate the Race Story section into a cohesive timeline surface: custom chapter-strip scrolling with active-card sync, unified segmented playback controls, chapter bands on the position graph with decimated axes and de-collided labels, map toggle gated by an on-mount replay/outline probe, and shared empty-state cards. Adds vitest coverage and visual snapshots. Note: replay/outline queries now probe on mount (not only when Map opens) so the toggle can be hidden before users hit a dead panel. Co-authored-by: Cursor <cursoragent@cursor.com>
15 lines
486 B
TypeScript
15 lines
486 B
TypeScript
import type { ReplayFramesResponse, TrackOutline } from '../types'
|
|
|
|
/** Whether replay map can render (probe uses existing frames + outline queries). */
|
|
export function isReplayMapAvailable(
|
|
replay: ReplayFramesResponse | null | undefined,
|
|
outline: TrackOutline | null | undefined,
|
|
hasError: boolean,
|
|
): boolean {
|
|
if (hasError) return false
|
|
const frames = replay?.frames ?? []
|
|
if (frames.length < 2) return false
|
|
if (!outline?.points?.length) return false
|
|
return true
|
|
}
|