Skip to content

[web-shared][web] Fix trace viewer pagination issues#1182

Merged
karthikscale3 merged 32 commits into
mainfrom
karthik/fix-traceviewer-pagination
Feb 25, 2026
Merged

[web-shared][web] Fix trace viewer pagination issues#1182
karthikscale3 merged 32 commits into
mainfrom
karthik/fix-traceviewer-pagination

Conversation

@karthikscale3
Copy link
Copy Markdown
Contributor

Changes

This PR fixes trace viewer pagination so spans and events stay in sync as data loads incrementally.
Instead of loading a limited upfront set, the trace now loads in 50-span batches and fetches additional data as the user scrolls vertically, including the corresponding events for newly loaded spans.

What changed

  • Added incremental trace data loading in useWorkflowTraceViewerData:
    • initial load: 50 steps/hooks/events
    • loadMoreTraceData() for next 50-item batch
    • tracking: hasMoreTraceData and isLoadingMoreTraceData
  • Ensured events are loaded for newly paged spans (step/hook correlation IDs), so visible spans don’t miss event data.
  • Wired scroll-triggered pagination in WorkflowTraceViewer to request the next batch near the bottom of the trace timeline.
  • Passed pagination handlers/state through run-detail-view and shared trace wrappers.

Test added

  • Added a new nextjs-turbopack workflow example: twoHundredStepsWorkflow (workflows/96_many_steps.ts) that executes 200 sequential steps.
  • Used this workflow to validate that:
    • spans beyond the first page load while scrolling,
    • event data appears for newly visible spans without requiring a tab switch.

@karthikscale3 karthikscale3 requested a review from a team as a code owner February 24, 2026 21:14
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.

2 participants