Skip to content
Toolkit

ADR-0038: The sibling that was the same kind, one cardinality over — MultiSelect

Context

ADR-0037 left a standing instruction: the remaining authoring rows are "a claim to re-check, not a fact." Three of the queue's rows had turned out to be deletions and the fourth turned out to be a kind rather than a name.

MultiSelect is the fifth, and it is the first that is what it says it is.

The census

ProbeResult
files named MultiSelect1 — apps/web/src/components/ui/MultiSelect.tsx, 235 lines
<MultiSelect in the working tree2 — ApiTokensCard.tsx:171, DisplayRulesEditor.tsx:186
<MultiSelect in any commit, pickaxe over --all6 commits, and in every one the files holding it are those same two
is either file a story, a preview or its own definition?no — one is a page section, one is another component's source
are both reachable?yes — ApiTokensCard from SettingsPage.tsx:215; DisplayRulesEditor from LinkDetailPage.tsx:251 and BiolinkSettingsPanel.tsx:487
a storynone exists
a test naming itnone of its own — only indirect, through DisplayRulesEditor.test.tsx

Two call sites, both doubly rooted. The row survives.

It also renders far more than twice: DisplayRulesEditor maps AUDIENCE_FIELDS (:167), so its one JSX position is six controls on screen — seven instances between the two sites. Two is the number of contracts to honour, not the number of controls a user meets.

And this time the name was the kind

ADR-0037's question is "what is the real counterpart?", and there it split the row in two: a searchable single-select (Studio's) welded to the IANA timezone vocabulary (the app's). Asking it here returns one answer.

There is nothing product-specific in a multi-select. Its option lists arrive from the server as TargetingOption[] and data.scopes — the component never names a country, a scope or a browser. And Studio genuinely lacked the kind: multiple, multi-select and multiselect appear nowhere in studio/packages/react/src/, studio/packages/core/src/ or the Swift sources. ChoiceGroup is the nearest thing and is a static checkbox <fieldset> — no search, no panel, no aggregate value; the caller owns the array. Chip is a filter pill with aria-pressed, standalone.

So MultiSelect is Combobox one cardinality over, and it is authored under its own name.

What the call sites decided

It must portal, for the same reason and at both sites independently:

  • ApiTokensCard's picker is inside a Studio Drawer, whose body is overflow-y: auto (56-components-resource.css:95-101).
  • DisplayRulesEditor, via BiolinkSettingsPanel, is inside .settings-scroll, overflow-y: auto (components.css:1523-1529) — and then inside .card and .ed-panel, both overflow: hidden.

The old panel is .popover-panel, position: absolute, inside a wrapper that declares no position at all — so it is clipped today, in production, at both sites, and at the second one three times over inside a 280px column. This is SESSION.md open item 18 reached from the same direction ADR-0037 reached it.

The z-ladder does not block it, and this time the argument is different. Open item 5 blocks Select because useAnchoredPosition emits z-index: var(--z-overlay) (1000) while the app's own modal surfaces sit at --z-modal (1050, tokens.css:88). One of these two call sites is inside a dialog — .lk-drawer is role="dialog" aria-modal="true". But it is Studio's dialog, and .lk-drawer is itself z-index: var(--z-overlay) (56-components-resource.css:37-43), portalled to <body>. Two siblings of the root stacking context at equal z-index: DOM order decides, and the panel's portal is appended when it opens, which is after the drawer's. The panel paints above. That is exactly the reasoning the component layer's own comment offers and exactly the boundary it draws — "that reasoning ends at Studio's own ladder" (55-components-extended.css:596-604). No app surface at --z-modal is involved at either site. The blocker is untouched and stays open for Select.

Escape and focus needed checking too, and both come out right for a reason worth stating. The Drawer closes on Escape via a handler on its own root (resource.jsx:167), and a portal propagates events through the React tree, not the DOM tree — so a keypress in the portalled listbox does reach it. The list's Escape therefore has to stopPropagation, which it does, and a test asserts it on a real ancestor handler rather than by reading the source. The Drawer's Tab trap enumerates panelRef.current.querySelectorAll and so cannot see the portalled list — which does not matter, because the APG pattern never moves focus off the input, and the input is inside the panel.

Decision

Author MultiSelect in Studio; delete the app's; move both call sites to Field + MultiSelect.

Unlike ADR-0037 this is an authoring and a conversion on one commit, and the app component is removed from components/ui rather than kept — because here the app was not left owning anything.

Everything Combobox decided, decided the same way

The APG combobox pattern, the portalled anchored panel, rest spread before the component's own ARIA, handlers composed out of rest, aria-controls conditional on the list existing, the active index derived during render rather than clamped in an effect, onPointerDown with the default prevented on option rows, emptyLabel as role="presentation". A sibling that re-derives those gets some of them wrong; this one copies them, and its test suite re-asserts every one rather than trusting the family resemblance.

Three things differ, all of them consequences of holding a set

  1. Choosing does not close the list. A multi-select that closes on choose is a single-select operated repeatedly, and picking six countries becomes twelve interactions. The query survives the pick too, so one search can yield several.
  2. The input is a filter and never a value. There is no chosen label to show in it, so there is no select-on-open (Combobox's defect #1) and nothing to restore on Escape. The values are the tokens beside it.
  3. Backspace over an empty query removes the last token — the only way to unpick without leaving the input. The branch sits ahead of the open/closed split, because it has to work with the list shut.

The listbox also carries aria-multiselectable="true". Without it, several rows at aria-selected="true" in one listbox is a contradiction rather than a set.

Four props did not survive, and one option field

ADR-0026 counts what is reachable. Of eleven declared props, seven were ever passed: options, value, onChange, label, placeholder, disabled and loading — and of those, label becomes Field's rather than surviving here.

  • error — zero call sites. It is Field's, and Field wires it to aria-invalid and role="alert", which this component never did.
  • searchable — zero call sites ever passed false. A combobox that cannot filter is a SelectBox, and Studio has one.
  • maxSelected — zero call sites. Its whole atMax branch, including an is-disabled on a <li>, was unreachable code.
  • className — zero call sites, and it survives anyway, on the root, because that is the house contract for every Studio component.
  • MultiSelectOption.group — zero call sites, and structurally unreachable: TargetingOption (types/api.ts:900) has no such field and ApiTokensCard maps { value, label }. The grouping machinery — a memo, a heading <div> and a <div> nested directly inside a <ul>, which is invalid HTML — was dead in every sense.

loading survives unchanged, and is still explicitly not disabled: the distinction the old component's docstring argued for is right, and is now in index.d.ts where a caller can read it.

Four raises over what the app had

ADR-0019: the authored component is better than the thing it replaces, and the difference is stated rather than absorbed.

  • The control had no keyboard model at all. Not a partial one — none. The trigger was a <div role="combobox"> with no tabIndex, so it could not be focused; the options were <li onClick> with no role, no aria-selected and no key handler. There was no Escape, no arrow navigation, no Enter. The only focusable thing in a closed control was a token's unnamed remove button. It is now a full APG map on a real tab stop.
  • The label named nothing. It was a <span className="small medium muted"> over a control with no id — so all seven rendered pickers were announced by their value alone, or as nothing when empty. This is the defect ADR-0032 found 32 times behind Input and ADR-0035 recorded against FormField, a third time.
  • Every remove button is named. It was a bare <X> glyph, so a screen-reader user heard "button" once per chosen value with nothing to tell them apart. It is now Remove {label}.
  • Clear-all moved into the control. It was a footer button inside the panel, so emptying a selection required opening the list you were about to empty, and it was keyboard-reachable only for as long as a pointer held the list open. It is now in the control, visible whenever anything is chosen, and in the tab order.

One deliberate visual change

The caret is gone. The old control drew a lucide ChevronDown that rotated on open; the new one draws neither it nor a replacement, exactly as Combobox draws none. Pointer users get the whole list by clicking, which is the affordance standing in for it. Recorded rather than absorbed, on ADR-0032's precedent ("18 leading icons dropped") — and it is what makes .is-flipped dead.

Consequences

The type-level Omit is documentation; the runtime is the enforcement

ComboboxProps omits aria-expanded, aria-controls, aria-activedescendant and aria-autocomplete so that, in ADR-0037's words, "the type stops offering what the runtime ignores." MultiSelectProps omits the same four. Proving the type surface with deliberately wrong calls turned up something that ADR did not state:

TypeScript cannot reject any of the four, and never could. A JSX attribute whose name is not a valid JavaScript identifier is not checked against the props type at all — a hyphen exempts it from excess-property checking. Seventeen of twenty-one wrong calls in the probe were rejected; the four that were not are exactly the four hyphenated ones, and no Omit can change that.

This does not weaken the Omit, which still removes them from completion and from the documented contract. It relocates the guarantee: the only thing actually stopping a caller from owning the APG conformance is spreading rest first, and nothing in the type system will notice if that spread ever moves. So a test now says it — "ignores the four ARIA attributes the pattern rests on, which the TYPES CANNOT REJECT" — passing all four in and asserting the component's own values survive. Mutation M18 moves the spread to last and that test is the only one that dies.

The other seventeen probes were rejected: a missing options, an option missing label, a scalar value, numeric array members, a single-select onChange, a DOM-event onChange, type, role, defaultValue, children, a filter returning a string, a string maxHeight, the three retired props, and an option carrying group. The probe was mutation-checked — one illegal call made legal, its @ts-expect-error correctly reported unused — and deleted before commit. MultiSelect is the 36th of Studio's 114 React exports to be typed.

The app CSS: two rules died, and two that look dead did not

ADR-0021. Counted with ADR-0037's candidate method, re-implemented for this item and validated by reproducing all twenty-one of that ADR's published numbers exactly before being used for anything.

classbefore → afterclassbefore → after
field6 → 4is-flipped1 → 0
small450 → 444is-full1 → 0
medium167 → 166check-tile1 → 0
muted376 → 375is-checked2 → 1
control60 → 58popover-panel3 → 2
row-sm25 → 24menu7 → 6
wrap11 → 10menu-item11 → 10
is-disabled3 → 1is-selected8 → 7
is-invalid6 → 5table-foot14 → 13
is-focused3 → 2text-link65 → 63
faint133 → 130ml-auto3 → 2
ink114 → 112shrink-033 → 32
danger-text48 → 47

.field falls by two for one file, because DisplayRulesEditor's wrapper <div> went with it: Field declares the min-width: 0 that wrapper existed to carry, so the grid item is now the Field itself and the test hook moved onto it.

Deleted, both sole emitters in the repository:

  • .popover-panel.is-full (components.css:884-887) — the rule SESSION.md's open item was waiting on.
  • .is-flipped (patterns.css:550) — dead because the caret is gone.

Not deleted, and this is the finding: .check-tile and .check-tile.is-checked (components.css:914-932) now have zero app emitters and still may not go. preview/current-design.html:163-164 emits both (class="check-tile is-checked", class="check-tile") and that page links styles/components.css at line 18. This is ADR-0036's .checkbox trap, second instance: retiring the rules means retiring those preview cards first. Recorded as an open item.

.popover-panel itself survives with two emitters, DateTimePicker and ColorPicker — which is to say the two authoring rows still in the queue that draw one. The rule dies with the later of them.

A correction to ADR-0037

That ADR states, twice, that "the hit in preview/current-design.html:53 is a selector, not an emitter" for .is-full. Line 53 is .pv-static .menu, .pv-static .popover-panel { … }, which contains no is-full at all. An exhaustive search finds no reference to is-full in any preview file, in any form. The conclusion drawn — that .is-full carries no .checkbox trap — was right, and is stronger than it was stated: there was nothing there to be a selector either.

A third defect in the counting method

ADR-0037 recorded two bugs its counter caught in itself. Here is a third, caught by a delta that did not match the prediction: .field came back as 5 where the arithmetic said 4, and the extra hit was className="field" written inside a comment in the very file being counted — this ADR's own prose, in DisplayRulesEditor.tsx. The method reads text, not an AST, so a class name quoted in a comment is an emitter to it. The comment was reworded so the committed count is truthful, and the blind spot is recorded: the candidate counter over-counts any className= inside a comment or a string. That is now three self-inflicted bugs this method has found, which continues to argue both that it is the best available and that it is not yet a gate.

Studio's CSS surface grew by twenty-one rules

All in 55-components-extended.css, inside the component layer's two-file allowlist (ADR-0023). Seven times Combobox's three, and the whole difference is the control rather than the panel: the panel is .lk-menu--anchored reused verbatim again, and only .lk-multiselect__list and __empty are restated, for exactly the reasons Combobox restates them. Of the other nineteen, eleven are states — :focus-within, two :has() invalid rules, a :has() disabled rule, ::placeholder, two :hover:not(:disabled), two :focus-visible, three :disabled — on the five elements the panel does not supply: the box, the input inside it, the token, its remove button, and clear-all. Both hovers are narrowed away from :disabled because :hover matches a disabled button, and a control that lights up under the pointer and then does nothing is the same lie as one showing a pointer cursor.

The control could not be borrowed. .lk-input is height: 42px, and a box that wraps a token per chosen value grows a row taller with every line — so the box is stated fresh, with .lk-input's fill, hairline, radius and transition, and 42px kept as a min-height. Its ring is :focus-within, because the tab stop is the inner input and the box itself is never the focused element, so a :focus-visible there could never match. Its invalid state is read off the input's own aria-invalid with :has() — the trick .lk-choice:has(:disabled) two blocks up already uses — so the border and the announcement come from one attribute rather than two sources that can disagree.

.lk-multiselect is deliberately not merged into .lk-combobox's selector despite four identical declarations: the layer's tests read rules by exact selector text, and more to the point the two boxes are not the same box and either could need to move alone.

The token is not a .lk-chip. That is a 32px filter pill with a pointer cursor and an aria-pressed invert — pressing it does something. Pressing a token does nothing; only its remove button does. The remove glyph is drawn inline (ADR-0024), replacing a lucide X.

The component is archived, and both preview pages are corrected

AGENTS.md's "archive, never delete" and ADR-0021's step 4: the retired file is at .archives/removal-safe/apps/web/src/components/ui/MultiSelect.tsx with a register row carrying the per-component narrative. The first pass git rm'd it and wrote no row — caught by the adversarial pass, which noticed that all 29 prior retirements are in that directory and this one was not.

ADR-0021's step 5, the preview pages: current-design.html's MultiSelect spec card became a converted card, and studio-design.html's card stopped saying "App has a chip-based MultiSelect; Studio has nothing." The old app card is worth one line, because it is evidence for how little these pages constrain: it hand-rolled its chips from .chip, a class MultiSelect never emitted, and labelled itself with .field-label, which it never emitted either. It was a drawing of the component, not a mirror of it — which is SESSION.md's open item about preview pages and product being styled by different sheets, seen from the markup side.

The e2e spec was rewritten, and cannot be run here

display-rules-server-data.spec.ts drove the old markup through its class names, and three of its helpers broke on contact:

  • optionsIn located li.menu-item inside the field. The listbox is now portalled to <body>, so a field-scoped locator reaches nothing. It is page-scoped and by role now — not a loosening, because one picker is open at a time and the rest are unmounted.
  • controlOf located [role="combobox"], which was the wrapping <div> and is now the <input> — so the tokens, which it exists to look inside, are that element's siblings. Split in two: inputOf for the tab stop (aria-busy, aria-expanded, disabled), controlOf for the token box.
  • openPicker proved "the menu opened" by finding input[placeholder="Search…"], the panel's inner search box. There is no inner search box — the control is the input — so that assertion would have become one about markup that cannot exist, and would have passed on a picker that opened wide. It waits on the listbox now.

One assertion changed meaning rather than location: the disabled picker's "CSS half" asserted getComputedStyle(node).pointerEvents === 'none', which was the app rule .is-disabled. The Studio control is a natively disabled <input>, so the browser suppresses pointer events, focus and submission with no CSS involved; asserting the old declaration would be asserting that a deleted rule still applies. It asserts toBeDisabled() — the stronger claim, since a CSS rule can be overridden by the page around it and this cannot.

This file is not run by npm run verify and was not run here — it needs a live server and a seeded database. It has been reviewed line by line against the new markup; it has not been executed. That is stated plainly rather than folded into "verification passed".

Postscript, 2026-09-02: it was executed, on a stack raised natively from the migrations, the API binary and Vite — six of six pass (evidence .station/jobs/002-renaissance/evidence/display-rules-live-run-2026-09-02.md). Its sixth test's test.fail(), held for a links-API finding 007 phase 01 closed, is retired.

Three unit assertions were vacuous and are not any more

DisplayRulesEditor.test.tsx proved "the picker will not open" three times by asserting queryByPlaceholderText('Search…') and queryByText('No results') were null. Both are now markup that cannot exist under any behaviour, so both tests passed on a component that opened wide. They assert the listbox's absence and aria-expanded="false" now, plus the halves that distinguish the two states from each other: loading says aria-busy, failed says disabled and must not say aria-busy — a control claiming "still fetching" after the fetch has given up promises a list that is never coming.

The third copy was missed on the first pass and found by an adversarial one, which is the part worth recording: two were corrected in the same commit that left the third standing, four tests below, with the correction's own reasoning written above it. It was also the copy that mattered most. Its second assertion — expect(onChange).not.toHaveBeenCalled() — cannot fail in a test that never clicks an option, so the whole test held with disabled={disabled || isError} reduced to disabled={isError}, deleting the only wiring DisplayRulesEditorProps.disabled has. That prop had zero coverage and now has some.

Two of the e2e spec's assertions were the same shape. Its disabled probe claimed a "CSS half" and a "JavaScript half" that were "stronger than a click — it would still hold if the CSS above were lost"; in fact React fires no onClick for a disabled <input> at all, so the dispatched event reached no handler, and both halves read the same prop. The probe now strips the disabled attribute before clicking, which makes the JavaScript half genuinely independent: with the platform's own guard gone, only openList's early return can still refuse.

A test was added for the raise, asked by accessible name rather than by counting labels: all six pickers resolve as getByRole('combobox', { name: 'Countries' }) and so on.

And nine more an adversarial pass over the finished diff found

Recorded because the shape repeats ADR-0037's: every one is invisible to TypeScript, none fails a happy-path assertion, and the two worst are places where copying Combobox faithfully was the mistake rather than the method.

  • The default filter silently stopped matching on value, and that disarmed two live e2e assertions. The control this replaces filtered label || value; Combobox's default is label-only, and copying it was a regression nothing recorded. Both option sets here are code/name pairs, so an operator lost the ability to type KE for Kenya. Worse: the e2e suite filters the browser and OS pickers by the unmatchable values samsung_internet and chrome_os — whose labels are "Samsung Internet" and "Chrome OS" — and asserts zero rows. Under a label-only filter those queries match nothing whatever the server sends, so the assertion whose own message reads "the filter searches values as well as labels" would have stayed green through exactly the 03-D4 regression it exists to catch. The default now tests both, and diverges from Combobox deliberately.
  • Removing a token dropped focus to <body>, breaking the Drawer around it. The activated button unmounts with its token. Clear-all, twenty lines below, already refocused the input; remove did not. Inside the Drawer — one of the two call sites — the Tab trap is a React handler on the drawer's own root, so focus on <body> means Tab walks the page behind the dialog and Escape stops closing it, recoverable only with a mouse.
  • The portalled listbox was unnamed at 100% of call sites. This is SESSION.md open item 123 — recorded against Combobox, and copied here rather than avoided. aria-label={label} names the input and the list, and the documented composition is Field, which requires label to be omitted; so every real call site left the list anonymous. Fixed with a listLabel prop rather than deferred, because a component shipping a known defect at every one of its call sites is not what ADR-0019 means. Combobox's row stays open, now correctly narrowed to Combobox.
  • open was never reset, so a picker re-opened itself. shown hides the list when loading or disabled goes up, but open stayed true underneath. DisplayRulesEditor passes both straight from a TanStack query, so any refetch made the open panel vanish and then spring back — over whatever the page had scrolled to since.
  • aria-label, aria-busy and autoComplete were silently discarded. The Omit list covered the four APG attributes and stopped three short. Because a later JSX attribute wins even when it is undefined, a caller passing aria-label with no label got no accessible name at all — the caller asked for a name and received silence. aria-label now composes; the other two joined the Omit list.
  • The keyboard was unusable past the seventh row. Arrow/Home/End moved aria-activedescendant and nothing scrolled the panel. On the ~250-country list this was authored for, End put the highlight 9,700px below the visible area, nothing on screen changed, and Enter picked a row the user could not see — against a docstring advertising "↓/↑ move, Home/End jump". No unit test could see it: jsdom has no layout. Combobox has the identical gap over 420 zones and it is not in ADR-0037's open items either.
  • The control's gutter disagreed with .lk-input's — 10px against 14px, under a comment claiming it restated .lk-input's box. ApiTokensCard stacks an Input directly above a MultiSelect in one .stack, so the two placeholders started four pixels apart. ADR-0023's "a value two components in the layer disagree on", and it survived for that ADR's own reason: they had never been rendered together.
  • A disabled clear button kept cursor: pointer, and both :hover rules fired while disabled — :hover matches a disabled button. The house rule two blocks up, .lk-menu--anchored .lk-menu__item:disabled, states all three; this block stated one.
  • !disabled in the Backspace guard was unreachable, and its test could not fail. The input carries disabled, so a disabled control never receives the keydown. The clause is deleted and so is the test, which passed because box().focus() is a no-op on a disabled input and the keystroke went to <body>.

Three more assertions the same pass showed were unfalsifiable are recorded under Verification: a third vacuous queryByPlaceholderText('Search…') in DisplayRulesEditor.test.tsx, and two e2e halves.

Verification

  • npm run verify → exit 0. Studio lint clean (123 files), parity gate green, 542 unit tests pass, tsc -b and the production build clean. apps/api untouched, so the Go checks do not apply.

  • Parity: 113 React, 8 app-side … 8 awaiting authoring → 114 React, 7 app-side … 7 awaiting authoring. Unlike ADR-0037 the counted number moves, because the app barrel actually loses a name this time. The genuine queue is now three — CodeEditor, DateTimePicker, ColorPicker — against a gate reporting seven, of which four are not-planned. The gap between the number and the work is unchanged at four, which is still the ledger-vocabulary limitation ADR-0036 recorded.

  • i18n 1978 → 1975, with arithmetic committed to the baseline, and this time derived rather than asserted: a per-file run of the counter over both trees shows exactly one file moved, the deleted one, by three. Notably neither call site moved by one — label="Scopes" merely migrated from the MultiSelect to the Field around it, and label={field.label} is an expression before and after. The three: placeholder="Search…", gone outright with the inner search box; and the JsxText No results and Clear all, now Studio default parameters in a package the counter does not read — the same blind spot ADR-0037 recorded for "Search timezones…". The old 'Loading…' did not move the number at all: it sat inside a JsxExpression, which the method does not count.

  • 78 assertions and 48 mutations, 47 killed, and the survivor is not a test gap. Each kill is narrow — 1 to 3 tests — except two that are proportionate rather than suspicious: M1 (reporting labels instead of values) kills 11, and M30 (rendering the empty row alongside the options) kills 13.

    The survivor is worth naming because fixing a real defect created it. M12 deletes !loading from shown, and with the reset effect now in place the only difference it makes is one commit — the render on which loading goes up — before the effect closes the list. React Testing Library flushes effects inside act before any assertion runs, so no test in this harness can observe that frame; a browser would paint it. The term stays: it hides the list synchronously, in the same render, where the effect merely stops it coming back. This is the same category as the scroll-into-view fix above — a real behaviour jsdom cannot reach — and it is recorded rather than papered over with an assertion that would only restate the source.

The mutation harness was wrong first, in a new way

ADR-0037's harness ran against a component that did not exist and reported ~29 failures apiece; the uniformity was the tell. This one had the opposite failure and a quieter tell.

The first full run reported ten surviving mutations. Three of them — no active-index clamp, Escape no longer stopping propagation, every key stopping propagation — had assertions written specifically against them, so "nothing asserts this" was not a credible reading. It was not true. overlays.jsx holds Combobox and MultiSelect, deliberately near-identical and with Combobox first, so roughly half these patterns occur twice in the file — and String.prototype.replace with a string argument replaces only the first. The harness had been mutating Combobox and then running MultiSelect's suite, which of course passed.

Scoping every edit to the target component's own region of the file, and requiring each pattern to match exactly once inside it, took the survivor count from ten to one. ADR-0037's lesson generalises: a mutation harness that cannot distinguish "the assertion caught it" from "nothing compiled" is not a harness, and neither is one that cannot distinguish it from "I mutated a different component." A zero is a claim about the harness before it is a claim about the tests.

The one real survivor, and what it found

M12 deletes !loading from shown — and nothing failed, correctly. Every path that opens the list already guards on loading (openList and the input's onChange), so the term is unreachable from any click or keystroke.

What it is not unreachable from is a caller flipping loading to true while the list is already open, which DisplayRulesEditor does on a refetch: the panel would stand over an options array that has just emptied and render "No matches" — the finished-looking answer this whole state exists to avoid. That behaviour had no test. It has one now, and M12 dies to it.

What is deliberately unchanged

  • Combobox was not swept in, anywhere. Three of the nine defects above are Combobox's too — the label-only filter (correct there, since its one option set is not a code/name pair), the unnamed portalled listbox (open item 123), and the missing scroll-into-view over 420 zones. Only the second is already on the ledger; the third is added. MultiSelect fixes all three for itself and changes nothing in Combobox, which is the no-adjacent- cleanup rule costing something real and being followed anyway.
  • Combobox's empty row stays role="presentation", and so does this one. SESSION.md records that nothing announces "no matches" and that aria-expanded stays true over an empty list, to be "decided once for Combobox and MultiSelect together." Deciding it here would mean changing Combobox too, which is the adjacent cleanup the method forbids. The open item now has two emitters instead of one, and is unresolved.
  • MultiSelect duplicates roughly 120 lines of Combobox — anchoring, filtering, keyboard navigation, outside-click. Extracting a shared hook is a refactor of a component that is not this item's, so it is recorded as an open item rather than done.
  • .check-tile was not deleted, above.
  • md:col-span-2 still wraps the DisplayRulesEditor call site: a Tailwind name in an app that ships no Tailwind, pre-existing dead, recorded by ADR-0034 and not this item's to clean.
  • DisplayRulesEditor's scheduling branch still has zero coverage — 18 renders and the branch never toggled on. Both controls behind it are authoring rows; the branch gets its test when DateTimePicker converts.

Addendum, 2026-08-21 — the anchor that grows

A second session authored this row in parallel and its PR was superseded by this one; an adversarial pass it had run over its own diff found one defect that applies here too, and it is recorded rather than lost.

The panel never re-measured as the chip row wrapped. The three decisions this ADR is proudest of combine into it: the list stays open across choices, the query survives a choice, and the control is flex-wrap: wrap with min-height rather than height. So choosing changes nothing useAnchoredPosition depends on — matches is the same array and every other option value is a constant — while the anchor's bottom edge moves down by a row. The panel keeps the top it was given at open and slides under the control it is anchored to.

Nothing else covers it: the hook's listeners are resize and capture-phase scroll, which cover the anchor moving, not the anchor growing. Combobox cannot reach the case at all — a fixed 42px control that closes on choose — which is why the hook never needed to.

Fixed with an opt-in remeasure option on useAnchoredPosition, carrying the selection count. It is undefined for the other three consumers (Combobox, DropdownMenu, Popover), so their behaviour is unchanged.

The test stubs getBoundingClientRect for the control so its bottom tracks its own chip count — jsdom reports a zero rect for everything, so the growth has to be supplied — then asserts the panel's top changes when a chip is added. Against this ADR's implementation before the fix it reported expected '106px' not to be '106px' while the control's bottom had moved to 128px: a 22px overlap, and the assertion is the reason that number is written down rather than described.

Source: docs/decisions/0038-the-sibling-that-was-the-same-kind-one-cardinality-over.md

Library