Skip to content

feat(issues): Add native stack trace component - #114082

Open
scttcper wants to merge 54 commits into
masterfrom
scttcper/native-stack-trace
Open

scttcper wants to merge 54 commits into
masterfrom
scttcper/native-stack-trace

Conversation

@scttcper

@scttcper scttcper commented Apr 27, 2026 •

Copy link
Copy Markdown
Member

Native version of the new stack trace component from #109428, behind issue-details-native-stack-trace.

Same motivations as that rewrite:

  • native frames no longer share styles with regular frames, which made both hard to touch
  • a few contexts instead of prop drilling
  • frame content doesn't render until opened which is lighter when there are 100+ frames
  • stories

Covers previews, exceptions with and without threads, standalone traces, symbolication status, display options saved per project, raw crash reports, and suspect commits.

Shared pages in #123988, legacy removal in #123987.

Changed

Location Before After
Issue details › Stack Trace Issue details › Stack Trace before Issue details › Stack Trace after
Issue details › Stack Trace, frame expanded Issue details › Stack Trace, frame expanded before Issue details › Stack Trace, frame expanded after
Issue details › Stack Traces, display options open Issue details › Stack Traces, display options open before Issue details › Stack Traces, display options open after
Issues feed › stack trace preview, hover Issues feed › stack trace preview, hover before Issues feed › stack trace preview, hover after

scttcper and others added 2 commits April 25, 2026 09:52
New native flavor of the stack trace component at
`static/app/components/stackTrace/native/`. Built on top of the existing
`StackTraceProvider` so it shares frame/row state, view state, and the
expanded body (`FrameContent` already handles source / vars / registers
/ assembly).

`NativeStackTraceProvider` resolves the debug image and pads relative
addresses once for the whole stacktrace, then exposes them through
`NativeStackTraceContext`. `NativeFrameHeader` lays out the row in the
classic native columns: status icon, package, address, function +
filename, actions. The status column is dropped entirely when no frame
in the stack would render an icon, so cleanly symbolicated stacks don't
reserve dead space on the left.

Includes:
- symbolicator status icons (image debug status wins over the per-frame
  symbolicatorStatus when an image is found)
- absolute / relative instruction addresses with shared column padding
- inline frame and stack-scanning tooltips on the address
- "Go to images loaded" debug-meta navigation
- raw view download button for native (Apple Crash Report endpoint)
- dart async suspension labels
- lead hint ("crashed in non-app") on its own line so toggling
  expansion doesn't change row height

Followups for parity: real `StacktraceLink` integration,
`OpenInContextLine` for sentry-app stacktrace-link components, the
`isUsedForGrouping` refresh icon, native display options
(absolute-addresses / verbose-function-names / absolute-file-paths)
wired into `StackTraceViewState`, and `AnnotatedText` PII annotations
on the function name.

Stories cover the multi-thread thread picker (one js thread for variety,
rendered with the generic stack trace), missing debug file, inline frame,
stack scanning, absolute addresses, long package names, omitted frames,
and dart async.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@github-actions github-actions Bot added the Scope: Frontend Automatically applied to PRs that change frontend components label Apr 27, 2026
@github-actions

github-actions Bot commented May 18, 2026 •

Copy link
Copy Markdown
Contributor

📊 Type Coverage Diff

Metric Before After Delta
Coverage 96.12% 96.13% 🟢 +0.01%
Typed 145,069 145,534 🟢 +465
Untyped 5,863 5,863 ±0
🔍 4 new type safety issues introduced

any-typed symbols (3 new)

File Line Detail
static/app/components/stackTrace/issueStackTrace/exceptionStackTrace.tsx 68 rawEntryMeta (var(binding))
static/app/components/stackTrace/issueStackTrace/exceptionStackTrace.tsx 68 exceptionValuesMeta (var(binding))
static/app/components/stackTrace/issueStackTrace/exceptionStackTrace.tsx 102 exceptionMeta (var)

Non-null assertions (!) (1 new)

File Line Detail
static/app/components/stackTrace/native/nativeFrameAnalysis.ts 29 frames[i]!

This is informational only and does not block the PR.

scttcper and others added 4 commits May 18, 2026 14:52
Native stack trace display options now hydrate from the same persisted option list as the old issue details stack trace, and write back as users change the dropdown.

Also threads the active thread id into raw crash report downloads so the endpoint gets the right thread when viewing threaded native crashes.

Co-Authored-By: Codex <noreply@openai.com>
Native thread stack traces still used the old issue details renderer, so the new stack trace path was missing thread controls, source links, and native display option behavior there.

Adds a composable issue-thread stack trace module with local contexts for the active thread and native display state. Also tightens native frame layout to better match the old renderer: address spacing, non-in-app styling, and native-specific frame actions without the generic repeated-frame badge.

Co-Authored-By: Codex GPT-5 <noreply@openai.com>
The native frame header got pretty miserable in narrow containers. The viewport breakpoint was the wrong tool and the actions column could squeeze the useful text down to crumbs.

Switch the compact layout to a container query, keep address/package/actions on the first line, and cap long native addresses so unsymbolicated frames do not take over the row.

Co-Authored-By: Codex GPT-5 <noreply@openai.com>
scttcper and others added 9 commits May 28, 2026 19:52
The new native thread stack trace was rendering raw mode from the parsed frames, which missed the Apple crash report endpoint behavior from the old component.

Fetch the raw report for the active thread and keep the generic formatted raw trace as the standalone fallback. Also update stale issue details imports from the master merge so this path actually compiles.

Co-Authored-By: Codex GPT-5 <noreply@openai.com>
The new native stack trace still missed a handful of old frame-level behaviors: grouping frames could disappear from app-only view, Images Loaded did not focus the matching image, copy-as-text used a hand-rolled format, and some frame metadata/expansion details were not carried over.

This wires those through the native provider and frame rows. Native rows now keep grouping frames visible, support the Images Loaded jump/search flow, use the raw stack trace formatter for copy text, render redaction metadata in function headers, pick the default expanded frame based on sort order, and keep the single empty-frame fallback expandable.

Adds focused native tests around each of those paths.

Co-Authored-By: Codex GPT-5 <noreply@openai.com>
The old native stack trace kept Dart async suspension sentinels out of the app-only view. The new row builder rendered them like normal native frames.

Add an opt-in native row filter so Dart async frames stay hidden in app-only mode while still showing in the full stack trace.

Co-Authored-By: Codex GPT-5 <noreply@openai.com>
The old native frame row only showed the lead hint in app-only view, and only while the row was collapsed. The new header showed it in full stack traces too.

Gate the hint on the native app-only view so full stack traces stay focused on the frame data.

Co-Authored-By: Codex GPT-5 <noreply@openai.com>
The old native stack trace gave revealed hidden system frames a different background so they were visually distinct from the anchor frame.

Carry the existing row isSubFrame flag through frame context and use it in the native header styling.

Co-Authored-By: Codex GPT-5 <noreply@openai.com>
Issue-thread native actions already showed the grouping marker, but the default native frame actions did not. That left non-thread native stack traces without the old grouping indicator.

Render the same marker from default native actions whenever the frame participates in grouping.

Co-Authored-By: Codex GPT-5 <noreply@openai.com>
The old native frame row only swapped to rawFunction when the verbose option was enabled and rawFunction actually differed from function. The new header used rawFunction more broadly.

Restore that old condition so verbose native names do not expose raw-only values or duplicate identical names.

Co-Authored-By: Codex GPT-5 <noreply@openai.com>
The native stack trace rewrite had a few places where parity fixes were landing as one-off branches in shared code. This moves that into explicit row policy and native frame analysis helpers so the generic stack trace path stays boring.

Also matches the old raw thread behavior: exception-backed native threads can render the Apple crash report, plain thread stacks render formatted raw frames. Cleans up the native display menu, raw download support, row density, and removes global class styling from the new native trace.

Co-Authored-By: Codex GPT-5 <noreply@openai.com>
scttcper and others added 4 commits May 28, 2026 22:49
Native exception-backed thread traces used to go through the old exception renderer, which could show the Git provider CTA when source linking had enough frame info.

Add that banner back for native exception threads only. Thread-only traces and raw Apple crash reports stay out of it.

Co-Authored-By: Codex GPT-5 <noreply@openai.com>
The native stack trace thread picker had a tiny external store for local component state. That made the flow feel more intense than it needed to be.

Move active thread selection into the existing provider and delete the store. Same behavior, fewer moving pieces.

Co-Authored-By: Codex GPT-5 <noreply@openai.com>
The native thread stack trace still had a second active-thread context and a fallback path for non-native rendering that cannot happen from this entry point.

Push the active model into the main provider, let selected thread state fall back during render, and make copy-as-text use the same stacktrace that is rendered.

Co-Authored-By: Codex GPT-5 <noreply@openai.com>
Symbolicator status only needs to describe icons we actually render. Drop the fake success state and let no-icon cases be null.

Also tighten the debug image helper return type so native frame analysis does not need a cast, and use Scraps Text for the empty stacktrace message.

Co-Authored-By: Codex GPT-5 <noreply@openai.com>
Cuts about 600 lines of duplication from the native stack trace.

The native display menu now passes its frame detail toggles to the
generic DisplayOptions instead of copying it, and the exception and
thread sections share one IssueStackTraceActions. Labels match
non-native now (Sort, Newest, Oldest).

The thread story renders the real IssueThreadStackTrace instead of a
hand built copy with fake hover buttons. Specs use EventFixture and a
stack trace helper, and the symbolication icon tests are one table.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Narrow native frames led with the address, squeezed the package into a
fixed column, broke function names mid-word and gave the In App tag its
own row. Phones mostly need the function and file, so those now get the
full width with package, address and actions on a smaller second line.
The chevron gets its own column centered beside both.

The table layout now waits for the xl container breakpoint since at 640px
the function column was getting squeezed to ~230px. Grid placement uses
named areas instead of column math. Thread state wraps below the thread
selector instead of getting crushed into a side column.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@scttcper
scttcper marked this pull request as ready for review October 7, 2026 18:42
@scttcper
scttcper requested review from a team as code owners October 7, 2026 18:42
@sentry

sentry Bot commented Oct 7, 2026 •

Copy link
Copy Markdown
Contributor

Sentry Snapshot Testing

Name Added Removed Changed Renamed Unchanged Skipped Status
sentry-frontend
sentry-frontend
0 0 0 0 1044 0 ✅ Unchanged

⚙️ sentry-frontend Snapshot Settings

@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.

Want reviews to match your repository better? Bugbot Learning can learn team-specific rules from PR activity. A team admin can enable Learning in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit f92f34c. Configure here.

groupingCurrentLevel={groupingCurrentLevel}
hasScmSourceContext={hasScmSourceContext}
/>
);

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.

Thread frames missing from exception display

High Severity

When a thread's matching exception has no stacktrace and another exception in the event does, the default thread view renders getThreadException's raw exception.values and never attaches the thread's frames. Copy and raw already do that attach through textExceptionValues, so the crashed thread can show an empty exception while copy still includes the actual frames.

Additional Locations (1)
Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit f92f34c. Configure here.

prefer-primitives flagged the chevron slot and the empty stack trace
preview wrapper. Both swap cleanly to Flex and Text with the same sizing,
drops their suppressions.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Move the native stack trace flag into the extracted EventStackTrace and
switch the branch's icon imports to @sentry/icons.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The non-native frame list built a new row policy every render, which
invalidated the provider's row memos and re-rendered every frame row.
Matches the useMemo the native provider already uses.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
scttcper and others added 2 commits October 22, 2026 15:15
oxlint suppressions moved to one file per workspace, so the two budgets
this branch drops now come out of static/app. hasEventStackTrace from
master checks the native flag too, so it takes the organization.

Also swaps a destructuring default the new react/todo rule flags.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Brings over two changes that landed on the legacy stack trace.
collapseAll (#128263) now reaches native threads and exceptions, so the
inbox preview keeps frames closed when Seer has a root cause. Chained
exceptions also open the first one that has frames (#127888).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@getsantry

getsantry Bot commented Nov 13, 2026

Copy link
Copy Markdown
Contributor

This issue has gone three weeks without activity. In another week, I will close it.

But! If you comment or otherwise update it, I will reset the clock, and if you remove the label Waiting for: Community, I will leave it alone ... forever!


"A weed is but an unloved flower." ― Ella Wheeler Wilcox 🥀

@getsantry getsantry Bot added the Stale label Nov 13, 2026
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
@scttcper scttcper removed the Stale label Nov 20, 2026
Went through native issues side by side with the legacy stack trace
after merging master and fixed what had drifted.

Traces with no system frames are forced to the full view, same rule as
legacy, and "Most Relevant" is disabled while that applies. The
selection is kept so it comes back on a thread that can be filtered.

Frames without a package fall back to the debug image name, matching
#131456.

The frame header lays out by its own container now. Under 320px the
function, package + address and actions each get a line, up to 768px
the function gets its own line, and above that it's one row of columns
that widen with the container.

Missing traces all say "No stack trace available" in the new component.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>

This branch was successfully deployed

1 active deployment
Preview — be3bc409 Deployed Nov 21, 2026 by vercel[bot]
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