ADR-0033: The button that was two buttons, and the three words that changed meaning
- Status: Accepted
- Date: 2026-08-21
- Deciders: Renaissance workstream 002, phase 02 (
Button, the nineteenth conversion); applies ADR-0019, ADR-0020, ADR-0021, ADR-0023, ADR-0024, ADR-0026, ADR-0027
Context
Button was the workstream's second-largest surface — 72 files, 291
uses, of which four lived in the component's own stories and were
archived with it, leaving 287 uses across 71 files to move — and the
one where both sides already had the name, both sides already had the
component, and almost nothing about the two agreed.
The census is cheap for the same reason Input's was: every use is
statically visible. Zero {...spread} sites, zero refs, one style.
What the JSX says is everything there is.
| App prop | Uses | Where it lands in Studio |
|---|---|---|
variant | 182 explicit (+109 defaulted) | variant, with three words remapped |
size | 185, all "sm" | size="sm" — the axis had to be authored (152 after the icon-only split) |
loading | 57 | loading — authored |
iconLeft / iconRight | 38 / 1, all lucide elements | icon / iconAfter, widened to take one |
disabled | 50 | passthrough — but the layer drew no disabled state |
aria-label | 34 | IconButton.label on 33 of them — and 14 more controls had no name at all |
fullWidth | 0 | did not survive |
One export, two jobs
Input split four ways because its props hid four jobs (ADR-0032).
Button splits two ways, and the second job is not hidden in a prop at
all — it is visible in the shape of the call:
<Button variant="ghost" size="sm" onClick={…} aria-label={`Delete link ${l.url}`}>
<Trash2 size={14} strokeWidth={1.75} className="muted" />
</Button>
Forty-seven uses across twenty-two files are that: one glyph as the whole
content and a ghost/sm pair to make the button small and quiet — with,
on thirty-three of them, an aria-label, because a glyph is not a name.
The other fourteen had no name at all; see the consequences. That is
IconButton's entire job description, and Studio has had IconButton
since before the workstream started — with zero app consumers, because
the app had a Button that could be talked into the same shape. The
difference is that IconButton's label is required: an icon-only
control with no accessible name is a bug there rather than an option.
Mapping these to Button would have preserved a convention where a
construction was available.
The rule the prop census does not show
Every count above is a count of props, and a prop census cannot see the
declaration that changes for all 287 uses at once. ADR-0023 recorded this
escape on DataTable — the rule you are comparing has other declarations
in it — and it applies here to the base rule itself:
app .btn | Studio .lk-btn | |
|---|---|---|
| height | 42px | 40px |
| border-radius | --r-md (14px) | --r-pill |
| font-size | 13.5px | 14px |
| font-weight | 600 | 500 |
| border | 0.5px solid transparent | none |
and for the 138 sm buttons: padding-inline --space-3 (12px) →
--space-4 (16px), font-size 12.5px → 13px, radius --r-sm (10px) → pill.
(The app's own .btn-ghost.btn-sm was already a pill, which is 33 of
them.) None of this is a regression — it is the point of adopting a
design system's button rather than transcribing its variants — but it is a
change to every button in the product, and a conversion that lists three
deliberate visual changes while this one goes unmentioned has mis-stated
its own blast radius. The weight step is the one to watch: .medium text
beside a button is also 500 now.
Three words that survived and changed meaning
ADR-0026's rule earns its keep here more than anywhere. All three of these compile, render a button, and are wrong:
danger. The app'sdangerwas the filled--errorbutton (.btn-danger { background: var(--error) }). Studio'sdangeris the quiet ghost with--errortext, and the fill isdestructive. All four uses meant the fill. A blind import swap would have turned four irreversible-action buttons into faint text.secondary. 105 uses — the app's workhorse quiet button, drawn as.btn-neutral: a solid--on-surfacefill with--backgroundink and a raised shadow. Studio has no inverted solid, and DESIGN.md specifies three button variants (primary, ghost, icon) plus the destructive pair. Its quiet-but-visible button isoutline: surface fill, hairline, flat shadow. These moved there.- The default itself. The app defaulted to
primary; Studio defaults toghost. 109 call sites named no variant at all, and every one of them had to start sayingprimaryout loud or silently become a ghost. This is the change with the widest blast radius in the whole conversion and the only one with no textual trace at the call site to find it by — you cannot grep for a prop that isn't there.
What the layer did not say
The enumeration (ADR-0023, Method step 4) against
studio.components.css — the layer apps/web/src/index.css imports, not
the bundle and not the preview page — found four gaps, three of them
states the markup asserts on hundreds of call sites:
- No
:disabledrule at all. The only:disabledin the layer was.lk-pagination__nav .lk-btn--icon:disabled. 50 uses passdisabledand 57 more passloading, which disables: a button that looked perfectly pressable and silently was not. - No
:focus-visibleradius. The app's unscopedbase.css :focus-visiblesetsborder-radius: 6pxat (0,1,0) and is imported after the layer, so every pill button focused as a rectangle. Fifth instance of that trap —.lk-toggle,.lk-tabs__tab,.lk-textareaand the password reveal each carry the same fix. - No size axis.
.lk-btn--smdid not exist. 185 of the uses wanted it — 138 once the 47 icon-only ones moved toIconButton, which is one fixed size. .lk-btn--dangerwas not in the layer. It lived in70-patterns.css, which reachesstudio.cssand notstudio.components.css— so thedangervariant rendered as an unstyled button for any consumer importing the component layer, which is every consumer this repository has.
Decision
The 287 uses convert to two components by job: IconButton for the
47 icon-only controls — every one of them a variant="ghost" size="sm" —
and Button for the other 240.
One icon-only site stays a Button on purpose: DomainsPage's verify
control is the only one of the 34 that is also a loading button, and
IconButton has no busy state. It keeps its glyph, its aria-label and
its spinner rather than losing the spinner to gain the component. If a
second one ever appears, the answer is a busy state on IconButton, not
a second exception.
variant remaps rather than transfers: 109 defaulted uses gain
variant="primary", 105 secondary become outline (103 literal and
the two computed cond ? 'secondary' : 'primary' branches), 4 danger
become destructive. outline (1) and explicit primary (4) keep their
word, as do the 17 ghost uses left after the IconButton split.
link had zero call sites and does not survive — .btn-link stays in
the app sheet because the topbar hand-rolls one. The result, measured
after the change: primary 113, outline 104, ghost 17, destructive 4,
plus the two computed branches, and every one of the 240 now names its
variant rather than inheriting one.
Studio's Button is raised, not adopted as-was (ADR-0019), in four
ways, each of them something a call site already asked for:
size="sm"— a 34px control,.lk-btn--sm, with its own glyph sizing. There is deliberately nolg: no call site in the repository ever passed one, so the axis has exactly the value that was used.loading— disables, setsaria-busy, and swaps the leading glyph for a drawn spinner (ADR-0024). The app importedLoader2from lucide; a Studio component cannot, and an icon-font class would have left all 57 sites looking idle while refusing to be pressed.icon/iconAftertake an element as well as a class name. This is not a convenience: 100% of the 39 icon passes in the app are lucide elements and zero are strings, so without it the entire icon surface of the conversion had nowhere to land..lk-btn:disabledand.lk-btn:focus-visiblejoin the layer, and.lk-btn--dangermoves into it from70-patterns.css.
IconButton and Segmented are widened in the same pass, because
ADR-0024's rule is about the module that is converting, not only the
export: both take an element icon now. renderIcon — the helper
overlays.jsx wrote for the menu — moves to controls.jsx and is shared
rather than copied, so ADR-0024 has one implementation.
The types landed first (Method step 3): ButtonProps,
IconButtonProps, SegmentedProps and the shared StudioIcon alias in
index.d.ts, written before a call site moved and proved with six
deliberately wrong calls that tsc rejected — variant="secondary",
variant="danger2", size="lg", an IconButton with no label, a
Segmented option with no label, and loading="yes". The button
family was the largest remaining untyped block in the package; Badge
and Chip are what is left.
Consequences
- The parity gate goes from 2 awaiting conversion to 1: only
Cardremains. App-side components 14 → 13. React and Swift counts are unchanged — nothing new was authored, three exports were raised. - Three deliberate visual changes, all toward what DESIGN.md
specifies:
- 105
secondarybuttons stop being an inverted solid and become the hairlineoutlinebutton; - the 17 remaining
ghostbuttons lose their resting--surface-2fill (Studio's ghost is transparent until hover); - 47 row-action buttons become 36px round
IconButtons where they were 34px ghost pills.
- 105
- Every button now draws a disabled state and focuses as the pill it is. These are the conversion's two silent bug fixes, and they apply to every consumer of the layer, not only to the sites that moved.
- The ADR-0021 sweep, counted. Deleted —
Button.tsxwas the sole emitter of each in the repository:.btn-danger(2 rules),.btn-lg(1),.btn-spinner(1), and the twoshell.cssselectors that reached through.btn-label(which has no standalone rule anywhere). Kept, with their surviving emitters:.btn(9classNamepositions across 7 files),.btn-primary(4),.btn-sm(7),.btn-block(3),.btn-ghost(2),.btn-outline(2),.btn-neutral(1,LoginPage),.btn-link(1,Topbar), and the.btn:disabled/.btn:active/.btn-ghost.btn-smrules that go with them. fullWidthdid not survive and nothing was lost: the prop had zero call sites. The seven full-width buttons passclassName="full-width", the app utility they were already using, which passes through.- The conversion's one inline style went with it.
FilterBar's primary action carriedstyle={{ borderRadius: 'var(--r-pill)' }}, which existed only because the app's.btnwas--r-mdand this one button wanted the pill..lk-btnis the pill, so the override now says nothing — and it was the hardcoded value AGENTS.md #3 forbids, kept alive by the component this conversion replaced. - Fourteen more controls gained a name. The first census counted the
34 icon-only buttons that had an
aria-label; the adversarial pass asked after the ones that had none, and found fourteen — two onAdminThemesPage, one each on the four AI history pages andNotificationHandlersPage, six onPwasPage(two of them named by atitle, which names a control for a mouse and for nobody else). Every one is a lone glyph on aghost/smbutton, announced as "button". They areIconButtons now, wherelabelis required. This is the routing rule's own blind spot, worth writing down: "icon-only with anaria-label→IconButton" selects against precisely the controls the requiredlabelexists to fix. i18n 1979 → 1983 — ten of the fourteen names interpolate a row's title and are invisible to the counter, four are literals. - One button stopped submitting its form.
AdminUsersPage's Cancel sat inside a<form onSubmit>with notype, and the app component set no default — so<button>'s owntype="submit"applied and Cancel submitted the create-user form on its way to closing it. Studio'stype="button"default fixes it. It is the only site in the repository with that shape, and it was found by the review rather than by the census, because a census of props cannot see a prop nobody passed. IconButton's requiredlabelis a runtime guarantee, not a type one. The type cannot stop a caller passingaria-labelbeside it: TypeScript exempts hyphenated JSX attribute names from excess-property checking, soaria-label=""type-checks against any component at all (verified —Omit-ing it changes nothing, while a non-hyphenatedbogusProperrors). The component therefore spreadsrestbefore the name it is responsible for, and a test holds that ordering still.Segmentedwas typed for props its runtime dropped. It declaredOmit<HTMLAttributes<HTMLDivElement>, …>and destructured six props with no...rest, soid,styleanddata-*type-checked and vanished. It spreads now. Proving a type rejects what it should is half a proof; the other half is that what it accepts arrives.- Two findings are left as open items rather than fixed here, because
fixing either would be the adjacent cleanup the routine forbids:
.sidebar-composehas no emitter anywhere in the app, so the sidebar rail's compose-button rules inshell.csswere already dead before.btn-labelleft (only the.btn-labelselectors — the ones this conversion made unreachable — were removed); and seven hand-rolled.btnbuttons now sit beside converted ones and no longer match them, which is the base-rule diff above made visible. Three surfaces are worth naming:LoginPage's OAuth provider buttons (below a Divider from the converted Sign in),QrCodesPage's edit link beside its newIconButton, andQrCodeBuilderPage's Download PNG stacked with two converted buttons. None is convertible by this conversion: five are<a>/<Link>elements and Studio'sButtonhas noas, and the OAuth ones carry a per-provider brand background as an inline style. Both are authoring questions, recorded as such. .lk-segis still outside the component layer (open item 19), soSegmented's widened icon prop is typed and drawn but unstyled for a component-layer consumer. It has no app call sites; the row stays open.- The i18n ratchet does not move: the conversion introduces no new
literals.
aria-labelvalues becameIconButton.labelvalues, andlabelis already inTEXT_ATTRIBUTES.
Verification
npm run verify exits 0. The behavioural test is
apps/web/src/components/Button.test.tsx (23 tests); fourteen mutations
were watched biting before the assertions were trusted — .lk-btn--sm's
height changed to the default, .lk-btn:focus-visible deleted,
.lk-btn:disabled deleted, .lk-btn--danger pushed back out of the
layer, icon reverted to string-only, the default variant put back to
primary, loading no longer disabling, IconButton's label no
longer becoming aria-label, and size ignored; then five more for the
assertions the adversarial pass added — IconButton spreading rest
after its name again, IconButton dropping className, Button
swallowing title (the only accessible name two PwasPage controls
had), children wrapped in a span again, and .lk-btn--destructive's fill
changed. Each failed at least one test, and the suite was restored to
green after each. Two assertions the pass found vacuous were replaced
rather than kept: a .btn-label absence check that no mutation of a
Studio component could ever fail, and a [class*="ph-"] check in a test
whose only icon was an element.
.station/jobs/002-renaissance/preview/current-design.html's two Button
cards are retired to a converted card on the same commit (ADR-0021's
step 5, the Kbd precedent): three of the classes they drew left
components.css here, so the page would have rendered its own Danger,
Large and spinner samples broken. The icon-button samples stay — three
hand-rolled lineages the conversion did not touch. Layer assertions
parse rules and match exact selectors (the Textarea.test.tsx
discipline), against studio.components.css.
Source: docs/decisions/0033-the-button-that-was-two-buttons.md