Skip to content

fix(ui): trim Tag's label text box so it shares a baseline with adjacent text - #125135

Draft
billyvg wants to merge 1 commit into
masterfrom
worktree-fix-tag-baseline-alignment
Draft

billyvg wants to merge 1 commit into
masterfrom
worktree-fix-tag-baseline-alignment

Conversation

@billyvg

@billyvg billyvg commented Sep 21, 2026

Copy link
Copy Markdown
Member

Seer markdown block embeds show a tag in the header band, to the left of the
"View " link. The tag's label sat ~1.4px above the link's baseline.

Cause

Text, Heading, Link and InlineCode all set text-box-trim: trim-both,
so their boxes hug the glyphs. Tag did not — its label kept the font's
half-leading, and TagPill centers that taller box. Centering a line box
rather than the glyphs is what pushed the label up.

That also explains which embeds looked wrong: the ones passing a <Text> as
the badge (dashboardBlock, logBlock) already lined up; the six passing a
<Tag> (monitor, saved query, metrics, errors, spans, logs) did not.

Fix

Give TagText the same trim the rest of the text system uses.

Evidence

Measured in Chromium at 14px/Rubik, header band 36px, pill 20px — baseline
deltas relative to the link:

tag → link header title → link
before 1.41px 0.50px
after 0.50px 0.50px

The tag now sits exactly where the header's own title does. The remaining
0.5px is the inherent offset between co-centered 12px and 14px text; both
land on the same device pixel.

before-after

Scope

Tag is a core component, so this nudges the label ~1px down inside every
pill in the product — toward consistency with every other text primitive.
Worth a look from design if that's broader than wanted; the alternative is
scoping the same trim to the Seer embed header.

Tests

static/app/components/core/badge (4 suites) and the Seer embed suites
(seerEmbedBlock, monitor) pass; stylelint and oxfmt clean.

🤖 Generated with Claude Code

…ent text

`Text`, `Heading`, `Link` and `InlineCode` all set `text-box-trim: trim-both`,
so their boxes hug the glyphs. `Tag` did not: its label kept the font's
half-leading, and `TagPill` centers that taller box. Centering a line box
rather than the glyphs left the label sitting ~1.4px above the baseline of
any text next to it.

Most visible in the Seer markdown block embeds, whose header band centers a
tag against the "View <resource>" link. The embeds that pass a `<Text>` as
the badge (dashboard, log) already lined up; the six that pass a `<Tag>`
(monitor, saved query, metrics, errors, spans, logs) did not.

Measured in Chromium at 14px/Rubik, header band 36px, pill 20px:

  before   tag -> link baseline: 1.41px   title -> link baseline: 0.50px
  after    tag -> link baseline: 0.50px   title -> link baseline: 0.50px

The tag now sits exactly where the header's own title does; the remaining
0.5px is the inherent offset between co-centered 12px and 14px text, and
both land on the same device pixel.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@github-actions github-actions Bot added the Scope: Frontend Automatically applied to PRs that change frontend components label Sep 21, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Story previews

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

Preview deployment: https://sentry-34dguioj5.sentry.dev

This branch was successfully deployed

1 active deployment
Preview ced62e84 Deployed Sep 21, 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