mirror of
https://github.com/AmanTahiliani/box-box.git
synced 2026-08-07 11:54:59 -04:00
feat(race-story): polish chapter strip, controls, graph, and map UX (#68)
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>
This commit is contained in:
BIN
tests/visual/__snapshots__/desktop/race-story.png
Normal file
BIN
tests/visual/__snapshots__/desktop/race-story.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 58 KiB |
BIN
tests/visual/__snapshots__/mobile/race-story.png
Normal file
BIN
tests/visual/__snapshots__/mobile/race-story.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 43 KiB |
BIN
tests/visual/__snapshots__/tablet/race-story.png
Normal file
BIN
tests/visual/__snapshots__/tablet/race-story.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 52 KiB |
@@ -36,6 +36,14 @@ export async function gotoRaceHubReady(page: Page, sessionKey = FULL_SESSION): P
|
||||
await waitForScreenshotReady(page)
|
||||
}
|
||||
|
||||
export async function gotoRaceStoryReady(page: Page, sessionKey = FULL_SESSION): Promise<void> {
|
||||
await page.goto(`/race-hub?session_key=${sessionKey}`)
|
||||
await expect(page.getByTestId('race-hub')).toBeVisible()
|
||||
await page.getByRole('tab', { name: 'Race Story' }).click()
|
||||
await expect(page.getByTestId('position-chart')).toBeVisible()
|
||||
await waitForScreenshotReady(page)
|
||||
}
|
||||
|
||||
export async function gotoDataLibraryReady(page: Page): Promise<void> {
|
||||
await page.goto('/admin')
|
||||
await expect(page.getByTestId('data-library')).toBeVisible()
|
||||
|
||||
9
tests/visual/race-story.spec.ts
Normal file
9
tests/visual/race-story.spec.ts
Normal file
@@ -0,0 +1,9 @@
|
||||
import { test } from '@playwright/test'
|
||||
import { gotoRaceStoryReady, screenshotPage } from './helpers'
|
||||
|
||||
test.describe('Race Story visual regression', () => {
|
||||
test('race-story', async ({ page }) => {
|
||||
await gotoRaceStoryReady(page)
|
||||
await screenshotPage(page, 'race-story')
|
||||
})
|
||||
})
|
||||
Reference in New Issue
Block a user