Skip to content

feat(impact): Render typed citations on Impact assessments - #132028

Draft
leeandher wants to merge 2 commits into
feat/impact-typed-citationsfrom
feat/impact-citation-ui
Draft

leeandher wants to merge 2 commits into
feat/impact-typed-citationsfrom
feat/impact-citation-ui

Conversation

@leeandher

@leeandher leeandher commented Nov 20, 2026 •

Copy link
Copy Markdown
Member
AI Commentary

Stack: typed citations for Seer — 4 of 4 (Sentry frontend).

An Impact assessment with typed citations now lists each claim with a chip per citation. A chip shows the kind's icon and the cited title, with the excerpt as a tooltip.

Pressing a chip expands its detail:

  • the kind and where in the datum (frame, tag, stat, replay offset, query result), with a timestamp
  • the exact excerpt the claim relied on
  • the datum itself, rendered by the matching Seer embed (event, trace waterfall, log, replay, profile, issue or query)

Code, commits, PRs, feedback and external citations fall back to a link.

citationToEmbed maps citations onto the existing embeds, so Impact, chat and investigations can share one rendering. A test checks that every example citation maps to data its embed's own schema accepts. Assessments without typed citations keep the old tag list.

Verified end to end on a dev box: seeded checkout-crash events, a v2 run, and Seer's real tool output delivered through deliver_feature_result. Claims rendered with frame, tag, user-context, replay and issue-stat citations, and the expanded frame showed the cited source line with the event card.

Previewing: the Citations story (Scraps → Seer → Citations → Citation) has an "All kinds" section with one expanded detail per kind, built from the signed-in organization's data, plus an "In an Impact assessment" section with the real claims layout.

Related PRs

Sentry stack (stack):

  1. feat(seer): Add a typed citation contract for Seer #132025 — Typed citation contract
  2. feat(seer): Validate citations delivered by Seer #132026 — Validate citations from Seer
  3. feat(impact): Store typed citations from Seer in Impact assessments #132027 — Impact v2 backend
  4. feat(impact): Render typed citations on Impact assessments #132028 — Impact citation UI ← this PR

Seer stack (stack):

  1. https://github.com/getsentry/seer/pull/9764 — Citation ledger
  2. https://github.com/getsentry/seer/pull/9765 — Tool citations
  3. https://github.com/getsentry/seer/pull/9766 — Impact v2

Order: Sentry 1–2 and Seer 1–2 can land in any order. Seer 3 (Impact v2) must deploy before Sentry 3 turns on organizations:seer-impact-typed-citations. Sentry 4 renders whatever Sentry 3 stores.

@github-actions github-actions Bot added the Scope: Frontend Automatically applied to PRs that change frontend components label Nov 20, 2026
@github-actions

github-actions Bot commented Nov 20, 2026 •

Copy link
Copy Markdown
Contributor

Story previews

Preview the stories changed in this PR on the Vercel deployment:

Preview deployment: https://sentry-41sravfl4.sentry.dev

@leeandher
leeandher force-pushed the feat/impact-citation-ui branch from 86c20f2 to 5cf3b44 Compare November 20, 2026 17:03
@leeandher
leeandher force-pushed the feat/impact-citation-ui branch from 5cf3b44 to 73ffb4f Compare November 20, 2026 17:05
leeandher added a commit that referenced this pull request Nov 20, 2026
> AI COMMENTARY
> knip's production check flagged the shared examples, which only tests and
> stories use, and parseCitation, which the Impact citation UI (#132028) is
> the first production caller of. The examples move to __fixtures__, and
> the schema is a temporary production entry until that PR lands.
@leeandher
leeandher force-pushed the feat/impact-citation-ui branch from 73ffb4f to 339802c Compare November 20, 2026 17:25
@leeandher
leeandher added this pull request to stack #132036 November 20, 2026 17:26
> AI COMMENTARY
> Impact assessments with typed citations now list each claim with a chip
> per citation (the kind's icon plus the cited title, with the excerpt as
> a tooltip). Pressing a chip expands its detail: kind, where in the datum
> (frame, tag, stat, replay offset, query result), timestamp, the exact
> excerpt, and the datum itself rendered by the matching Seer embed (event,
> trace waterfall, log, replay, profile, issue or query). Code, commits,
> PRs, feedback and external links fall back to a link.
>
> citationToEmbed maps citations onto existing embeds, so chat,
> investigations and Impact can share one rendering. A test checks every
> example citation produces data its embed's schema accepts. Assessments
> without typed citations keep the previous tag list.
@sentry

sentry Bot commented Nov 20, 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

> AI COMMENTARY
> The Citations story could only expand the kinds that render without a
> fetch. useStoryCitations now builds a citation of every kind from the
> signed-in organization, using the Seer embed stories' discovery queries:
> - issue (and its user count)
> - the latest event, with its crash frame, a tag and the user
> - a trace, preferring the issue's project
> - logs scoped to the issue's project
> - a profile, a replay, and an errors query
> The other kinds use the static examples.
>
> "All kinds" expands one section per kind, noting kinds the organization
> has no data for. "Chips" expands any chip. "In an Impact assessment"
> renders the real ImpactClaims layout with these citations.
@github-actions

Copy link
Copy Markdown
Contributor

📊 Type Coverage Diff

Metric Before After Delta
Coverage 96.10% 96.11% 🟢 +0.01%
Typed 144,965 145,100 🟢 +135
Untyped 5,876 5,878 🔴 +2
🔍 2 new type safety issues introduced

Type assertions (as) (2 new)

File Line Detail
static/app/components/seer/citations/__stories__/useStoryCitations.ts 59 `as {values?: Array<{stacktrace?: {frames?: Frame[]}
static/app/components/seer/citations/__stories__/useStoryCitations.ts 342 as Record<CitationKind, StoryCitationSource> — {} as Record<CitationKind, StoryCitationSource>

This is informational only and does not block the PR.

This branch was successfully deployed

1 active deployment
Preview — 5214bc0e Deployed Nov 20, 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