feat(dashboard): reverse-virtualize event timeline with TanStack Virtual #1005
No reviewers
Labels
No labels
area:agents
area:dashboard
area:database
area:design
area:design-review
area:flows
area:infra
area:meta
area:security
area:sessions
area:webhook
area:workdir
security
type:bug
type:chore
type:meta
type:user-story
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
charles/claude-hooks!1005
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "dev/973"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Wraps the agent event timeline in
useVirtualizer(TanStack Virtual v3) for runs with ≥ 50 events; falls back to plain DOM rendering below that threshold.Test plan
scrollToIndex({align:"center"})centres the target group in the viewport; collapsed tool-call groups auto-expand when the target lands inside onejust qacleanCloses #973
Wrap the agent event timeline in `useVirtualizer` (TanStack Virtual v3) for runs with ≥ 50 events; fall back to plain DOM rendering below that threshold to avoid virtualizer overhead on short runs. - `estimateSize` by event kind: assistant/approval_pending ~200 px, collapsed tool_call group ~40 px, others ~64 px; `measureElement` re-measures actual heights so expanded groups stay correct. - Scrubber `scrollToIndex({align:"center"})` wired through for the virtual path; DOM-query scroll-into-view kept for the plain path. - Scroll position persisted in a module-level cache keyed by `persistKey` (task ID); restored via `useLayoutEffect` on drawer reopen so the viewport doesn't snap to the bottom. - `task-detail.tsx`: passes `persistKey={task.id}` to `<EventLog>`. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>f503cd3b67904623445cCorrect virtualizer integration — hook always called (rules compliance), count=0 no-op on plain path, scrubber→group mapping, scroll persistence all implemented properly. CI green.
Nits (not blocking):
scrollPositionCacheis unbounded — consider capping at ~100 entries;baseIdxinner loop is O(N) but only over visible items so impact is negligible.