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.
|
PR ReviewSolid performance refactor — imperative DOM writes on hot paths, rAF-coalesced wheel zoom, native horizontal scroll, and well-commented rationale for the non-obvious bits. No critical bugs found, but a couple of cross-cutting behavior changes deserve confirmation before merge.
|
c525fbb to
4ffb856
Compare
E2E Test Results✅ All tests passed • 164 passed • 3 skipped • 1186s
Tests ran across 4 shards in parallel. |
|
@claude review |
1 similar comment
|
@claude review |
Deep Review🔴 P0/P1 -- must fix
🟡 P2 -- recommended
🔵 P3 nitpicks (11)
Reviewers (10): correctness, testing, maintainability, project-standards, ce-agent-native, ce-learnings-researcher, performance, adversarial, kieran-typescript, julik-frontend-races. Testing gaps:
|
6cf4c76 to
deb6545
Compare
deb6545 to
400074a
Compare
400074a to
d31cd11
Compare
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