Skip to content

timeline: a dot renders 98px past the track, and the test that catches it has not run in a while #263

Description

@guan4tou2

e2e/timeline-geometry.spec.ts:158 — "every dot renders inside the track (v0.9.4 P0-3)" — fails:

Error: a dot rendered past the track width
Expected: <= 1800     (track width)
Received:    1898     (max dot offsetLeft)

98px outside the track it is supposed to be clipped to.

Why this surfaced now

The test is in a serial describe, and the test before it (P0-2, lane stack scrolls vertically instead of clipping) had been failing, so Playwright reported P0-3 as did not run. It has not been evaluated for as long as P0-2 has been broken.

P0-2 was fixed on refactor/onboarding-controls — it was measuring the sidebar rather than the lane stack, because document.querySelector('div.overflow-y-auto.min-h-0') started matching the nav once 3394e9a made it scrollable. With P0-2 green, P0-3 runs for the first time in a while, and fails.

So this failure was masked, not introduced by that fix. The fix to P0-2 only changed which element the test resets scrollTop on, which is vertical and cannot move offsetLeft.

Likely culprit

The fixture seeded by the test above it (seed all 18 lanes + an out-of-range marker, line 71) includes:

['marker', { title: 'far-future marker', severity: 'critical', atTimestamp: now + 30 * 60_000 }]

and the comment beside it records what this guards: "Before the fix the domain came from timestamp only". P0-3 exists to catch the time domain failing to account for a marker's display timestamp, which puts that marker off the right edge — which is exactly the shape of this failure.

Worth looking at first: buildTimeMap in src/renderer/src/lib/timelineTimeMap.ts and displayTs in src/renderer/src/lib/timelineDomain.ts.

Open question — is this a regression?

Not yet determined. refactor/onboarding-controls changed zoom in 8109e6e feat(ui): 90% is the interface, not a setting to find and 3394e9a fix(ui): one zoom, the sidebar scrolls, and the HUD row has one height. A zoom change moves both trackW and every dot's position, so it is a plausible cause — but the test has been unevaluated long enough that the defect could predate the branch entirely.

The cheap way to settle it: run this one spec on origin/main and compare. That was not done before filing.

Reproduce

npm run build
npx playwright test e2e/timeline-geometry.spec.ts --reporter=list

e2e runs against out/main/index.js, so a source change needs npm run build first.

Requires the P0-2 fix to be present, otherwise P0-3 is skipped and reports as "did not run" rather than as a failure.

Related

Separate from #262, which covers four specs whose premises the same branch invalidated. This one is a possible product defect rather than stale test coverage.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions