Skip to content

feat(entity-header): Let a stat's label or value link - #131075

Draft
Jesse-Box wants to merge 2 commits into
masterfrom
feat/entityHeader-statsItemLink
Draft

Jesse-Box wants to merge 2 commits into
masterfrom
feat/entityHeader-statsItemLink

Conversation

@Jesse-Box

Copy link
Copy Markdown
Contributor

A stat in EntityHeader can now link from its value as well as its label. Each half declares its own type: 'text' | 'link', so a stat can link its label, its value, or both. This unblocks moving the conversation detail header onto EntityHeader: there the error count itself leads to the errored spans, which today's label-only link can't express.

The stat props change shape. Before, the stat as a whole had a type, linked only through its label, and kept both tooltips at the top level:

{type: 'link', label: t('Errors'), value: 7, to: errorsTab, valueTooltip: <Breakdown />}

Now each half carries its own type, destination and tooltip:

{
  label: {type: 'link', content: t('Errors'), to: errorsTab},
  value: {type: 'text', content: 7, tooltip: <Breakdown />},
}

// A value link, with analytics
{label: t('Errors'), value: {type: 'link', content: 7, to: errorsUrl, onClick: trackClick}}

// Shorthand: a plain string, number or null is a text half
{label: t('Tokens'), value: '2.1K'}
  • Destinations: a link half takes to or externalHref plus an optional onClick. That's the same LinkDestination the title and metadata items use, so stat links can now point outside the product too.
  • Removed props: the stat-level type, to, onClick, labelTooltip and valueTooltip. The two callers, the replay details header and the build comparison header, are moved over in the same commit, and their output is unchanged.

Accessibility. A value link is named by its own text ("7"), the same way a label link is named by its label. Nothing is renamed to fold in the other half. The neighbouring half sits in the same list item, which is enough context for the link's purpose under WCAG 2.4.4.

Unchanged rules:

  • A link half's tooltip attaches to the link, so it adds no second tab stop.
  • An empty link value stays a link and reads "No data". It is drawn in accent rather than muted, because the colour says it navigates.

Review focus:

  • items/entityHeaderStat.tsx: the old separate label and value renderers are now one StatPart.
  • The "Stats" section of entityHeader.mdx, which now explains when to link which half and tightens what null means: the data was never collected, never "still loading".

Each half of a stat now declares its own type, text or link, so the value can navigate as well as the label. A link half takes to or externalHref plus an optional onClick, matching the title and metadata items. Tooltips move into the half they explain.

A plain string, number or null stays shorthand for a text half. The stat-level type, to, onClick, labelTooltip and valueTooltip props are removed, and the replay and build comparison headers move to the new shape.
Explain which half of a stat to link, how each link is named, and where tooltips live. Clarify that a null value means the data was never collected, not that it is still loading.
@github-actions github-actions Bot added the Scope: Frontend Automatically applied to PRs that change frontend components label Nov 13, 2026
@github-actions

Copy link
Copy Markdown
Contributor

decision-model-linter

voice

static/app/views/preprod/buildComparison/header/buildCompareHeaderContent.tsx

  • warn usesTitleCaseInUiCopy = TRUE (0.79): Use sentence case for this title or label. Preserve the canonical spelling of product names, proper nouns, and acronyms.

decision-model-linter: 36 calls on 5 files, 120,968 input tokens, $0.0051, model typesafe/jev-1.13-20260917

@github-actions

Copy link
Copy Markdown
Contributor

Story previews

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

Preview deployment: https://sentry-8kies3ui4.sentry.dev

@sentry

sentry Bot commented Nov 13, 2026

Copy link
Copy Markdown
Contributor

Sentry Snapshot Testing

Name Added Removed Changed Renamed Unchanged Skipped Status
sentry-frontend
sentry-frontend
0 0 4 0 930 0 ⏳ Needs approval

⚙️ sentry-frontend Snapshot Settings

This branch was successfully deployed

1 active deployment
Preview — b969ad40 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

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