Skip to content

feat(objects): Draw a trend sparkline on Ticket cards, starting with Sentry issues - #3373

Merged
BYK merged 5 commits into
feat/sentry-issue-cardsfrom
feat/sentry-issue-trend
Nov 13, 2026
Merged

BYK merged 5 commits into
feat/sentry-issue-cardsfrom
feat/sentry-issue-trend

Conversation

@sentry-junior

@sentry-junior sentry-junior Bot commented Nov 13, 2026

Copy link
Copy Markdown
Contributor

A Sentry issue card now draws its events per hour for the last day as a sparkline.

Stacked on #3367. After #3367 merges, this moves onto main.

Contract: Ticket (task) facts take an optional trend: a label and 2 to 60 nonnegative points, oldest first. The full card draws the shape under the summary. It has no exact values or axes, and it doesn't use the image proxy: the series is plain numbers in the facts, well under the 4 KiB limit. A shared Sparkline in components/charts/ draws it as inline SVG in the accent color.

Sentry: the issue details API already returns stats["24h"], which holds hourly [timestamp, count] pairs. The card maps them to points. It sends no trend when there are fewer than two points or a negative count, so a bad series never drops the whole card.

Dark Light
Before before dark before light
After after dark after light

Tests

  • tests/integration/api/sentry-issue-links.test.ts: the allowed viewer's card has the trend. Without the facts schema change, the cards are rejected and the tests fail.
  • Dashboard e2e: the hover card shows the "Events, last 24 hours" sparkline. This fails without the change.

via @BYK.

--

View Session [Sentry]

sentry-junior Bot and others added 2 commits November 13, 2026 15:31
…Sentry issues

Ticket facts can carry a short trend: a label and 2 to 60 nonnegative
points, oldest first. The full card draws it as a sparkline. The Sentry
issue card sends events per hour for the last day from the issue's
24h stats.

Co-Authored-By: BYK <[email protected]>
@sentry-junior
sentry-junior Bot added this pull request to stack #3374 November 13, 2026 15:53
@vercel

vercel Bot commented Nov 13, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
junior-docs Ready Ready Preview Nov 13, 2026 5:57pm UTC

Request Review

@BYK
BYK marked this pull request as ready for review November 13, 2026 17:45
@sentry-junior
sentry-junior Bot requested a review from BYK November 13, 2026 17:45
@github-actions github-actions Bot added the risk: high PR risk score: high label Nov 13, 2026
@BYK
BYK merged commit 0060c99 into main Nov 13, 2026
44 checks passed
@BYK
BYK deleted the feat/sentry-issue-trend branch November 13, 2026 21:24
BYK added a commit that referenced this pull request Nov 13, 2026
…nks (#3397)

The Sentry issue link expectation from #3367 and #3373 is out of date.
It looks for a chip named "JUNIOR-3ZK · Unresolved". Since #3381, a bare
link in a sentence renders as a plain titled link, "TypeError:
cart.total is undefined (JUNIOR-3ZK)". The PRs landed close together, so
the expectation still describes the old chip.

The new rendering is intended, so only the expectation changes: a titled
link, with the issue state shown in the hover card. No app code changes.

<!-- junior-request-attribution:start -->
via @BYK.
<!-- junior-request-attribution:end -->

<!-- junior-session-footer:start -->
<!-- junior-conversation-id:agent%3Ab784a61e6351b98fecdafda6e0e72301 -->

--

[View
Session](https://junior-prod.sentry.dev/conversations/agent%3Ab784a61e6351b98fecdafda6e0e72301)
[[Sentry]](https://sentry.sentry.io/explore/conversations/agent%3Ab784a61e6351b98fecdafda6e0e72301/?project=4510944073809921)

<!-- junior-session-footer:end -->

Co-authored-by: sentry-junior[bot] <264270552+sentry-junior[bot]@users.noreply.github.com>
Co-authored-by: BYK <[email protected]>
BYK added a commit that referenced this pull request Nov 14, 2026
…3408)

People share Sentry Explore links in threads to show a trend, such as a
latency spike after a deploy. Today such a link shows as a plain URL, so
readers must open Sentry to see what it shows. This PR makes links to
Explore traces, logs, and metrics resolve to chart cards. It follows the
issue cards (#3367, #3373) as part of
the work to give Sentry links cards.

**`chart` object type.** A new native type (label "Chart", icon
"graph"). Its facts are a display (line, bar, or area), the y-axis, the
range, and 1 to 5 series of 2 to 120 points. Slack cards and the model's
text show the range as a field. On the dashboard, the range is the chart
caption.

**Dashboard chart.** The issue trend Sparkline now draws one or more
series as lines, areas, or stacked bars. A legend names the series when
there is more than one. The issue trend looks the same as before. The
card meta line drops a label that repeats the type.

**Access and data.** A chart query covers the projects that its reader
may see. Junior's org read token could see more than the viewer can, so
the viewer's own Sentry token runs the query:
- `canView` runs the `events-timeseries` query through `viewerEgress`.
- The result is cached per viewer and URL for one minute. `resolve`
builds the card from that entry.
- Junior's org read token only finds the org's region host. It reads no
chart data.
- A viewer with no Sentry connection, or a Sentry 400, 401, 403, or 404,
gets no card.
- Points are downsampled and rounded to three significant digits, so
five series fit the 4 KiB facts limit.

The `viewerEgress` doc now covers data that depends on who reads it.

**`@sentry/api`.** Sentry API calls for link cards use `@sentry/api`,
pinned at 2.3.0, instead of hand-built requests. This covers the region
lookup, the issue card reads, and the chart query. Each call goes
through one Junior egress, so the host picks the token. Only the root
client is used. It keeps no response cache, so one viewer's data never
serves another. `@sentry/[email protected]` is the only new
`minimumReleaseAgeExclude` entry, because Sentry publishes it. Its
dependencies `p-limit` 7.3.3 and `http-cache-semantics` 4.2.0 pass the
release age policy.

Nothing breaks. Issue cards keep their behavior. No new OAuth scopes,
credential paths, or migrations.

### Screenshots

Desktop at 1440, rendered from the dashboard mock.

| | Dark | Light |
| --- | --- | --- |
| Chart card | ![Chart card,
dark](https://junior-prod.sentry.dev/public/artifacts/aeeb199f-1826-44f6-bcca-5460fbf8631f.png)
| ![Chart card,
light](https://junior-prod.sentry.dev/public/artifacts/79cbf117-3d7f-481f-8c12-3dedf2e57971.png)
|
| Hover card | ![Hover card,
dark](https://junior-prod.sentry.dev/public/artifacts/33ed032d-b87f-496f-a3f0-663aca4e7f0f.png)
| ![Hover card,
light](https://junior-prod.sentry.dev/public/artifacts/52d54429-3f0d-4d36-a664-c047b3faf0b0.png)
|

<!-- junior-request-attribution:start -->
via @BYK.
<!-- junior-request-attribution:end -->

<!-- junior-session-footer:start -->
<!-- junior-conversation-id:agent%3Ab784a61e6351b98fecdafda6e0e72301 -->

--

[View
Session](https://junior-prod.sentry.dev/conversations/agent%3Ab784a61e6351b98fecdafda6e0e72301)
[[Sentry]](https://sentry.sentry.io/explore/conversations/agent%3Ab784a61e6351b98fecdafda6e0e72301/?project=4510944073809921)

<!-- junior-session-footer:end -->

---------

Co-authored-by: sentry-junior[bot] <264270552+sentry-junior[bot]@users.noreply.github.com>
Co-authored-by: BYK <[email protected]>

This branch was successfully deployed

1 active deployment
Preview – junior-docs — b1f9d748 Deployed Nov 13, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

risk: high PR risk score: high

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant