chore: refactor TimelineChart for performance#2185
Conversation
|
🔴 Tier 4 — CriticalTouches auth, data models, config, tasks, OTel pipeline, ClickHouse, or CI/CD. Why this tier:
Review process: Deep review from a domain expert. Synchronous walkthrough may be required. Stats
|
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
{"review":"\n## PR Review\n\nReviewed the imperative refactor — math for zoom-anchoring and tick spacing checks out, the wheel handler correctly clamps |
c525fbb to
4ffb856
Compare
E2E Test Results✅ All tests passed • 158 passed • 3 skipped • 1223s
Tests ran across 4 shards in parallel. |
Summary
Refactors
TimelineChartfor performance on traces with thousands of spans. The previous implementation re-rendered the entire chart on every wheel tick because pan/zoom were React state. This branch moves to native horizontal scrolling for pan, an imperative scale ref for zoom, and imperative DOM updates for the X-axis ticks and mouse cursor — so a wheel event no longer triggers a React render of all virtualized rows.useDraghandler is gone; users scroll with trackpad/scroll wheel as with any scrollable container.Cmd/Ctrl + scrollstill zooms.A Storybook story (
TimelineChart.stories.tsx) is added with 1000 synthetic rows for working on this in isolation.How to test locally or on Vercel
Cmd/Ctrl + scrollover the events area to zoom in/out. Confirm:X.YYms) renders beside the bar (right side for early spans, left side for spans past the timeline midpoint).References