Skip to content

fix(trace): Fix span bars rendering too far to the right when scrollbar is visible#113166

Open
nsdeschenes wants to merge 3 commits intomasterfrom
nd/EXP-878/fix-trace-waterfall-rendering-bars-too-far-to-the-right
Open

fix(trace): Fix span bars rendering too far to the right when scrollbar is visible#113166
nsdeschenes wants to merge 3 commits intomasterfrom
nd/EXP-878/fix-trace-waterfall-rendering-bars-too-far-to-the-right

Conversation

@nsdeschenes
Copy link
Copy Markdown
Contributor

@nsdeschenes nsdeschenes commented Apr 16, 2026

When a vertical scrollbar is visible in the trace waterfall, span bars were rendered too far to the right. There were two related issues:

  1. useTraceSpaceListeners computed trace_physical_space from the full outer container width without subtracting the scrollbar width, so the renderable span column was wider than the actual visible area.
  2. When onScrollbarWidthChange fired, it updated scrollbar_width but didn't trigger a recalculation of the container physical space — so the first issue wasn't corrected until the next ResizeObserver event.

The fix subtracts scrollbar_width from the container width in useTraceSpaceListeners, and re-dispatches the container content-box dimensions (matching ResizeObserver's contentRect) whenever the scrollbar width changes.

Before After
Screenshot 2026-04-16 at 11 16 52 Screenshot 2026-04-16 at 11 16 47

Closes EXP-878

nsdeschenes and others added 2 commits April 16, 2026 11:15
Make scrollbar_width public so external listeners can subtract it from
container width calculations. Re-dispatch 'set container physical space'
whenever the scrollbar width is updated, triggering downstream listeners to
recompute trace_physical_space with the correct narrowed width.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…ations

When a vertical scrollbar is visible, the scroll container rows are narrower
than the outer container measured by ResizeObserver. Without accounting for
the scrollbar width, trace_physical_space is computed against a wider area
than the actual renderable column, causing span bars to render shifted to
the right.

Subtract scrollbar_width from the container width in both the
onPhysicalSpaceChange listener (useTraceSpaceListeners) and the column
layout handler (virtualizedViewManager) so the physical space always
matches the visible column width.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@linear-code
Copy link
Copy Markdown

linear-code bot commented Apr 16, 2026

@github-actions github-actions bot added the Scope: Frontend Automatically applied to PRs that change frontend components label Apr 16, 2026
Copy link
Copy Markdown
Contributor

@cursor cursor bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 960f64a. Configure here.

… change

When the scrollbar width changes, re-dispatch the container physical space
using the content box (excluding padding and border) instead of the full
bounding client rect. This matches the box model that ResizeObserver uses
for contentRect, preventing bars from being positioned relative to a wider
space than the actual content area.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@nsdeschenes nsdeschenes marked this pull request as ready for review April 16, 2026 17:27
@nsdeschenes nsdeschenes requested a review from a team as a code owner April 16, 2026 17:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Scope: Frontend Automatically applied to PRs that change frontend components

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant