ADR-0029: The app had one pill and Studio has two — when the shared name is the decoy, not the match
- Status: Accepted
- Date: 2026-08-20
- Deciders: Renaissance workstream 002, phase 02 (
Badge, the seventeenth conversion); sharpens ADR-0027, and follows ADR-0019, ADR-0021, ADR-0023, ADR-0026, ADR-0028
Context
ADR-0027 found that a ledger row can name the wrong component: TabBar on
both sides, and Studio's was the mobile bottom nav. Its rule — ask whether
Studio's same-named export is the same kind of control before diffing any
props — assumed that when the answer is no, you go looking for the real
counterpart under another name.
Badge is that defect with the answer sitting next to the decoy in the
same file. feedback.jsx exports Status on line 11 and Badge on line 22.
The app's Badge is Status. Studio's Badge is something else entirely,
and nothing in Cardsite wants it.
Both are small uppercase pills, which is why the name is a trap rather than an obvious miss:
app components/ui/Badge.tsx | Studio Badge (.lk-badge) | Studio Status (.lk-status) | |
|---|---|---|---|
| Fill | --surface-2, or a *-soft tint per variant | solid --accent, --accent-ink | *-soft tint per tone |
| Geometry | 18px, padding: 0 6px | 18px, min-width: 18px, centred | 24px, padding-inline: 10px |
| Numerals | — | font-feature-settings: 'tnum' | — |
| Mark | — | — | ::before — a 5px dot |
| What it is | a label on a row | a count | a state on a row |
DESIGN.md settles which is which. Its normative spec for badge is
backgroundColor: {colors.primary} / textColor: {colors.primary-ink} — a
solid fill — and .lk-badge implements exactly that. The soft fills belong to
the other family: "each with a 12% soft fill (16% in dark) for chips and
inline banners." The app's .badge was a soft fill on every variant. By the
design system's own vocabulary it was never a badge.
The call sites agree, and they are what makes this decidable rather than a
matter of taste. All 61, enumerated: 49 land in a table cell (16 in a
Studio DataTable cell callback, 33 in a hand-written <td>), 10 annotate a
card title or a row, 1 sits in a <p>, 1 in the editor toolbar. Not one is
a count. The commonest single idiom is variant={x.is_enabled ? 'success' : 'default'} — 25 occurrences of that exact ternary.
So the import swap the ledger row implies would have put a solid-accent count
chip with tabular numerals where the product draws a soft status pill, 61
times. Every check the previous ADRs added passes while it happens: the
elements are both <span> (ADR-0026), the props are both a tone plus children,
one export each side, and every class the markup emits is present in the layer
the app imports — the first conversion where the ADR-0023 enumeration comes
back clean outright on the first pass.
What the props were hiding
Three of the seven variant values were dead, and the census is the only thing
that could show it: info and outline have zero call sites anywhere, and
so does the icon prop. .badge.is-outline had no emitter in the repository at
all — the rule was written, shipped, and never once matched. A one-to-one port
of the type would have carried all three into Studio as though they were
requirements.
The live surface is five values, and four of them are already
.lk-status--* token for token: --surface-2/--text-3,
--success-soft/--success, --error-soft/--error,
--warning-soft/--warning. The app's is-accent resolves through
tokens.css's aliases to --accent-soft/--accent-line. That is not a
resemblance; it is the same declarations, written twice.
The size prop was a token violation, not a feature
size had no Studio equivalent and could not get one. Its md default —
taken by 29 of the 61 uses, because they omitted the prop — applied
style={{ height: 22, padding: '0 9px', fontSize: 10.5 }}. Hardcoded pixels
and a 10.5px font, inline, on nearly half the badges in the product: precisely
what AGENTS.md §3 forbids. There was nothing to port.
Decision
All 61 uses convert to Status. Studio's Badge is not involved.
variant becomes tone; default becomes neutral and danger becomes
error; info, outline, icon and size do not survive, because nothing
used them.
When two Studio exports could plausibly match one app component, the shared name is evidence about neither. Decide it from the design system's own specification of what each component is, and confirm it against the call sites — what the pills say, and what container they say it in. A name is the cheapest thing to match on and the last thing that should decide it.
Three Studio-side raises follow (ADR-0019), each a live defect for existing Studio consumers, not app-shaped concessions:
.lk-status--neutralwas invisible on a hovered table row. It wasbackground: var(--surface-2), and both.lk-table tbody tr:hoverand the app's.data-table tbody tr:hoverpaintvar(--surface-2). The same token. The other four tones are alpha fills that keep their hue over anything; neutral was the only opaque one, and so the only one that could vanish. Measured at 0.00pp of OKLab lightness against its own row, in both themes and both table flavours. It is now--surface-3/--text-2: 3.09pp light, 3.95pp dark. This is ADR-0028's question — what is already drawing a background where this lands — with the answer the container, but only on hover, which no static reading of either stylesheet surfaces..lk-status--accentis new.accentis a genuine state, not decoration:AdminBroadcastsPageandAdminPushNotificationsPageboth mapdraft -> processing -> sentontoneutral -> accent -> success, so the in-flight step of a lifecycle had no tone..lk-statusgainedwhite-space: nowrap. The pill is a fixed 24px, so a label that wraps overflows it; the app's.badgehadnowrapand Studio's never did. 49 of these now sit in table cells, where the column is as narrow as the layout wants.
Status also gains a type surface — the eighth export this workstream has
found exported from index.js with no index.d.ts entry. It is not
bookkeeping: the runtime does not clamp tone, it interpolates the string
into a class name, so tone="danger" renders a pill with no fill and no
error. The union caught all six call sites where a tone value lived outside
the JSX tag — two helper functions and three lookup maps whose types still
said 'danger' | 'default' — and it caught them at compile time, before any
of them could ship as an unstyled pill.
Badge stays untyped, deliberately, as Input does: nothing in this
repository calls it, and writing a contract for a component with no consumer
is how a wrong type gets trusted.
Consequences
- The parity gate goes from 4 to 3 awaiting conversion;
Input,ButtonandCardremain.Inputis the next instance of this same shape, and it is already known to beField+Input— one app export against two Studio ones.Badgeis the other direction of the same error: two Studio exports against one app export, where picking by name picks wrong. - A leading dot appears on 61 pills that did not have one. That is the one
deliberate visual change, and it is Studio's specified status pill. It is
most arguable on the 19 sites where the pill labels something other
than a lifecycle state, which an adversarial pass counted after a first
draft of this ADR said "~12": ten name a type or kind (
{link.type},{qr.type},{log.type},{b.type},{page.type},{rec.type}and the rest), and nine are flags, roles or raw data —bulk,default,{n.for_who}, Admin/User,{m.role},SSL,Yes,Beta, and{flag.plan_ids}, which is a comma-separated ID list and the clearest miss in the set. Two of those carry a second problem the dot makes louder:Betaiswarning, so it now reads as an amber state dot on a maturity label, and{code.type === 'discount' ? 'success' : 'accent'}colours a type by a status tone — both of which DESIGN.md's "status colors never decorate" already forbade, and neither of which this conversion created. They stayStatusbecause the alternative — a solid-accent count chip — is further from what they are, and Studio has no third pill. If a type label ever earns its own component, that is a phase 01 authoring job with a real consumer behind it, which is the only way this workstream authors anything. - The raises landed on React and CSS, not on Swift.
studio/packages/swift/Sources/StudioKit/StudioComponents.swiftstill hasStudioTone.neutralas--text-3on--surface-2— the pair measured at 0.00pp here — and no.accentcase at all, soStatusis six tones on web and five in Swift with one of them defined differently. The parity gate reconciles component existence, not tone sets, so nothing catches it. That is phase 04's scope and is recorded in SESSION.md rather than fixed here, but it means the sentence "a live defect for existing Studio consumers" is true of two targets out of three. .badgeand its remainingis-*modifiers stay incomponents.css: five hand-rolled emitters still use them (AdminOgImagesPage,BlockTypePicker,FilterBar×2,DisplayRulesEditor). Only.badge.is-infoand.badge.is-outlineleft, both with zero emitters repo-wide. The ADR-0021 sweep came back with a deletion and a documented survival, counted rather than assumed —is-infosurvives on.alert, and the compound is what the rule keys on.preview/studio-design.htmlnow says on theBadgecard that it is not the app's badge. That page is where the next person would repeat this mistake, and it is the third time it has been the reason a defect was invisible.
Verification
npm run verify exits 0; 365 unit tests pass across 24 files. The three CSS
raises are confirmed in the built app bundle
(apps/web/dist/assets/*.css), not in studio.css — the blind spot
Modal and EmptyState both found.
The neutral collision has a probe:
.station/jobs/002-renaissance/evidence/status-neutral-on-row-hover.mjs. It
builds a page from the repository's real stylesheets, hovers a row in both
table implementations in both themes, and asserts the pill separates from it.
--regress restores the old fill and it returns 0.00pp on all four and exits
non-zero. It is worth saying that the probe passed three times while measuring
nothing — an unstyled page, OKLCH digits read as sRGB, and an un-hovered row —
and each of those failures looked like a green result. A harness that cannot
fail is not evidence; run it against the broken input first.
Source: docs/decisions/0029-the-app-had-one-pill-and-studio-has-two.md