Skip to content

fix(report): stabilize record timeline scaling#2724

Open
EAGzzyCSL wants to merge 1 commit into
mainfrom
zzy/fix-report-timeline-scale
Open

fix(report): stabilize record timeline scaling#2724
EAGzzyCSL wants to merge 1 commit into
mainfrom
zzy/fix-report-timeline-scale

Conversation

@EAGzzyCSL

Copy link
Copy Markdown
Collaborator

Summary

  • Extract timeline scale calculation into a focused helper with unit coverage.
  • Use a stable px/ms scale plus nice tick steps for the Record timeline.
  • Extend the visible time range to the next tick so the last screenshot thumbnail still has room to render.
  • Format sub-second timeline labels in milliseconds to avoid duplicated labels like 0.1s.

Why

The previous timeline step selection was tied to grid-count candidates and viewport width. After page load, resizing to a narrower width could make the selected range collapse or shift, so the same report appeared to cover a different time span. The newer direct scale also exposed that maxTime mapped exactly to canvasWidth, while thumbnails use x as their left edge, which could place the final screenshot off-canvas.

This change separates the concerns:

  • derive a readable tick interval from the target grid width;
  • scale the canvas against a padded visible range;
  • keep thumbnail positions and tick labels consistent across widths.

Validation

  • ./node_modules/.bin/vitest --run src/components/timeline

Lint was not run per local workflow preference.

@EAGzzyCSL EAGzzyCSL marked this pull request as ready for review June 26, 2026 09:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant