Skip to content
Toolkit

ADR-0037: The authoring row that was a kind, not a name — Combobox, and the picker that stays app-side

Context

Three consecutive authoring rows turned out to be deletions. ADR-0035 retired Form/FormField; ADR-0036 retired PermissionGrid and DiffViewer and left the standing instruction that the remaining rows are "a claim to re-check, not a fact."

TimezonePicker was next, and it is the first one the census did not kill.

The census

ProbeResult
files named TimezonePicker1 — apps/web/src/components/ui/TimezonePicker.tsx, 138 lines
<TimezonePicker in the working tree1 — DisplayRulesEditor.tsx:236
<TimezonePicker in any commit, pickaxe over --all6 commits, and in every one the only file holding it is DisplayRulesEditor.tsx
is that file a story, a preview or its own definition?no — it is another component's source
is DisplayRulesEditor itself reachable?yes, two production call sites: LinkDetailPage.tsx:251, BiolinkSettingsPanel.tsx:487
a storynone exists
a test naming itnone — its only coverage was indirect, and DisplayRulesEditor.test.tsx never toggles the scheduling branch that renders it

So the chain is real and doubly rooted. This is the exact inverse of DiffViewer, whose only call site ever was its own story.

But the row still did not say what it meant

A surviving census answers "does something use this?". It does not answer ADR-0027's question, which is "what is the real counterpart?" — and here the two answers point in different directions.

The component is two things welded together:

  1. a searchable single-select — a trigger, a filter box, a filtered list, a checked row; and
  2. the IANA timezone vocabulary — Intl.supportedValuesOf('timeZone') with a hardcoded 49-zone fallback, plus a shortOffset per zone.

Only the first is a design-system concern. The second is platform data, and DisplayRulesEditor — the component that renders it, and its only caller — is already dispositioned not-planned for exactly that reason: "product domain (geo/device targeting), stays app-side." A Studio that exports TimezonePicker is a design system that ships a list of cities, and phase 04 would then owe a StudioTimezonePicker in Swift.

The kind was genuinely missing

Studio's control set had no searchable select, and this is not an oversight to route around — both existing answers disclaim the job in writing.

SelectBox, overlays.jsx:21-25:

The native <select> is the right control for long or dynamic lists — use <NativeSelect> there. This is for short, known option sets where the checked state and the pill metrics matter.

~420 IANA zones is neither short nor known, so SelectBox rules itself out. Its stated alternative, NativeSelect, cannot filter — and a 420-row native <select> is the control the app was hand-rolling away from. Between them sat every list too long to scan and too dynamic to enumerate.

Confirmed by enumeration rather than by reading: combobox, autocomplete and typeahead appear nowhere in studio/packages/core/src/ (CSS or JS), nowhere in studio/packages/react/src/, and nowhere in DESIGN.md — whose Components section specifies buttons, chips, inputs, lists, dropdowns, toasts, toggles, tooltips, checkboxes, form fields, banners, modals, empty states and destructive buttons, and no searchable select. CommandPalette filters, but it is a modal palette, not a field control.

So the row was a kind, not a name. What was missing from Studio was the combobox. What was missing from Studio was not a timezone picker.

What the call sites decided

Two container facts settled the design (ADR-0022/0025/0028, step 5).

It must portal. BiolinkSettingsPanel renders DisplayRulesEditor inside .settings-scroll, which is overflow-y: auto (components.css:1524-1530). The old panel is .popover-panel, position: absolute (components.css:877-883), inside an unpositioned wrapper — so it is clipped by that scroll container today, in production. This is SESSION.md open item 18 ("SelectBox listbox doesn't portal → clipped in any dialog") reached from the other direction: an authored component that copied SelectBox's inline list would have shipped the same defect on its first call site.

The z-ladder does not block it. Open item 5 blocks Select because useAnchoredPosition emits z-index: var(--z-overlay) (1000, hooks.js:196) while the app's modal surfaces sit at --z-modal (1050, tokens.css:88), so a Studio panel opened inside an app modal is painted under it. Neither of this component's call sites is an app modal: LinkDetailPage is a page, and BiolinkSettingsPanel sits in the editor's left panel — which on mobile becomes .ed-panel, position: fixed, z-index: 55 (components.css:1543-1553). A panel portalled to <body> at 1000 is outside that stacking context and above it. The blocker is real and stays open for Select; it does not reach here, and that is a fact about these two call sites, not a general clearance.

Decision

Author the kind in Studio; leave the vocabulary in the app.

  1. Studio gains Combobox — a searchable single-select, in overlays.jsx beside the two other anchored components. It is the bare control, like Input: no label, no helper, no error. id, aria-describedby and aria-invalid land on the input, so a Field function-child spread wires it with no adapter. This is ADR-0032's "one export per job" applied to the other half of the same problem — that ADR split one app Input into four Studio jobs; this one declines to fold a fifth job into a component that already refuses it.

  2. TimezonePicker stays app-side, rewritten from a 138-line widget to a ~100-line composition of Field + Combobox over an app-owned option list. Its parity disposition moves planned → not-planned with that reason, joining DisplayRulesEditor. It is not removed from the app's ui barrel: it is still a component the app owns, and taking it off the barrel would move the gate's number without changing the fact.

  3. The APG combobox pattern, not a button that swaps itself for a search box. The control is the input, so a screen-reader user hears one widget; focus never leaves it, and the highlighted option is carried by aria-activedescendant. This is why the options are plain <li>s with no tabIndex.

  4. The panel is portalled and anchored — createPortal + useAnchoredPosition({ matchWidth: true }), the DropdownMenu/Popover house pattern, not SelectBox's inline <ul>.

Two raises over what the app had

Both are ADR-0019 raises — the authored component is better than the thing it replaces, and the difference is stated rather than absorbed:

  • The control had no accessible name. The old label was <span className="small medium muted">, not a <label for>, so the trigger button was announced as its value alone. Field gives it a real label. This is the same defect ADR-0032 found 32 times behind Input and ADR-0035 recorded against FormField.
  • The list was not reachable by keyboard. The old options were <li>s with an onClick and no key handler, no role, no aria-selected, and the trigger carried no aria-expanded. There is now a full APG keyboard map and a real role="listbox".

One defect the tests found before it shipped

Opening the list with a value already chosen left the input reading the selected label, so the first keystroke appended to it: typing tok filtered on UTC (GMT)tok and matched nothing, on a list that plainly contains Tokyo. openList now selects the shown label so the first keystroke replaces it — which keeps the current value legible, where clearing the box would not. The assertion that caught it is Combobox.test.tsx's "lets the first keystroke replace the label it opened showing", and dropping the fix fails it plus the Escape test (mutation M4 below).

Two more the tests found before they shipped

Two of these are the same shape and are worth naming as a pair, because neither is visible to TypeScript and neither would have failed a happy-path test:

  • {...rest} is spread last, so an undestructured handler replaces the component's own. A caller passing onKeyDown would have silently deleted the entire keyboard model; a caller passing onClick, the open-on-click. Both are now pulled out of rest and composed — the caller's runs first and can stop ours with preventDefault, which makes the composition a contract rather than an accident.
  • aria-controls was a dangling IDREF whenever the list was closed. The panel is portalled and unmounted, so the id it named was not in the document. It is now set only while the list exists. SelectBox can keep its constant copy because its <ul> stays mounted under hidden; this one cannot, and the difference follows directly from the decision to portal.

And four more an adversarial pass over the finished diff found

Recorded because the pattern is the finding: all four are invisible to TypeScript and to every happy-path assertion, and three are the same shape — a caller reaching a component's internals through a prop spread.

  • The ARIA family was overridable. {...rest} is InputHTMLAttributes, which carries aria-expanded, aria-controls, aria-activedescendant and aria-autocomplete — the four attributes the APG pattern actually rests on. Spread last, a caller could overwrite any of them. rest is now spread first, so the component's own attributes win, and the four are omitted from ComboboxProps so the type stops offering what the runtime ignores. defaultValue went the same way: it made a controlled input uncontrolled.
  • aria-activedescendant was stale for one render. The active-index clamp was a useEffect, so on the render where options shrank it named an option id no longer in the list. It is now derived during render. No test could have caught it — assertions run after effects flush.
  • Enter was swallowed over an empty list. An unguarded preventDefault suppressed form submit with nothing chosen and no feedback.
  • A dead eslint-disable suppressed click-events-have-key-events above an element with no onClick — documenting a concern the code does not have, on a lint suite SESSION.md already records as passing by regex accident.

Consequences

The app CSS: nothing was this commit's to delete

ADR-0021 requires the app CSS a conversion replaces to go on the same commit. This conversion deletes none, and that is the finding, not an omission. Every class the old component emitted survives with other emitters:

classbefore → afterclassbefore → after
field7 → 6popover-panel4 → 3
control62 → 60is-full2 → 1
row109 → 108menu8 → 7
is-invalid7 → 6menu-item12 → 11
is-focused4 → 3row-between33 → 32
faint137 → 133is-selected9 → 8
shrink-034 → 33tiny103 → 102
grow55 → 54danger-text49 → 48
truncate33 → 32small453 → 450
ink115 → 114medium168 → 167
muted377 → 376

.popover-panel's three survivors are MultiSelect, DateTimePicker and ColorPicker — which is to say the three authoring rows still in the queue. The rule it names dies with the last of them, not with this one.

Counting method, stated because SESSION.md's open item records that no canonical emitter counter exists and that three previous sweeps returned three different sets of numbers: for every .tsx under apps/web/src excluding *.test.tsx and *.stories.tsx, each className= value is taken whole — a quoted string, or a brace expression matched by balancing braces, which covers template literals, arrays passed to .join(), clsx() calls and ternaries alike — and every string literal inside it is tokenised on whitespace and on quote characters. A class is counted once per className position that names it, not once per literal.

The last clause is not a detail. Two earlier runs of this census disagreed with a hand-count of the single file, both times on the same position — className={`grow truncate ${value ? 'ink' : 'faint'}`}. A template literal is matched whole by a literal-extracting regex, so the inner 'ink' kept its quotes and never matched the token ink; and a first run counted *.test.tsx, where .className.split(…) in an assertion parses as a className= position. Both were caught by predicting all 21 deltas from the old file by hand before running the counter and reconciling: the numbers above are the run where every delta matched the prediction — −1 per class the file emitted once, −2 for control, −3 for small, −4 for faint. The method is the finding as much as the counts are, and it is offered to open item "no canonical emitter counter exists" as a candidate, not as a resolution — nothing has been wired into the gate.

.is-full is now one emitter from dead

MultiSelect.tsx:158 is the only one left. Like .framed after ADR-0036, it is not this item's to delete — recorded as an open-item row instead. The hit in preview/current-design.html:53 is a selector, not an emitter, so .is-full does not carry ADR-0036's .checkbox trap.

Studio's CSS surface grew by three rules

.lk-combobox, .lk-combobox__list, .lk-combobox__empty, added to 55-components-extended.css — inside the component layer's two-file allowlist, so the app's @studio/core/css/components import carries them (ADR-0023). Three rules is the whole cost because the panel reuses .lk-menu--anchored's existing standalone block verbatim — its glass, padding, scroll cap, rise animation, row shape, [data-active] highlight and .lk-menu__check. The check is the one already drawn inline for DropdownMenu (ADR-0024); no new glyph was added and no icon-font class is named.

Each of the three exists because the borrowed block cannot supply it: .lk-anchor is inline-flex and hugs its trigger, which is wrong for a field that must fill its .lk-field column and whose measured rect feeds matchWidth; a <ul> arrives with a user-agent margin and marker box the <div>-of-<button>s block never had to reset; and the empty row takes the row's metrics but deliberately not its pointer cursor or hover fill, because nothing in it is selectable.

The types went in first

ComboboxProps and ComboboxOption landed in index.d.ts before the call site moved, and were proved with nine deliberately wrong calls — a missing options, an option missing label, a numeric value, the option object passed where its value belongs, a DOM-event onChange, type, role, a filter returning a string, a string maxHeight, and children. All nine were rejected; the probe was then mutation-checked by making one legal and confirming its @ts-expect-error went unused, and deleted before commit. Combobox is the 35th of Studio's 113 React exports to be typed.

What did not change

  • The TimezonePicker prop contract is unchanged — value, onChange, label, placeholder, error, className, disabled, same defaults. The one call site is untouched.
  • The offsets are still shown, now folded into the option label (Europe/London (GMT+1)) rather than a right-aligned column, which means they are searchable too. Built once and cached at module scope: the old component called formatOffset inside the render of every visible row, so it paid for up to 60 Intl.DateTimeFormat constructions again on every keystroke.
  • The 60-result slice is gone, and that cuts both ways. The old list truncated silently at 60 matches; the new one renders all of them inside a max-height panel that scrolls, so a user scrolling an unfiltered list now reaches Pacific/* instead of stopping in the Americas. The cost is that an unfiltered open mounts one <li> per zone — 418 in this environment — of which about seven are visible. The Intl cache is a real win and the removed cap is a real regression; the honest summary is that this trades repeated Intl.DateTimeFormat construction for one-time DOM volume, not that it is faster. Recorded as an open item: Combobox has no windowing and no cap prop.
  • Two silent changes to the search itself, neither of them wrong and neither previously written down. The label now carries the offset, and the default filter matches on label — so gmt matches every zone and +1 matches, where the old filter saw only the zone id. And the query is now trimmed.
  • The leading Globe icon is gone. The old control drew a lucide glyph; the new one draws neither that nor a caret. ADR-0032 recorded "18 leading icons dropped" as a deliberate visual change and this is the same kind of decision, so it is recorded rather than absorbed.
  • md:col-span-2 still wraps the call site. It is a Tailwind name in an app that ships no Tailwind — pre-existing dead, recorded by ADR-0034, and not this item's to clean.

Verification

  • npm run verify → exit 0. Studio lint clean (123 files, including E4's inline-<svg> rule and E7's "every lk-* class used in markup exists in the core stylesheet"), parity gate green, 463 unit tests pass, tsc -b and the production build clean. apps/api untouched, so the Go checks do not apply.

  • Parity: 112 React … 8 awaiting authoring → 113 React … 8 awaiting authoring. The counted number does not move, and that is correct: the gate counts names in the app barrel, and TimezonePicker is still one. What moved is the disposition behind it. The genuine queue is now four — MultiSelect, CodeEditor, DateTimePicker, ColorPicker — against a gate reporting eight, of which four are not-planned. The gap between the number and the work is now four rather than three, which is the same limitation ADR-0036 recorded: the ledger's two-word vocabulary still cannot say "censused, resolved app-side."

  • i18n 1980 → 1978, with arithmetic committed to the baseline. Both departed strings were extractions, not deletions: "Search timezones…" was the old inner search box's placeholder and is now the field's own, supplied by a default parameter the method has never counted; No results is now Studio's emptyLabel default, in a package the counter does not read.

  • 42 assertions and 22 mutations, each killed narrowly rather than by crashing the suite. Stated precisely, because an earlier draft of this ADR claimed "36 assertions, every one mutation-tested" off thirteen mutations, which is not a thing thirteen mutations can establish: a mutation shows that some assertion covers the line it changed, and the honest claim is about behaviours probed, not assertions certified. The nine in the second block below exist because an adversarial pass over the finished diff mutated the component 23 ways and 22 survived — Home was named by a test that never pressed it, disabled never reached the input, data-active (the only rule that paints the keyboard highlight) was unasserted, and so on:

    #mutationtests failed
    M1onChange reports opt.label instead of opt.value5
    M2list rendered inline instead of portalled1
    M3a cleared query treated as "no options" rather than "all"1
    M4no select-on-open2
    M5no active-index clamp1
    M6CSS: root loses width: 100%1
    M7CSS: list loses the <ul> reset1
    M8CSS: empty row loses its height1
    M9CSS: empty row wrongly takes cursor: pointer1
    N1aria-controls constant again, dangling when closed1
    N2a caller's onKeyDown no longer invoked1
    N3a caller's onClick no longer invoked2
    N4composition dropped — both handlers back in rest, spread last2
    P1the Home branch deleted1
    P2the ArrowUp branch deleted1
    P3disabled never reaches the input1
    P4data-active dropped — the only painted highlight1
    P5autoComplete="off" dropped1
    P6placeholder ignored1
    P7lk-menu named again, a class the layer never defines1
    P8.lk-menu__item-label dropped1
    P9Enter unguarded, swallowing submit over an empty list1

    M2 is the one worth naming: the assertion is root.contains(list) === false, not "the options appear" — which would have passed on the clipped version that was the whole reason to portal. Every option label in the fixture differs from its value, so M1 could not pass by coincidence.

  • A first mutation run was thrown away. It reverted the component with git checkout on a file that had never been committed, so M2–M9 ran against a Combobox that did not exist and reported ~29 failures apiece — a uniformity that is the signature of a crash, not of a targeted kill. The numbers above are from the re-run against backup copies. A mutation harness that cannot distinguish "the assertion caught it" from "nothing compiled" is not a harness, and the tell is that every mutation kills the same count.

  • Layer check by enumeration (ADR-0020/0023), against studio.components.css — the sheet the app imports — and not studio.css. Every class and every state the markup can emit resolves there: .lk-combobox, .lk-combobox__list, .lk-combobox__empty, .lk-input (with ::placeholder, :focus-visible, :disabled, [aria-invalid]), .lk-menu--anchored (with its @supports and reduced-motion blocks), .lk-menu__item (with :hover and [data-active]), .lk-menu__item-label, .lk-menu__check, and Field's .lk-field, .lk-field > label, .lk-help, .lk-help--error.

    This check was first done wrong, and the way it failed is the point. The original enumeration was a grep -c per class over the whole file and reported "lk-menu 4". .lk-menu has zero selector occurrences in that layer: all four are inside CSS comments — the block's own prose explaining that .lk-menu lives in 40-shell-app.css, which the two-file allowlist never reads. The count was of comment text, and the conclusion drawn from it — nothing the markup names resolves to nothing — was false for exactly the one class in the list that had no rule. Method item 7 says substring checks lie; this is that, committed. The markup now emits lk-menu--anchored lk-combobox__list and not lk-menu, which is what the layer's own comment requires: "A class the markup names and the layer does not define is the ADR-0023 defect, so the markup stops naming it." DropdownMenu and Popover still emit it and are recorded as an open item rather than swept in. The replacement assertion strips comments before matching, and asserts the absence of a .lk-menu selector rather than a count — a count is what got this wrong.

Source: docs/decisions/0037-the-authoring-row-that-was-a-kind-not-a-name.md

Library