feat(seer): add the single error event embed - #123905
Open
billyvg wants to merge 9 commits into
Open
Conversation
Ran `pnpm gen:embed-widgets`. CI regenerates this file and fails if it is out of sync with schemas.ts. Claude-Session: https://claude.ai/code/session_016YUmhMZLo8geXJa93daPEQ
Contributor
📊 Type Coverage Diff
🔍 1 new type safety issue introducedType assertions (
This is informational only and does not block the PR. |
This was referenced Sep 9, 2026
The event embed shipped with the generic `<EmbedStory name="event" />`, which renders the schema's own examples. Those hold a made-up event ID, so every block variant on the stories page rendered "Unable to load event details" -- the story showed the embed's error state and nothing else. Every embed that fetches by ID has the same problem, and the ones that matter already solve it the same way: query the viewer's own organization for a real resource and feed its ID into the tag. This does that for `event`, which needs two hops rather than one -- the issue list does not return an event ID, so the story resolves the issue's `latest` event to get one. The issue is picked by frequency so its tags have a distribution worth looking at, and the tag view breaks down a key whose values actually vary across the issue. A single event holds one value per tag, so `level` -- the first tag on most events -- would draw a single full-width bar; `browser` and friends are preferred, with the first tag as the fallback. `environments` is left empty on the event request, matching the embed itself: neither should inherit the host page's filters. Claude-Session: https://claude.ai/code/session_016YUmhMZLo8geXJa93daPEQ
Contributor
Story previewsPreview the stories changed in this PR on the Vercel deployment: Preview deployment: https://sentry-c6ngamgey.sentry.dev |
`view: "tag"` took a single `tagKey`, so answering "how do browser and OS
differ on this issue" meant emitting the whole event embed twice -- two cards,
the same event summary repeated above each. `tagKeys` takes the list instead
and draws one distribution per key in a grid.
The array is deliberately uncapped in the schema. A Zod `.max()` would make an
over-long list fail to parse, and an embed whose props fail to parse renders
nothing at all -- the same reasoning the savedQuery schema records for widening
its dataset enum. The cap lives in the view, which draws the first four, so a
runaway list degrades to a few distributions rather than to an empty card.
Each key fetches on its own rather than through one combined query, so a key
the issue has never been tagged with shows its own error and cannot blank out
the ones beside it. The grid pairs up on container width, not viewport width:
the block already sets `containerType`, and an embed has no idea how wide the
page around it is.
The header link follows the same rule as before for one key -- straight to that
tag's breakdown -- and falls back to the issue's distributions page for
several, since no single tag page covers them all.
Two conventions from the seer-embed skill, fixed while here:
- The `tag` and `tags` views move into `event/eventViews/`, matching
`alert/alertTypes/` and `monitor/monitorTypes/`. The skill asks for a
sibling directory named for the axis the block switches on; `alertTypes/`
holds two files, so two views is enough to earn one.
- The first example dropped its `level: "inline"`, which was already the
default. The marker never reached the LLM -- codegen strips it -- but it
drove the shared stories fallback to relabel every example to the embed
name, collapsing four into three that rendered under one duplicated React
key. The dedicated story replaced that path; the schema now matches the
convention too.
Claude-Session: https://claude.ai/code/session_016YUmhMZLo8geXJa93daPEQ
Member
Author
|
bugbot review |
Contributor
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 7f02200. Configure here.
The `tags` view rendered `EventTags` with its row action menu, which writes project highlight tags through `useUpdateProject` and builds its links out of the host page's `location.query` -- both of which the embed rules forbid. `EventTagsTreeRow` already takes a `config` with `disableActions`, but `EventTagsTree` and `EventTags` never forwarded one, so the hatch was unreachable from the embed. Thread `config` through both and pass `disableActions` from the embed. Also drops a redundant non-null assertion on `visibleTagKeys[0]`; the ternary around it already yields `string | undefined`. Claude-Session: https://claude.ai/code/session_019X26DmhoMrsQUAeUotE6Vp
Member
Author
|
bugbot review |
ryan953
approved these changes
Sep 9, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Adds an
eventSeer markdown embed for a single error event inside an issue. Inline renders a compact link; block renders the event's title, message, culprit and context.One of four independent branches adding single-resource Seer embeds — see also #123901 (profile). They all touch
schemas.ts,index.ts, the stories page and the generated widget JSON, so whichever merges first leaves the rest needing a rebase plus apnpm gen:embed-widgetsre-run.The
viewfieldA single event holds exactly one value per tag, so showing "just that tag" on its own would say nothing.
viewtherefore controls what the block adds beneath the summary:viewsummary(default)tagstag+tagKeytagwithout atagKeyfalls back tosummaryand issues no request — there's a test for that.Notes for review
distributions/, not the legacytags/paths, which only redirect there.groupEventApiOptionswith an explicitly emptyenvironments, rather than theuseGroupEventhook, which readsuseLocation()— an embed must not inherit the host page's filters. Same reasoning as the README rule about not touching host page state.EventTagsViewfalls back to a plain key/value list when the events API omitsprojectSlug, sinceEventTagsTreeneeds one to load the project it renders rows against.TagDistributionis pure, so thetagview cannot reach the host page's URL.Testing
8 tests covering both inline title forms, the block summary, both tag views, the no-
tagKeyfallback, the missing-projectSlugfallback, and the error state. The wholeseer/markdownsuite passes (24 suites / 113 tests); oxlint and oxfmt are clean, andpnpm gen:embed-widgetsproduces no diff.Closes https://linear.app/getsentry/issue/CW-1958/add-error-instance-embed
🤖 Generated with Claude Code
https://claude.ai/code/session_016YUmhMZLo8geXJa93daPEQ