Skip to content

feat(seer): Render chart markdown embeds - #120969

Open
gricha wants to merge 10 commits into
masterfrom
feat/seer-chart-embed
Open

feat(seer): Render chart markdown embeds#120969
gricha wants to merge 10 commits into
masterfrom
feat/seer-chart-embed

Conversation

@gricha

@gricha gricha commented Jul 31, 2026

Copy link
Copy Markdown
Member

Register a chart block embed for Seer responses and render validated line, area, bar, heatmap, and wheel visualizations with Sentry's existing ECharts infrastructure. The schema supports time or category axes, common display units, multiple series, and safe tooltip formatting; the generated backend widget catalog keeps the capability advertised to Seer in sync.

Heatmaps use the dashboard color palette and map each series to a row of cells. Wheels map one category series to a donut chart, keeping both additions on the same compact markdown-extension schema rather than introducing widget-specific payloads.

This is the Sentry half of the chart embed flow. The paired Seer change adds the typed Code Mode rendering helper and its discovery artifacts: https://github.com/getsentry/seer/pull/7571

Add the chart markdown extension schema and render validated line, area, and bar visualizations with Sentry chart components.
@github-actions github-actions Bot added Scope: Frontend Automatically applied to PRs that change frontend components Scope: Backend Automatically applied to PRs that change backend components labels Jul 31, 2026
@github-actions

github-actions Bot commented Jul 31, 2026

Copy link
Copy Markdown
Contributor

Story previews

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

Preview deployment: https://sentry-49z7hseuq.sentry.dev

@github-actions

github-actions Bot commented Jul 31, 2026

Copy link
Copy Markdown
Contributor

📊 Type Coverage Diff

Metric Before After Delta
Coverage 94.06% 94.06% ±0%
Typed 136,852 136,939 🟢 +87
Untyped 8,648 8,652 🔴 +4
🔍 4 new type safety issues introduced

Non-null assertions (!) (4 new)

File Line Detail
static/app/components/seer/markdown/embeds/components/chart.tsx 107 chartSeries[0]!
static/app/components/seer/markdown/embeds/components/heatmapChart.tsx 30 columnIndexes.get(point.name)!
static/app/components/seer/markdown/embeds/components/heatmapChart.tsx 32 cell[2]!
static/app/components/seer/markdown/embeds/components/heatmapChart.tsx 79 columns[columnIndex]!

This is informational only and does not block the PR.

Require unambiguous time-axis values, document heatmap and wheel constraints, use Scraps for chart headers, and exercise every chart adapter through the shared BaseChart boundary.
Comment thread static/app/components/seer/markdown/embeds/components/chart.tsx Outdated
@gricha
gricha marked this pull request as ready for review August 1, 2026 11:30
@gricha
gricha requested a review from a team as a code owner August 1, 2026 11:30
Comment thread static/app/components/seer/markdown/embeds/components/chart.tsx Outdated
Comment thread static/app/components/seer/markdown/embeds/components/heatmapChart.tsx Outdated
Comment thread static/app/components/seer/markdown/embeds/components/heatmapChart.tsx Outdated
Comment thread static/app/components/seer/markdown/embeds/components/chart.tsx Outdated
Comment thread static/app/components/seer/markdown/embeds/components/chart.tsx Outdated
Comment thread static/app/components/seer/markdown/embeds/components/chart.tsx Outdated
Comment thread static/app/components/seer/markdown/embeds/components/chart.tsx Outdated
Comment thread static/app/components/seer/markdown/embeds/components/chart.tsx
Comment thread static/app/components/seer/markdown/embeds/components/chart.tsx

@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 2 potential issues.

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 2015d9e. Configure here.

name: yAxisLabel,
axisLabel: {formatter: (value: number) => formatValue(value, yAxisUnit)},
},
};

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.

Time charts skip data range

Medium Severity

Time-axis line, area, and bar embeds set isGroupedByDate but never pass start or end from the series timestamps. BaseChart then falls back to the default 14-day period, so XAxis treats every range as multi-day and always renders date-plus-time tick labels, even for short same-day charts like the error-volume example. Heatmaps already derive labeling from the actual span, so these visualizations stay overly verbose on a compact embed.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 2015d9e. Configure here.

formatAxisLabel:
xAxis === 'category' ? (value: number) => escape(String(value)) : undefined,
valueFormatter: (value: number) => formatValue(value, yAxisUnit),
},

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.

Multi-series tooltips stay item-scoped

Medium Severity

Line, area, and bar embeds configure tooltip formatters but omit trigger: 'axis'. BaseChart therefore keeps the default item trigger, so multi-series hover only shows the hovered series instead of all series at that x position. That undercuts the multi-series and stacked-area support this embed advertises, and diverges from other Sentry time-series charts.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 2015d9e. Configure here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Scope: Backend Automatically applied to PRs that change backend components 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