Skip to content

fix(stack-trace): show full file path in tooltip without truncation#117904

Open
kitlord wants to merge 9 commits into
getsentry:masterfrom
kitlord:kitlord/fix/stacktrace-filename-wrapping
Open

fix(stack-trace): show full file path in tooltip without truncation#117904
kitlord wants to merge 9 commits into
getsentry:masterfrom
kitlord:kitlord/fix/stacktrace-filename-wrapping

Conversation

@kitlord

@kitlord kitlord commented Jun 17, 2026

Copy link
Copy Markdown
Contributor

This PR fixes the issue in #93362 by using the mouse position to scroll through the filename / path so that it looks as per the sentry theme standards and is usability focused. here is an example video of a hardcoded trace in the new frame:

2026-06-17T08-54-20-946Z.mp4

Legal Boilerplate

Look, I get it. The entity doing business as "Sentry" was incorporated in the State of Delaware in 2015 as Functional Software, Inc. and is gonna need some rights from me in order to utilize my contributions in this here PR. So here's the deal: I retain all rights, title and interest in and to my contributions, and by keeping this boilerplate intact I confirm that Sentry can use, modify, copy, and redistribute my contributions, under Sentry's choice of terms.

@kitlord kitlord requested a review from a team as a code owner June 17, 2026 09:09
@github-actions github-actions Bot added the Scope: Frontend Automatically applied to PRs that change frontend components label Jun 17, 2026
Comment thread static/app/components/HoverScrollable.tsx Outdated
Comment thread static/app/components/HoverScrollable.tsx Outdated
Comment thread static/app/components/events/interfaces/frame/defaultTitle/index.tsx Outdated
Comment thread static/app/components/HoverScrollable.tsx Outdated
Comment thread static/app/components/HoverScrollable.tsx
Comment thread static/app/components/OverflowText.tsx
Comment thread static/app/components/HoverScrollable.tsx Outdated
Comment thread static/app/components/HoverScrollable.tsx Outdated
Comment thread static/app/components/HoverScrollable.tsx Outdated
Comment thread static/app/components/HoverScrollable.tsx Outdated

@cursor cursor Bot left a comment

Copy link
Copy Markdown
Contributor

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 92f91e9. Configure here.

if (scrollWidthRef.current !== content.scrollWidth) {
scrollWidthRef.current = content.scrollWidth;
animationRef.current?.pause();
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

First mousemove pauses scroll

High Severity

On the first mousemove while hovering, scrollWidthRef starts at 0, so it always differs from content.scrollWidth, triggering animationRef.current?.pause(). A paused Web Animation does not resume when updatePlaybackRate runs, so edge-based scrolling stops working after the first pointer move.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 92f91e9. Configure here.

Comment on lines +91 to +94
if (scrollWidthRef.current !== content.scrollWidth) {
scrollWidthRef.current = content.scrollWidth;
animationRef.current?.pause();
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Bug: On the first hover, the scroll animation is immediately paused and does not resume because scrollWidthRef is uninitialized, causing an incorrect state check.
Severity: MEDIUM

Suggested Fix

Initialize scrollWidthRef with the actual scrollWidth of the content inside the useLayoutEffect where the animation is created. This ensures the check on onMouseMove does not incorrectly pause the animation on the first interaction.

Prompt for AI Agent
Review the code at the location below. A potential bug has been identified by an AI
agent. Verify if this is a real issue. If it is, propose a fix; if not, explain why it's
not valid.

Location: static/app/components/HoverScrollable.tsx#L91-L94

Potential issue: On the very first mouse hover, the scroll animation is permanently
paused. This occurs because `scrollWidthRef` is initialized to `0`, causing the
condition `scrollWidthRef.current !== content.scrollWidth` to be true on the first
`onMouseMove` event. This triggers `animationRef.current?.pause()`. A subsequent call to
`updatePlaybackRate()` does not resume a paused animation, so the scroll feature appears
non-functional until the user moves the mouse out and back in.

Comment on lines +44 to +45

setIsTruncated(truncated);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Bug: A render loop occurs because SlidingContainer uses box-sizing: content-box with padding, causing it to miscalculate text truncation and oscillate with OverflowText.
Severity: MEDIUM

Suggested Fix

Apply box-sizing: border-box; to the SlidingContainer component. This will ensure that its padding is included within its defined width, leading to accurate truncation calculations and preventing the render loop.

Prompt for AI Agent
Review the code at the location below. A potential bug has been identified by an AI
agent. Verify if this is a real issue. If it is, propose a fix; if not, explain why it's
not valid.

Location: static/app/components/HoverScrollable.tsx#L44-L45

Potential issue: An infinite render loop can occur when text overflows its container by
a small amount. `OverflowText` detects truncation and renders `SlidingContainer`.
However, `SlidingContainer` uses the default `box-sizing: content-box` and has
horizontal padding, making its `clientWidth` larger than its parent. For text that fits
within this inflated width, `SlidingContainer` reports that the text is not truncated,
switching back to `OverflowText`. This creates a flickering loop as the components
rapidly switch.

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