An open source design system that's fully customizable and agent ready
TypeScript
chore(Tokenizer): remove experimental.presentation; presentation is the only spelling (#9836)
Xinzi Zhoub5ce149a84bf
diff --git a/.changeset/tokenizer-experimental-presentation-removed.md b/.changeset/tokenizer-experimental-presentation-removed.mdnew file mode 100644index 0000000000..e0ec880931--- /dev/null+++ b/.changeset/tokenizer-experimental-presentation-removed.md@@ -0,0 +1,7 @@+---+'@astryxdesign/core': patch+---++[experimental] `experimental.presentation` is removed from Tokenizer, together with its `experimental` prop; use the stable `presentation` prop, which takes the same values. `astryx upgrade` rewrites static uses and leaves a TODO where it cannot prove the rewrite, such as on a Tokenizer that spreads props.++@imdreamrunnerdiff --git a/.changeset/tokenizer-presentation-codemod.md b/.changeset/tokenizer-presentation-codemod.mdindex 5a02647a57..691dc54ff9 100644--- a/.changeset/tokenizer-presentation-codemod.md+++ b/.changeset/tokenizer-presentation-codemod.md@@ -2,6 +2,6 @@'@astryxdesign/cli': patch----[feat] `astryx upgrade` gains the `promote-tokenizer-presentation` codemod, which rewrites a static `experimental={{presentation: x}}` on Tokenizer to the stable `presentation={x}` and leaves a TODO where it cannot prove the rewrite. The Tokenizer blocks and page templates that show a prop the bottom sheet does not render (`hasClear`, `endContent`, `tokenOverflowBehavior`, `hasEntriesOnFocus`, `renderToken`) pass `presentation="popover"`, so they keep the inline field on phones under the new `'adaptive'` default.+[feat] `astryx upgrade` gains the `promote-tokenizer-presentation` codemod. It rewrites a static `experimental={{presentation: x}}` on Tokenizer, the 0.7.7 spelling that Tokenizer no longer reads, to `presentation={x}`. Where it cannot prove the rewrite, including any Tokenizer that spreads props (a spread may also set `presentation`), it leaves the call unchanged with a TODO.@imdreamrunnerdiff --git a/.changeset/tokenizer-presentation-stable.md b/.changeset/tokenizer-presentation-stable.mdindex be5417f1fc..c2a48a7fa3 100644--- a/.changeset/tokenizer-presentation-stable.md+++ b/.changeset/tokenizer-presentation-stable.md@@ -2,6 +2,6 @@'@astryxdesign/core': patch----[feat] Tokenizer's `presentation` prop is stable, and its default is `'adaptive'`. `presentation` takes `'popover' | 'bottom-sheet' | 'adaptive'`, typed by the new exported `TokenizerPresentation`. The API change is additive: the prop is new and optional, no existing prop, type or export is removed or narrowed (`TokenizerProps['ref']` keeps its input type, and the component also accepts a ref typed `Ref<HTMLInputElement | HTMLButtonElement>`), and `experimental={{presentation: x}}` keeps working as a deprecated experimental alias that `astryx upgrade` rewrites to `presentation={x}`; when both are set, `presentation` wins and the field warns once in development. The behavior changes only on compact coarse-pointer screens (phones), which is what `'adaptive'` is for: there a Tokenizer with no `presentation` shows a trigger that opens the bottom sheet, the sheet edits a draft so `onChange` reports once, on Save, `ref` receives the trigger button, and `renderItem`, `renderToken`, `endContent`, `hasClear`, `hasEntriesOnFocus`, `menuWidth`, `tokenOverflowBehavior` and `hasAutoFocus` are not rendered, with one development warning that names them. With a mouse or trackpad, on a screen that is not compact, in the server render and while hydrating, nothing changes. Pass `presentation="popover"` to keep the previous behavior on every device. Shipping this default in a patch is a product decision of the engineering owner, agreed with the owner of the compatibility policy.+[feat] Tokenizer's `presentation` prop is stable, and its default is `'adaptive'`. `presentation` takes `'popover' | 'bottom-sheet' | 'adaptive'`, typed by the new exported `TokenizerPresentation`. The API change is additive: the prop is new and optional, and no existing stable prop, type or export is removed or narrowed (`TokenizerProps['ref']` keeps its input type, and the component also accepts a ref typed `Ref<HTMLInputElement | HTMLButtonElement>`). The behavior changes only on compact coarse-pointer screens (phones), which is what `'adaptive'` is for: there a Tokenizer with no `presentation` shows a trigger that opens the bottom sheet, the sheet edits a draft so `onChange` reports once, on Save, `ref` receives the trigger button, and `renderItem`, `renderToken`, `endContent`, `hasClear`, `hasEntriesOnFocus`, `menuWidth`, `tokenOverflowBehavior` and `hasAutoFocus` are not rendered, with one development warning that names them. With a mouse or trackpad, on a screen that is not compact, in the server render and while hydrating, nothing changes. Pass `presentation="popover"` to keep the previous behavior on every device. Shipping this default in a patch is a product decision of the engineering owner, agreed with the owner of the compatibility policy.@imdreamrunnerdiff --git a/.changeset/tokenizer-presentation-template-pins.md b/.changeset/tokenizer-presentation-template-pins.mdnew file mode 100644index 0000000000..ac4b4bccbf--- /dev/null+++ b/.changeset/tokenizer-presentation-template-pins.md@@ -0,0 +1,7 @@+---+'@astryxdesign/cli': patch+---++[chore] The Tokenizer blocks and page templates that show a prop the bottom sheet does not render (`hasClear`, `endContent`, `tokenOverflowBehavior`, `hasEntriesOnFocus`, `renderToken`) pass `presentation="popover"`, so they keep the inline field on phones under Tokenizer's new `'adaptive'` default.++@imdreamrunnerdiff --git a/docs/specs/components/Tokenizer/Tokenizer.spec.md b/docs/specs/components/Tokenizer/Tokenizer.spec.mdindex ffe25bdfd7..618fd6bee9 100644--- a/docs/specs/components/Tokenizer/Tokenizer.spec.md+++ b/docs/specs/components/Tokenizer/Tokenizer.spec.md@@ -42,7 +42,7 @@ system_specs:spec:AST-009/FR8,spec:AST-012/FR9,spec:AST-017/FR3,- spec:AST-017/FR21,+ spec:AST-017/FR22,spec:AST-017/FR23,spec:AST-017/FR60,spec:AST-020/FR1,@@ -60,7 +60,7 @@ system_specs:| Area | Contract || ----------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |-| Public contract | A stable `presentation` prop, `'popover' \| 'bottom-sheet' \| 'adaptive'` with `adaptive` the default, selects the surface (DEC-3); the sheet edits a draft committed by Save (DEC-4). `TokenizerProps` stays an interface whose `ref` keeps its released `Ref<HTMLInputElement>` type; the component also accepts `Ref<HTMLInputElement \| HTMLButtonElement>`, because the ref reaches the sheet's trigger. `experimental.presentation` stays as a deprecated experimental alias. The existing `hasEntriesOnFocus` mode has a defined post-selection lifecycle (DEC-2). |+| Public contract | A stable `presentation` prop, `'popover' \| 'bottom-sheet' \| 'adaptive'` with `adaptive` the default, selects the surface (DEC-3); the sheet edits a draft committed by Save (DEC-4). `TokenizerProps` stays an interface whose `ref` keeps its released `Ref<HTMLInputElement>` type; the component also accepts `Ref<HTMLInputElement \| HTMLButtonElement>`, because the ref reaches the sheet's trigger. The existing `hasEntriesOnFocus` mode has a defined post-selection lifecycle (DEC-2). || Behavior | A committed empty-query bootstrap choice keeps remaining eligible loaded choices open, filters committed IDs, and advances the active option; terminal states close safely. The sheet presentation — `bottom-sheet`, and the default `adaptive` on a compact coarse-pointer screen — replaces the inline combobox with a trigger that opens one searchable modal sheet of checkbox rows that edit a draft committed by Save (FR16–FR24, FR26, FR27). || End-user impact | People selecting several loaded values can continue without reopening the menu, while disabled, loading, exhausted, and dismissed states remain non-interactive. On a compact touch screen, the field offers thumb-sized rows and a search field the keyboard does not cover. || Builder impact | None with a fine pointer or on a screen that is not compact. On a compact coarse-pointer screen a Tokenizer without `presentation` opens the sheet: `onChange` fires on Save, `ref` reaches the trigger, and the props of the inline combobox are not rendered. `presentation="popover"` keeps the inline combobox on every device. |@@ -94,14 +94,16 @@ record.- Controlled/uncontrolled ownership is unchanged. Retention follows committedcontrolled values; a proposed value that the caller has not accepted remainsavailable.-- Stable presentation (DEC-3): `presentation` is a stable prop, a promotion- (`spec:AST-017/FR23`). The API change is additive: the prop is new and- optional, and no existing prop, type, or export is removed or narrowed. `experimental.presentation`,- its earlier spelling, stays a deprecated experimental alias with the same- values, outside the stable compatibility promise (`spec:AST-017/FR21`);- `presentation` wins when both are set, and the field warns once in- development about the pair (`spec:AST-017/FR29`). `astryx upgrade` rewrites- a static `experimental={{presentation: x}}` to `presentation={x}`.+- Stable presentation (DEC-3): `presentation` is a stable prop, promoted from+ the experimental option (`spec:AST-017/FR23`). The API change is additive:+ the prop is new and optional, and no existing stable prop, type, or export+ is removed or narrowed. The experimental spelling, `presentation` inside the+ `experimental` prop, is removed and not kept as an alias: it was outside the+ stable compatibility promise, so its removal is an `[experimental]` patch+ change whose note names the replacement (`spec:AST-017/FR22`). For callers+ of that spelling, `astryx upgrade` rewrites static uses and leaves a TODO+ where it cannot prove the rewrite, such as on a Tokenizer that spreads props+ (`spec:AST-017/FR23`).- Default change (DEC-3): `presentation` defaults to `adaptive`, a change ofthe released `popover` default, and the behavior changes only on compactcoarse-pointer screens, which is what `adaptive` is for. With a fine@@ -111,7 +113,7 @@ record.it renders the sheet: `onChange` fires once on Save in place of once perselection, `ref` receives the trigger button, and the props of the inlinecombobox are not rendered. `presentation="popover"` keeps the previous- behavior everywhere, and the codemod is available for the alias. The+ behavior everywhere. Thestable prop and this default ship together in a patch as `[feat]`: thatrelease tier is a product decision of the engineering owner, with theagreement of the owner of `spec:AST-017` (DEC-3).@@ -183,10 +185,7 @@ Consumer migration instructions belong in consumer docs and release notes.One stable public concept is introduced: the `presentation` prop, with thevalues `'popover' | 'bottom-sheet' | 'adaptive'` and `adaptive` the default,typed by the exported `TokenizerPresentation`, the selection controls' value-set (DEC-3). Its earlier spelling, `presentation` inside the optional-`experimental` prop object, stays as a deprecated experimental alias:-declarations carry `@experimental` and `@deprecated`, and consumer docs carry-`stability: 'experimental'` metadata and name the stable prop. Existing consumer props and+set (DEC-3). Existing consumer props andusage remain in `Tokenizer.doc.mjs`. The existing`hasEntriesOnFocus` mode includes the component-owned post-selection behaviorin FR13–FR15.@@ -225,35 +224,35 @@ FR16–FR24, FR26, and FR27 describe the `presentation` prop and its sheetpresentation, which has no inline combobox, suggestion menu, orend lane.-| ID | Invariant | Basis | Status |-| ---- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------- |-| FR1 | Tokenizer MUST keep one native combobox input mounted across token addition, removal, clear, ordinary wrapping, and maximum-entry states. Reaching `maxEntries` may make the input zero-width, transparent, and out of flow, but MUST NOT replace its identity. | Current source and tests | Verified current behavior |-| FR2 | Tokenizer's suggestion menu MUST remain associated with the outer field/control surface. Existing `menuWidth` behavior remains an exact preferred pixel width plus the outer field's minimum width; it is not a maximum. | Current BaseTypeahead/Tokenizer source and docs | Verified current behavior; preserve |-| FR3 | `unfocusedInline` MAY replace direct token layout with OverflowList while blurred. `unfocusedLayer` MAY keep the real wrapper/input mounted in a context layer while an ordinary-flow placeholder represents the collapsed field. | Current source, tests, and stories | Verified current behavior |-| FR4 | Tokenizer MUST provide Core peers one package-internal descriptor with stable identities for its outer field/control surface and active opening control. Layer consumes the descriptor; public consumers cannot observe or configure it. | Approved package-internal contract; #5804 evidence; `spec:AST-002/DEC-1` | Current contract; implementation pending |-| FR5 | Add/search opens MUST identify the stable inner input as the opening control before the result row disappears. Selection, query clearing, result removal, refocus, or later input collapse MUST NOT substitute the transient result row or a pointer coordinate. | Current selection order plus approved descriptor contract | Current contract; implementation pending |-| FR6 | Edit opens MUST capture the actual activated token/control before state removes or replaces it. The Tokenizer-owned capture path MUST include custom `renderToken` output when activation originates from an identifiable descendant control; it MUST NOT require a new public ref contract. | Current owned wrapper plus approved capture contract | Current contract; implementation pending |-| FR7 | A non-null element is usable only while connected, rendered, and geometrically meaningful for the open being prepared. A disconnected, stale, hidden-layer, zero-width, or otherwise unusable opening control MUST fall back safely to the outer field at logical start before show. | Current max/overflow states plus approved safety rule | Current contract; implementation pending |-| FR8 | The descriptor MUST remain valid across focus movement, token add/remove/clear, wrapping, and `unfocusedLayer` reparenting. It MUST clear on unmount, perform no DOM work during SSR, and never retain an element beyond the open preparation that uses it. | Approved identity/lifetime contract | Current contract; implementation pending |-| FR9 | A consuming surface MUST resolve its preferred width before choosing horizontal placement. A surface at least as wide as the outer field MUST use outer-field logical-start alignment. Only a surface narrower than the outer field may use opening-control geometry. | Approved conditional-placement contract | Current contract; implementation pending |-| FR10 | For a narrower surface, Layer MUST compare the opening control with the outer field's physical start/end geometry, choose the nearer physical edge, map that result to logical start/end, and use logical start on a tie. Viewport collision runs last. | Approved Layer-consumer contract | Current contract; implementation pending |-| FR11 | Opening placement MUST be modality-neutral and latched for one open lifetime. Pointer, keyboard, touch, and programmatic activation of the same control MUST produce the same preferred edge. Pointer movement, later focus movement, resize, or target collapse MUST NOT recompute it. | `architecture:interaction-modality` plus approved stability contract | Current contract; implementation pending |-| FR12 | Placement state MUST commit while the surface is hidden, and Layer MUST show it on the next animation frame only after anchor, alignment, and width styles exist. A stale or invalid descriptor MUST never cause a visible wrong-position or first-frame flash. | Approved no-flash contract | Current contract; implementation pending |-| FR13 | Tokenizer MUST exclude every choice whose `SearchableItem.id` is already present in its committed `value` from displayed bootstrap and search cohorts, including results that settle after the controlled value changes. A caller-rejected proposed value remains eligible because it was not committed. Distinct IDs remain eligible even when their labels match. | Approved Tokenizer multi-selection contract | Current contract; implementation and verification pending |-| FR14 | With `hasEntriesOnFocus` enabled, committing a choice from the current settled empty-query bootstrap cohort MUST keep the input focused and the popup open when another eligible loaded choice remains. The active option advances to the next remaining choice in displayed order; when the committed choice was last, the nearest preceding choice becomes active. `aria-activedescendant` MUST reference that rendered option. | Approved rapid multi-select lifecycle | Current contract; implementation and verification pending |-| FR15 | The retained popup MUST close and clear its active descendant when no eligible loaded choice remains, `maxEntries` is reached, the control becomes disabled, focus leaves, or the person dismisses it. Disabled Tokenizer remains non-interactive. Pending or stale source work MUST NOT reopen a terminal popup or expose stale choices; loading has no selectable placeholder and its busy state clears when work is cancelled or settles. | Approved terminal-state safety boundary | Current contract; implementation and verification pending |-| FR16 | `presentation` selects the surface. `adaptive`, the value when `presentation` is omitted, resolves to `bottom-sheet` on compact coarse-pointer screens and to `popover` otherwise, through the one touch-presentation rule `spec:AST-094/FR13` owns, as the selection controls do; with a fine pointer or on a screen that is not compact it renders exactly the `popover` presentation. `popover` is the inline combobox with its anchored suggestion menu on every device, unchanged. `bottom-sheet` is the trigger and modal sheet of FR17–FR24, FR26, and FR27 on every device. The deprecated `experimental.presentation` takes the same values and applies when `presentation` is omitted; when both are set, `presentation` wins and the field warns once in development. `adaptive` renders on the server, and hydrates, as the inline field, because the resolver answers `popover` where there is no `matchMedia` and in the hydrating render; on a compact coarse-pointer client the field swaps to the trigger in the first render after hydration; nothing is focused before interaction, so focus is undisturbed (`document.activeElement` stays the body), except with `hasAutoFocus`, whose server-rendered `autofocus` focuses the inline input on load: then the swap moves that focus to the trigger — the same element and visit for the caller, so no `onBlur`/`onFocus` pair is reported. The trigger keeps the field's box — the same width, top, label, and `size` block size — except the inline input's own row: when the tokens leave the input no room on their row, the inline field wraps the input onto a row of its own, and the trigger, which has no input, drops that row (one `md` row, 27px, on a 390 and a 414px phone with five tokens); with room for the input beside the tokens, nothing shifts. A resolution change while the sheet is open takes effect after it closes and focus has returned to the trigger — the presentation hold `architecture:layer-runtime/INV14` assigns to the layer runtime; INV14 gap: the runtime does not yet provide one (its record names INV14 as ownership not yet met), so until it does the field keeps its own hold, to be replaced by the runtime's when it exists. Whenever the presentation changes while its control holds focus — then, or while the sheet is closed — focus moves to the new presentation's control, the combobox input or the trigger, so it never lands on the page body (`spec:AST-085/FR4`). | DEC-3; touch-flow evidence | Verified current behavior. |-| FR17 | In the sheet presentation the control surface is one button, named by the field label, with `aria-haspopup="dialog"` and `aria-expanded`. It shows the selected tokens without remove controls, or the placeholder when empty, wraps tokens onto further lines, and is the inline field's control box: the shared input box — its 1px border, focus ring, surface and radius — the inline field's token inset and row gap, and the `size` block size, so before the sheet opens the field looks the same as the inline field; the touch-sized targets belong to the sheet's rows and actions, not to the closed field. Activating it opens one tall modal BottomSheet named by the field label; the suggestion popover, inline input, and end lane do not render. While disabled the trigger stays focusable with `aria-disabled="true"`, does not open, and shows `disabledMessage` as the inline field does (`spec:AST-085/FR1`); a field that becomes disabled while its sheet is open closes the sheet and returns focus to the trigger (`spec:AST-085/FR2`). | DEC-3; touch-flow evidence; `spec:AST-085` | Verified current behavior. |-| FR18 | The sheet is a single surface: a search field at the top, a scrolling list of rows, and a footer with Clear all and Save pinned below the list. There is no second sheet. The search field is the shared panel search field drawn as a bordered input box (the input border and surface, element radius, the `lg` input height — 36px — above the sheet's 44px rows) rather than the borderless field a dropdown panel draws; it does not scroll with the list. The footer is rendered in every state of the sheet — while searching, while pending, with an empty query — so Clear all and Save are reachable without clearing the query. On open, focus moves to the sheet's panel, not the search field, so the reading order starts at the top of the sheet and the on-screen keyboard rises only when the person reaches for the search (WCAG 2.2 SC 2.4.3 Focus Order and 3.2.1 On Focus through `spec:AST-020/FR1`). Save commits the draft and closes the sheet (FR26); swipe, scrim, and Escape dismissal follow BottomSheet `purpose="info"` and close directly while the draft is unchanged, and ask first while it is changed (FR27). Each close the person makes — Save, a clean dismissal, a confirmed discard — clears the query and reports it through `onChangeQuery`, so the next open lists the bootstrap set, while a close the field forces (becoming disabled, FR17) keeps the query, since nothing the person did changed it; focus returns to the trigger after the sheet closes. While the search field holds focus on a touch screen, a direct vertical finger drag on the results of at least 8px moves focus from it to the sheet's panel, without clearing the query — a focus rule of the sheet's, so the rows the person reaches for come into view and focus never rests on the page body behind the open modal (`spec:AST-085/FR4`); what the on-screen keyboard does when the field loses focus is `spec:AST-099`'s. A tap, a shorter move, a multi-touch gesture, and a scroll event the list fires on its own (filtering can clamp its scroll position while the person is typing) leave focus where it is. | DEC-3; touch-flow evidence; `component:BottomSheet` | Verified current behavior. |-| FR19 | Each row is a `checkbox` named by the item label whose `aria-checked` mirrors membership in the sheet's draft (FR26): the selection the person is editing, which starts as `value` when the sheet opens. Activating an unchecked row adds the item to the draft; a checked row removes it; both apply to the draft at once and are announced with the inline field's words through the sheet's own live region (AR6); `value` and `onChange` are untouched until Save. Row order is stable while the sheet is open: the items selected when it opened, in `value` order, then draft-selected items absent from the results, then the results in source order; a toggle never moves an existing row. The next open takes a fresh snapshot. The query filters the selected rows by case-insensitive label substring. A row renders an item without its `action` and warns once in development that the sheet does not render it, as the inline panel does (`spec:AST-058/FR9`). | DEC-3; touch-flow evidence | Verified current behavior. |-| FR20 | An empty query lists the source's bootstrap set, capped at `maxMenuItems` as the inline field caps its focus bootstrap (the prop keeps its meaning in the sheet), requested at once on open and on clearing the query, so an instant source shows no busy feedback and announces no busy start; a query shorter than `minQueryLength` is not searched: it lists only the selected rows it matches and, with `hasCreate`, the create row, with no busy feedback, no empty state, and no outcome announcement, as the inline field shows nothing for such a query; otherwise the source is searched `debounceMs` after the query change and the results are capped at `maxMenuItems`. `onChangeQuery` fires on every query change. From open, and from each query change, until that search settles, the list is pending: it shows named busy feedback above any rows still listed from the previous search, the list element carries the busy semantics (`aria-busy`), since the sheet has no combobox (`family:input-fields/FR7`, which places busy semantics on the list a presentation without a combobox updates), and no empty state shows; when the settled search removes the row that holds focus, focus moves to the search field (`spec:AST-085/FR4`). Once settled, the outcome is announced through the sheet's live region (AR6): the result count for a searched query, or the rendered text of the empty state when it shows (`spec:AST-056/FR3`). A source that rejects settles the search to no results, as the inline field does. With no rows and no create row, a searched query shows the `emptySearchText` empty state (its default message when omitted); an empty query shows no list, no message, and announces nothing — only the search field, above the footer — as the inline field opens no menu and reports nothing for a bootstrap set that is empty: nothing has failed, and typing is what finds items (a search-only source, `bootstrap: () => []`, is such a source). | DEC-3; touch-flow evidence; `family:input-fields` | Verified current behavior. |-| FR21 | Long lists render progressively: 50 rows at a time, the next batch when the list scrolls within 200px of its end, with the window reset to the first batch on open and on each query change. The rendered and total counts are exposed as `data-rendered-count` and `data-total-count` on the list, and the rows sit in a `list` whose `listitem` wrappers carry `aria-setsize` with the total and `aria-posinset` with the row's position — the `checkbox` role itself admits neither — so a person moving through the rows can learn that more exist before the list has scrolled; whether a screen reader speaks the position ("n of total") from the focused checkbox depends on the screen reader (`spec:AST-009/FR8`), and the accessibility tree proves the `list`, `listitem`, `aria-setsize`, and `aria-posinset` exposure; focus reaching the last rendered row renders the next batch (WCAG 2.2 SC 1.3.1 Info and Relationships and 4.1.2 Name, Role, Value through `spec:AST-020/FR1`). | DEC-3; touch-flow evidence | Verified current behavior. |-| FR22 | With `hasCreate`, a non-empty trimmed query that matches no draft-selected id, no draft-selected label, and no result label (case-insensitive) adds a create row above the list showing `Create "{text}"` with a trailing Add action named `Add {text}`. Activating it adds to the draft an item with the text as both id and label — reported by Save as a `create` when that create is the last edit that still holds (FR26) — announces it, clears the query, and moves focus to the sheet's search field, since the row it was on is gone. The create row is absent while the draft is at `maxEntries`. | DEC-3; touch-flow evidence; `hasCreate` contract of the inline field | Verified current behavior. |-| FR23 | `maxEntries` is enforced on the draft: while the draft holds `maxEntries` items, unchecked rows carry `aria-disabled="true"`, stay focusable, and ignore activation; checked rows remain toggleable so the person can make room (`spec:AST-085/FR1`). While the draft holds more than `maxEntries` — a `value` over the limit when the sheet opened, or `maxEntries` lowered while the sheet is open — Save is `aria-disabled`, still in the focus order, with a tooltip naming the limit ("Select up to {count} items"), and does nothing until the draft is within it. | DEC-3; touch-flow evidence; `spec:AST-085` | Verified current behavior. |-| FR24 | Clear all is disabled while the draft is empty: `aria-disabled`, still in the focus order, with a tooltip saying nothing is selected, and a click opens nothing (`spec:AST-085/FR1`). Otherwise it opens the sheet's confirmation (FR27) naming the field, with Cancel as the safe action and Clear selection as the destructive one; confirming empties the draft — recorded as a removal of the draft's last item, which Save names in its `remove` when the clear is the last edit that holds (FR26); `value` is untouched until Save, so a discard restores it — closes the confirmation, and, once the confirmation has closed, moves focus to the sheet's search field, the destination this record names (`spec:AST-085/FR4`): the clear is spent, and the search field is where the next selection starts (WCAG 2.2 SC 2.4.3 through `spec:AST-020/FR1`), and announces "All items removed" inside the sheet (AR6); cancelling changes nothing and focus returns to Clear all. Clear all stays visible and reachable while searching, since the footer is pinned (FR18). | DEC-3; touch-flow evidence | Verified current behavior. |-| FR25 | The result list follows `component:BaseTypeahead` FR12: a press on the field's input or its buttons, or in the list, keeps it open, and a press anywhere else closes it. | `component:BaseTypeahead` FR12 | Verified current behavior |-| FR26 | One open sheet edits one draft. The draft starts as `value` when the sheet opens and takes every row toggle, create, and Clear all (FR19, FR22, FR24); `value` and `onChange` are untouched while the sheet is open. Save closes the sheet; with an unchanged draft it reports nothing, and with a changed one it reports the whole draft once through `onChange(items, change)`, where `change` names the last edit that still holds: the last toggle, create, or clear when its item is in the draft and was not selected at open (`add`, or `create` for an item created in this sheet) or was selected at open and is not in the draft (`remove`); otherwise, when the last edit was a removal and some item selected at open is gone, a `remove` naming one such item; otherwise an `add` (`create` when the last edit created that item) naming an item in the draft that was not selected at open; otherwise a `remove` naming an item gone since open. A field that is disabled when Save fires reports nothing. A toggle is announced when it happens (AR6), not again on Save. | DEC-4 | Verified current behavior. |-| FR27 | Swipe, scrim, and Escape dismissal of the sheet close it directly while the draft equals the selection at open. While the draft differs, they open a discard confirmation inside the sheet — "Discard changes?", "Your changes to {label} haven't been saved." — with Discard changes as the destructive action and Keep editing as the safe one, which is focused first; Discard changes closes the sheet without reporting the draft, and Keep editing closes the confirmation and moves focus to the search field so editing resumes where the sheet's own reading order starts (`spec:AST-085/FR4`). The sheet's confirmations (this one and Clear all's, FR24) are one modal dialog shape: a title, a description, and two full-width large actions stacked in reading order — the destructive action, then the safe action, which takes focus first; the two actions are one action group (`family:action-groups`) while keeping their separated, full-width, stacked look; scrim and Escape take the safe action. A close the field forces (becoming disabled, FR17) asks nothing and reports nothing: the draft is dropped. | DEC-4 | Verified current behavior, with one implementation gap: the confirmation's two actions are separated Buttons, not yet one action group (`family:action-groups`). |+| ID | Invariant | Basis | Status |+| ---- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------- |+| FR1 | Tokenizer MUST keep one native combobox input mounted across token addition, removal, clear, ordinary wrapping, and maximum-entry states. Reaching `maxEntries` may make the input zero-width, transparent, and out of flow, but MUST NOT replace its identity. | Current source and tests | Verified current behavior |+| FR2 | Tokenizer's suggestion menu MUST remain associated with the outer field/control surface. Existing `menuWidth` behavior remains an exact preferred pixel width plus the outer field's minimum width; it is not a maximum. | Current BaseTypeahead/Tokenizer source and docs | Verified current behavior; preserve |+| FR3 | `unfocusedInline` MAY replace direct token layout with OverflowList while blurred. `unfocusedLayer` MAY keep the real wrapper/input mounted in a context layer while an ordinary-flow placeholder represents the collapsed field. | Current source, tests, and stories | Verified current behavior |+| FR4 | Tokenizer MUST provide Core peers one package-internal descriptor with stable identities for its outer field/control surface and active opening control. Layer consumes the descriptor; public consumers cannot observe or configure it. | Approved package-internal contract; #5804 evidence; `spec:AST-002/DEC-1` | Current contract; implementation pending |+| FR5 | Add/search opens MUST identify the stable inner input as the opening control before the result row disappears. Selection, query clearing, result removal, refocus, or later input collapse MUST NOT substitute the transient result row or a pointer coordinate. | Current selection order plus approved descriptor contract | Current contract; implementation pending |+| FR6 | Edit opens MUST capture the actual activated token/control before state removes or replaces it. The Tokenizer-owned capture path MUST include custom `renderToken` output when activation originates from an identifiable descendant control; it MUST NOT require a new public ref contract. | Current owned wrapper plus approved capture contract | Current contract; implementation pending |+| FR7 | A non-null element is usable only while connected, rendered, and geometrically meaningful for the open being prepared. A disconnected, stale, hidden-layer, zero-width, or otherwise unusable opening control MUST fall back safely to the outer field at logical start before show. | Current max/overflow states plus approved safety rule | Current contract; implementation pending |+| FR8 | The descriptor MUST remain valid across focus movement, token add/remove/clear, wrapping, and `unfocusedLayer` reparenting. It MUST clear on unmount, perform no DOM work during SSR, and never retain an element beyond the open preparation that uses it. | Approved identity/lifetime contract | Current contract; implementation pending |+| FR9 | A consuming surface MUST resolve its preferred width before choosing horizontal placement. A surface at least as wide as the outer field MUST use outer-field logical-start alignment. Only a surface narrower than the outer field may use opening-control geometry. | Approved conditional-placement contract | Current contract; implementation pending |+| FR10 | For a narrower surface, Layer MUST compare the opening control with the outer field's physical start/end geometry, choose the nearer physical edge, map that result to logical start/end, and use logical start on a tie. Viewport collision runs last. | Approved Layer-consumer contract | Current contract; implementation pending |+| FR11 | Opening placement MUST be modality-neutral and latched for one open lifetime. Pointer, keyboard, touch, and programmatic activation of the same control MUST produce the same preferred edge. Pointer movement, later focus movement, resize, or target collapse MUST NOT recompute it. | `architecture:interaction-modality` plus approved stability contract | Current contract; implementation pending |+| FR12 | Placement state MUST commit while the surface is hidden, and Layer MUST show it on the next animation frame only after anchor, alignment, and width styles exist. A stale or invalid descriptor MUST never cause a visible wrong-position or first-frame flash. | Approved no-flash contract | Current contract; implementation pending |+| FR13 | Tokenizer MUST exclude every choice whose `SearchableItem.id` is already present in its committed `value` from displayed bootstrap and search cohorts, including results that settle after the controlled value changes. A caller-rejected proposed value remains eligible because it was not committed. Distinct IDs remain eligible even when their labels match. | Approved Tokenizer multi-selection contract | Current contract; implementation and verification pending |+| FR14 | With `hasEntriesOnFocus` enabled, committing a choice from the current settled empty-query bootstrap cohort MUST keep the input focused and the popup open when another eligible loaded choice remains. The active option advances to the next remaining choice in displayed order; when the committed choice was last, the nearest preceding choice becomes active. `aria-activedescendant` MUST reference that rendered option. | Approved rapid multi-select lifecycle | Current contract; implementation and verification pending |+| FR15 | The retained popup MUST close and clear its active descendant when no eligible loaded choice remains, `maxEntries` is reached, the control becomes disabled, focus leaves, or the person dismisses it. Disabled Tokenizer remains non-interactive. Pending or stale source work MUST NOT reopen a terminal popup or expose stale choices; loading has no selectable placeholder and its busy state clears when work is cancelled or settles. | Approved terminal-state safety boundary | Current contract; implementation and verification pending |+| FR16 | `presentation` selects the surface. `adaptive`, the value when `presentation` is omitted, resolves to `bottom-sheet` on compact coarse-pointer screens and to `popover` otherwise, through the one touch-presentation rule `spec:AST-094/FR13` owns, as the selection controls do; with a fine pointer or on a screen that is not compact it renders exactly the `popover` presentation. `popover` is the inline combobox with its anchored suggestion menu on every device, unchanged. `bottom-sheet` is the trigger and modal sheet of FR17–FR24, FR26, and FR27 on every device. `adaptive` renders on the server, and hydrates, as the inline field, because the resolver answers `popover` where there is no `matchMedia` and in the hydrating render; on a compact coarse-pointer client the field swaps to the trigger in the first render after hydration; nothing is focused before interaction, so focus is undisturbed (`document.activeElement` stays the body), except with `hasAutoFocus`, whose server-rendered `autofocus` focuses the inline input on load: then the swap moves that focus to the trigger — the same element and visit for the caller, so no `onBlur`/`onFocus` pair is reported. The trigger keeps the field's box — the same width, top, label, and `size` block size — except the inline input's own row: when the tokens leave the input no room on their row, the inline field wraps the input onto a row of its own, and the trigger, which has no input, drops that row (one `md` row, 27px, on a 390 and a 414px phone with five tokens); with room for the input beside the tokens, nothing shifts. A resolution change while the sheet is open takes effect after it closes and focus has returned to the trigger — the presentation hold `architecture:layer-runtime/INV14` assigns to the layer runtime; INV14 gap: the runtime does not yet provide one (its record names INV14 as ownership not yet met), so until it does the field keeps its own hold, to be replaced by the runtime's when it exists. Whenever the presentation changes while its control holds focus — then, or while the sheet is closed — focus moves to the new presentation's control, the combobox input or the trigger, so it never lands on the page body (`spec:AST-085/FR4`). | DEC-3; touch-flow evidence | Verified current behavior. |+| FR17 | In the sheet presentation the control surface is one button, named by the field label, with `aria-haspopup="dialog"` and `aria-expanded`. It shows the selected tokens without remove controls, or the placeholder when empty, wraps tokens onto further lines, and is the inline field's control box: the shared input box — its 1px border, focus ring, surface and radius — the inline field's token inset and row gap, and the `size` block size, so before the sheet opens the field looks the same as the inline field; the touch-sized targets belong to the sheet's rows and actions, not to the closed field. Activating it opens one tall modal BottomSheet named by the field label; the suggestion popover, inline input, and end lane do not render. While disabled the trigger stays focusable with `aria-disabled="true"`, does not open, and shows `disabledMessage` as the inline field does (`spec:AST-085/FR1`); a field that becomes disabled while its sheet is open closes the sheet and returns focus to the trigger (`spec:AST-085/FR2`). | DEC-3; touch-flow evidence; `spec:AST-085` | Verified current behavior. |+| FR18 | The sheet is a single surface: a search field at the top, a scrolling list of rows, and a footer with Clear all and Save pinned below the list. There is no second sheet. The search field is the shared panel search field drawn as a bordered input box (the input border and surface, element radius, the `lg` input height — 36px — above the sheet's 44px rows) rather than the borderless field a dropdown panel draws; it does not scroll with the list. The footer is rendered in every state of the sheet — while searching, while pending, with an empty query — so Clear all and Save are reachable without clearing the query. On open, focus moves to the sheet's panel, not the search field, so the reading order starts at the top of the sheet and the on-screen keyboard rises only when the person reaches for the search (WCAG 2.2 SC 2.4.3 Focus Order and 3.2.1 On Focus through `spec:AST-020/FR1`). Save commits the draft and closes the sheet (FR26); swipe, scrim, and Escape dismissal follow BottomSheet `purpose="info"` and close directly while the draft is unchanged, and ask first while it is changed (FR27). Each close the person makes — Save, a clean dismissal, a confirmed discard — clears the query and reports it through `onChangeQuery`, so the next open lists the bootstrap set, while a close the field forces (becoming disabled, FR17) keeps the query, since nothing the person did changed it; focus returns to the trigger after the sheet closes. While the search field holds focus on a touch screen, a direct vertical finger drag on the results of at least 8px moves focus from it to the sheet's panel, without clearing the query — a focus rule of the sheet's, so the rows the person reaches for come into view and focus never rests on the page body behind the open modal (`spec:AST-085/FR4`); what the on-screen keyboard does when the field loses focus is `spec:AST-099`'s. A tap, a shorter move, a multi-touch gesture, and a scroll event the list fires on its own (filtering can clamp its scroll position while the person is typing) leave focus where it is. | DEC-3; touch-flow evidence; `component:BottomSheet` | Verified current behavior. |+| FR19 | Each row is a `checkbox` named by the item label whose `aria-checked` mirrors membership in the sheet's draft (FR26): the selection the person is editing, which starts as `value` when the sheet opens. Activating an unchecked row adds the item to the draft; a checked row removes it; both apply to the draft at once and are announced with the inline field's words through the sheet's own live region (AR6); `value` and `onChange` are untouched until Save. Row order is stable while the sheet is open: the items selected when it opened, in `value` order, then draft-selected items absent from the results, then the results in source order; a toggle never moves an existing row. The next open takes a fresh snapshot. The query filters the selected rows by case-insensitive label substring. A row renders an item without its `action` and warns once in development that the sheet does not render it, as the inline panel does (`spec:AST-058/FR9`). | DEC-3; touch-flow evidence | Verified current behavior. |+| FR20 | An empty query lists the source's bootstrap set, capped at `maxMenuItems` as the inline field caps its focus bootstrap (the prop keeps its meaning in the sheet), requested at once on open and on clearing the query, so an instant source shows no busy feedback and announces no busy start; a query shorter than `minQueryLength` is not searched: it lists only the selected rows it matches and, with `hasCreate`, the create row, with no busy feedback, no empty state, and no outcome announcement, as the inline field shows nothing for such a query; otherwise the source is searched `debounceMs` after the query change and the results are capped at `maxMenuItems`. `onChangeQuery` fires on every query change. From open, and from each query change, until that search settles, the list is pending: it shows named busy feedback above any rows still listed from the previous search, the list element carries the busy semantics (`aria-busy`), since the sheet has no combobox (`family:input-fields/FR7`, which places busy semantics on the list a presentation without a combobox updates), and no empty state shows; when the settled search removes the row that holds focus, focus moves to the search field (`spec:AST-085/FR4`). Once settled, the outcome is announced through the sheet's live region (AR6): the result count for a searched query, or the rendered text of the empty state when it shows (`spec:AST-056/FR3`). A source that rejects settles the search to no results, as the inline field does. With no rows and no create row, a searched query shows the `emptySearchText` empty state (its default message when omitted); an empty query shows no list, no message, and announces nothing — only the search field, above the footer — as the inline field opens no menu and reports nothing for a bootstrap set that is empty: nothing has failed, and typing is what finds items (a search-only source, `bootstrap: () => []`, is such a source). | DEC-3; touch-flow evidence; `family:input-fields` | Verified current behavior. |+| FR21 | Long lists render progressively: 50 rows at a time, the next batch when the list scrolls within 200px of its end, with the window reset to the first batch on open and on each query change. The rendered and total counts are exposed as `data-rendered-count` and `data-total-count` on the list, and the rows sit in a `list` whose `listitem` wrappers carry `aria-setsize` with the total and `aria-posinset` with the row's position — the `checkbox` role itself admits neither — so a person moving through the rows can learn that more exist before the list has scrolled; whether a screen reader speaks the position ("n of total") from the focused checkbox depends on the screen reader (`spec:AST-009/FR8`), and the accessibility tree proves the `list`, `listitem`, `aria-setsize`, and `aria-posinset` exposure; focus reaching the last rendered row renders the next batch (WCAG 2.2 SC 1.3.1 Info and Relationships and 4.1.2 Name, Role, Value through `spec:AST-020/FR1`). | DEC-3; touch-flow evidence | Verified current behavior. |+| FR22 | With `hasCreate`, a non-empty trimmed query that matches no draft-selected id, no draft-selected label, and no result label (case-insensitive) adds a create row above the list showing `Create "{text}"` with a trailing Add action named `Add {text}`. Activating it adds to the draft an item with the text as both id and label — reported by Save as a `create` when that create is the last edit that still holds (FR26) — announces it, clears the query, and moves focus to the sheet's search field, since the row it was on is gone. The create row is absent while the draft is at `maxEntries`. | DEC-3; touch-flow evidence; `hasCreate` contract of the inline field | Verified current behavior. |+| FR23 | `maxEntries` is enforced on the draft: while the draft holds `maxEntries` items, unchecked rows carry `aria-disabled="true"`, stay focusable, and ignore activation; checked rows remain toggleable so the person can make room (`spec:AST-085/FR1`). While the draft holds more than `maxEntries` — a `value` over the limit when the sheet opened, or `maxEntries` lowered while the sheet is open — Save is `aria-disabled`, still in the focus order, with a tooltip naming the limit ("Select up to {count} items"), and does nothing until the draft is within it. | DEC-3; touch-flow evidence; `spec:AST-085` | Verified current behavior. |+| FR24 | Clear all is disabled while the draft is empty: `aria-disabled`, still in the focus order, with a tooltip saying nothing is selected, and a click opens nothing (`spec:AST-085/FR1`). Otherwise it opens the sheet's confirmation (FR27) naming the field, with Cancel as the safe action and Clear selection as the destructive one; confirming empties the draft — recorded as a removal of the draft's last item, which Save names in its `remove` when the clear is the last edit that holds (FR26); `value` is untouched until Save, so a discard restores it — closes the confirmation, and, once the confirmation has closed, moves focus to the sheet's search field, the destination this record names (`spec:AST-085/FR4`): the clear is spent, and the search field is where the next selection starts (WCAG 2.2 SC 2.4.3 through `spec:AST-020/FR1`), and announces "All items removed" inside the sheet (AR6); cancelling changes nothing and focus returns to Clear all. Clear all stays visible and reachable while searching, since the footer is pinned (FR18). | DEC-3; touch-flow evidence | Verified current behavior. |+| FR25 | The result list follows `component:BaseTypeahead` FR12: a press on the field's input or its buttons, or in the list, keeps it open, and a press anywhere else closes it. | `component:BaseTypeahead` FR12 | Verified current behavior |+| FR26 | One open sheet edits one draft. The draft starts as `value` when the sheet opens and takes every row toggle, create, and Clear all (FR19, FR22, FR24); `value` and `onChange` are untouched while the sheet is open. Save closes the sheet; with an unchanged draft it reports nothing, and with a changed one it reports the whole draft once through `onChange(items, change)`, where `change` names the last edit that still holds: the last toggle, create, or clear when its item is in the draft and was not selected at open (`add`, or `create` for an item created in this sheet) or was selected at open and is not in the draft (`remove`); otherwise, when the last edit was a removal and some item selected at open is gone, a `remove` naming one such item; otherwise an `add` (`create` when the last edit created that item) naming an item in the draft that was not selected at open; otherwise a `remove` naming an item gone since open. A field that is disabled when Save fires reports nothing. A toggle is announced when it happens (AR6), not again on Save. | DEC-4 | Verified current behavior. |+| FR27 | Swipe, scrim, and Escape dismissal of the sheet close it directly while the draft equals the selection at open. While the draft differs, they open a discard confirmation inside the sheet — "Discard changes?", "Your changes to {label} haven't been saved." — with Discard changes as the destructive action and Keep editing as the safe one, which is focused first; Discard changes closes the sheet without reporting the draft, and Keep editing closes the confirmation and moves focus to the search field so editing resumes where the sheet's own reading order starts (`spec:AST-085/FR4`). The sheet's confirmations (this one and Clear all's, FR24) are one modal dialog shape: a title, a description, and two full-width large actions stacked in reading order — the destructive action, then the safe action, which takes focus first; the two actions are one action group (`family:action-groups`) while keeping their separated, full-width, stacked look; scrim and Escape take the safe action. A close the field forces (becoming disabled, FR17) asks nothing and reports nothing: the draft is dropped. | DEC-4 | Verified current behavior, with one implementation gap: the confirmation's two actions are separated Buttons, not yet one action group (`family:action-groups`). |### Allowed variation@@ -499,18 +498,18 @@ become Tokenizer policy.## Verification map-| Contract | Verification | Representative states | Mutation or failure expectation | Audit section |-| ------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------- |-| FR1–FR3 | Existing Tokenizer/BaseTypeahead unit tests plus source inspection | empty, tokens, remove, clear, max, wrapping, both overflow modes | Input remounts, suggestion menu changes anchor/width semantics, or overflow ownership is misstated. | `audit:Tokenizer/current` |-| FR4–FR8 | Focused descriptor identity/capture tests when implemented | add, default/custom token edit, max, hidden layer, reparent, stale node, unmount, SSR | Descriptor leaks publicly, captures a transient result/pointer, misses custom controls, or uses unusable geometry. | `audit:Tokenizer/opening-anchor` |-| FR9–FR12 | Layer unit tests and real-Chromium geometry checks when implemented | full/equal/narrow surface, start/end/tie, LTR/RTL, collision, stale fallback | Full-width follows inner input, tie is physical, collision runs early, or stale identity flashes. | `audit:Tokenizer/placement` |-| FR13–FR15, AR5 | Focused Tokenizer/BaseTypeahead tests and exact-head Chromium interaction evidence | pointer/keyboard commit, first/middle/last choice, rejected/deferred control, loading, disabled, max, exhaustion, Escape, Tab, outside focus | Selected values remain available, order changes, focus leaves the combobox, active descendant names no option, stale work reopens, or a terminal state stays interactive. | `audit:Tokenizer/multi-select` |-| PR1–PR5 | Instrumented reads, pending-frame cleanup tests, and first-frame Chromium capture | open, close before frame, reopen opposite side, resize while open | Render-time/repeated reads, observer/pointer tracking, uncancelled frame, or first-frame jump occurs. | `audit:Tokenizer/performance` |-| AR1–AR5 | Existing interaction suites plus focused pointer/keyboard/browser checks; native-disabled assertions pending conformance (`spec:AST-085`) | add/edit, focus/refocus, overflow, disabled, dismissal, retained bootstrap selection | Modality changes placement, semantics/focus regress, active descendant becomes invalid, or visible placement is wrong before fallback. | `audit:Tokenizer/accessibility` |-| AR7 | Focused Tokenizer tests, inline and sheet, and the PowerSearch test | inline Clear all; a localized catalog; a Clear all confirmed in the sheet counted across every live region; PowerSearch's own words | The inline Clear all is silent, speaks words other than its catalog message, a sheet Clear all is announced twice, or PowerSearch speaks Tokenizer's words. | `audit:Tokenizer/accessibility` |-| FR16–FR24, FR26, FR27, AR6, PR6 | Focused Tokenizer sheet tests with the compact-touch query stubbed both ways, a server-render-then-hydrate test, the sheet's draft, Save, pinned footer, discard confirmation and results-drag tests with the draft rule's unit tests, plus real-engine touch evidence | the default resolving both ways, `popover` kept on a compact coarse-pointer screen, the deprecated `experimental.presentation` and its precedence warning, Core's composites that render Tokenizer inline — PowerSearch's field and list value editors and Table's list filter — staying inline on a compact coarse-pointer screen, forced sheet, `adaptive` server-rendered as the combobox with the same markup as `popover` and hydrated without a recoverable error, then the trigger on a coarse-pointer client with the body still active, with `hasAutoFocus` the autofocused input's focus on the trigger after the swap and no `onBlur`/`onFocus` reported, the trigger's box against the hydrating field's at 390 and 414px, base props and ref on the trigger, the trigger's description in the inline input's order — a disabled trigger with `disabledMessage`, `description` and a status exposing the caller's ids, the description, the status message and the reason before the count and the tokens —, inert-prop warning, pending search, in-sheet announcements of toggles, busy start, result count and the rendered empty outcome, the confirmed Clear all announced once the confirmation has closed, a below-threshold query, a rejecting source, focus on the panel at open, the query cleared by a swipe, scrim, or Escape close, focus after a presentation change with the sheet closed, focus after the create row, focus after a confirmed Clear all, a spent Clear all focusable with `aria-disabled` and no action, focus after a settled search removes the focused row, no busy feedback or busy-start announcement on open with an instant source, only the search field — no list, no message, no announcement — for an empty query with nothing to list (a search-only source, nothing selected), and the list once a query finds items, element counts under a fine and a coarse pointer at rest and open (Chromium, the Adaptive (default) and Bottom sheet stories: adaptive 154/120 at rest — the closed trigger in place of the inline field, a different element that stays under the fine count — and 157/165 open at the query "e" with no footer, the coarse total reconciled as rest − the re-hosted surfaces host + the dialog of 47 by part, forced sheet 114/114 and 165/165; the two owner exceptions DEC-3 records beyond the FR60 allowance, with before and after counts), no confirmation dialog in the DOM while none is pending, the query kept across a disabled-forced close, `aria-setsize`/`aria-posinset` on each row's `listitem` and the next batch on focus reaching the last rendered row, open/toggle/reopen order, create, batches, limit, Clear all, disabled while open, focus return, `value` unchanged through toggles, create, and Clear all until Save, Save with an unchanged draft reporting nothing and with a changed one reporting the whole draft and the last holding edit, a clean dismissal closing directly, a dirty dismissal asking — Keep editing back to the search field, Discard changes closing without a report —, the footer present while searching, Save disabled over the limit, a results drag moving focus off the search with the query kept | A field with a fine pointer or on a screen that is not compact changes by default, `presentation="popover"` presents the sheet, a Core composite's inline Tokenizer becomes a sheet trigger, a toggle moves a row, a toggle, the create row, or a confirmed Clear all changes `value` before Save, Save reports more than one change or reports when the draft is unchanged, a swipe, scrim, or Escape closes a changed draft without the discard confirmation or asks on an unchanged one, Save or Clear all leaves while the query is non-empty, Clear all skips confirmation, the limit disables checked rows, or the popover bundle carries the sheet. | `audit:Tokenizer/sheet` |-| FR25 | `Tokenizer.test.tsx` press-inside case; `component:BaseTypeahead` FR12's verification | Press in the input, press elsewhere | A press in the input that closes the list, or a press elsewhere that leaves it open, fails. | — |-| Record structure | `scripts/check-knowledge.mjs` | Template-v3 current record and current-only frontmatter links | Invalid metadata, authority, or relationship references fail repository validation. | `audit:Tokenizer/knowledge` |+| Contract | Verification | Representative states | Mutation or failure expectation | Audit section |+| ------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------- |+| FR1–FR3 | Existing Tokenizer/BaseTypeahead unit tests plus source inspection | empty, tokens, remove, clear, max, wrapping, both overflow modes | Input remounts, suggestion menu changes anchor/width semantics, or overflow ownership is misstated. | `audit:Tokenizer/current` |+| FR4–FR8 | Focused descriptor identity/capture tests when implemented | add, default/custom token edit, max, hidden layer, reparent, stale node, unmount, SSR | Descriptor leaks publicly, captures a transient result/pointer, misses custom controls, or uses unusable geometry. | `audit:Tokenizer/opening-anchor` |+| FR9–FR12 | Layer unit tests and real-Chromium geometry checks when implemented | full/equal/narrow surface, start/end/tie, LTR/RTL, collision, stale fallback | Full-width follows inner input, tie is physical, collision runs early, or stale identity flashes. | `audit:Tokenizer/placement` |+| FR13–FR15, AR5 | Focused Tokenizer/BaseTypeahead tests and exact-head Chromium interaction evidence | pointer/keyboard commit, first/middle/last choice, rejected/deferred control, loading, disabled, max, exhaustion, Escape, Tab, outside focus | Selected values remain available, order changes, focus leaves the combobox, active descendant names no option, stale work reopens, or a terminal state stays interactive. | `audit:Tokenizer/multi-select` |+| PR1–PR5 | Instrumented reads, pending-frame cleanup tests, and first-frame Chromium capture | open, close before frame, reopen opposite side, resize while open | Render-time/repeated reads, observer/pointer tracking, uncancelled frame, or first-frame jump occurs. | `audit:Tokenizer/performance` |+| AR1–AR5 | Existing interaction suites plus focused pointer/keyboard/browser checks; native-disabled assertions pending conformance (`spec:AST-085`) | add/edit, focus/refocus, overflow, disabled, dismissal, retained bootstrap selection | Modality changes placement, semantics/focus regress, active descendant becomes invalid, or visible placement is wrong before fallback. | `audit:Tokenizer/accessibility` |+| AR7 | Focused Tokenizer tests, inline and sheet, and the PowerSearch test | inline Clear all; a localized catalog; a Clear all confirmed in the sheet counted across every live region; PowerSearch's own words | The inline Clear all is silent, speaks words other than its catalog message, a sheet Clear all is announced twice, or PowerSearch speaks Tokenizer's words. | `audit:Tokenizer/accessibility` |+| FR16–FR24, FR26, FR27, AR6, PR6 | Focused Tokenizer sheet tests with the compact-touch query stubbed both ways, a server-render-then-hydrate test, the sheet's draft, Save, pinned footer, discard confirmation and results-drag tests with the draft rule's unit tests, plus real-engine touch evidence | the default resolving both ways, `popover` kept on a compact coarse-pointer screen, Core's composites that render Tokenizer inline — PowerSearch's field and list value editors and Table's list filter — staying inline on a compact coarse-pointer screen, forced sheet, `adaptive` server-rendered as the combobox with the same markup as `popover` and hydrated without a recoverable error, then the trigger on a coarse-pointer client with the body still active, with `hasAutoFocus` the autofocused input's focus on the trigger after the swap and no `onBlur`/`onFocus` reported, the trigger's box against the hydrating field's at 390 and 414px, base props and ref on the trigger, the trigger's description in the inline input's order — a disabled trigger with `disabledMessage`, `description` and a status exposing the caller's ids, the description, the status message and the reason before the count and the tokens —, inert-prop warning, pending search, in-sheet announcements of toggles, busy start, result count and the rendered empty outcome, the confirmed Clear all announced once the confirmation has closed, a below-threshold query, a rejecting source, focus on the panel at open, the query cleared by a swipe, scrim, or Escape close, focus after a presentation change with the sheet closed, focus after the create row, focus after a confirmed Clear all, a spent Clear all focusable with `aria-disabled` and no action, focus after a settled search removes the focused row, no busy feedback or busy-start announcement on open with an instant source, only the search field — no list, no message, no announcement — for an empty query with nothing to list (a search-only source, nothing selected), and the list once a query finds items, element counts under a fine and a coarse pointer at rest and open (Chromium, the Adaptive (default) and Bottom sheet stories: adaptive 154/120 at rest — the closed trigger in place of the inline field, a different element that stays under the fine count — and 157/165 open at the query "e" with no footer, the coarse total reconciled as rest − the re-hosted surfaces host + the dialog of 47 by part, forced sheet 114/114 and 165/165; the two owner exceptions DEC-3 records beyond the FR60 allowance, with before and after counts), no confirmation dialog in the DOM while none is pending, the query kept across a disabled-forced close, `aria-setsize`/`aria-posinset` on each row's `listitem` and the next batch on focus reaching the last rendered row, open/toggle/reopen order, create, batches, limit, Clear all, disabled while open, focus return, `value` unchanged through toggles, create, and Clear all until Save, Save with an unchanged draft reporting nothing and with a changed one reporting the whole draft and the last holding edit, a clean dismissal closing directly, a dirty dismissal asking — Keep editing back to the search field, Discard changes closing without a report —, the footer present while searching, Save disabled over the limit, a results drag moving focus off the search with the query kept | A field with a fine pointer or on a screen that is not compact changes by default, `presentation="popover"` presents the sheet, a Core composite's inline Tokenizer becomes a sheet trigger, a toggle moves a row, a toggle, the create row, or a confirmed Clear all changes `value` before Save, Save reports more than one change or reports when the draft is unchanged, a swipe, scrim, or Escape closes a changed draft without the discard confirmation or asks on an unchanged one, Save or Clear all leaves while the query is non-empty, Clear all skips confirmation, the limit disables checked rows, or the popover bundle carries the sheet. | `audit:Tokenizer/sheet` |+| FR25 | `Tokenizer.test.tsx` press-inside case; `component:BaseTypeahead` FR12's verification | Press in the input, press elsewhere | A press in the input that closes the list, or a press elsewhere that leaves it open, fails. | — |+| Record structure | `scripts/check-knowledge.mjs` | Template-v3 current record and current-only frontmatter links | Invalid metadata, authority, or relationship references fail repository validation. | `audit:Tokenizer/knowledge` |## Decision log@@ -567,9 +566,7 @@ per-selection `onChange`, and its input `ref` (`architecture:public-component-apINV16). `adaptive` resolves through the shared compact coarse-pointer policy,so a Tokenizer and a Selector on the same page switch together. The value setis the selection controls' `AdaptivePresentation`, because Tokenizer picks-several items from a searchable list as MultiSelector does. The earlier-spelling, `experimental.presentation`, stays as a deprecated experimental-alias so a released call keeps working (`spec:AST-017/FR23`). The stable+several items from a searchable list as MultiSelector does. The stableprop and the `adaptive` default ship together in a patch release: the APIchange is additive, the behavior changes only on compact coarse-pointerscreens, and `presentation="popover"` keeps the previous behavior everywhere.diff --git a/packages/cli/assets/codemods/transforms/next/__tests__/promote-tokenizer-presentation.test.mjs b/packages/cli/assets/codemods/transforms/next/__tests__/promote-tokenizer-presentation.test.mjsindex 4de725009c..eadd8ab670 100644--- a/packages/cli/assets/codemods/transforms/next/__tests__/promote-tokenizer-presentation.test.mjs+++ b/packages/cli/assets/codemods/transforms/next/__tests__/promote-tokenizer-presentation.test.mjs@@ -54,7 +54,7 @@ const a = <Core.Tokenizer label="Tags" experimental={{presentation: 'adaptive',);});- it('leaves a TODO and the deprecated spelling where it cannot prove the rewrite', async () => {+ it('leaves a TODO and the call unchanged where it cannot prove the rewrite', async () => {const source = `import {Tokenizer} from '@astryxdesign/core';const a = <Tokenizer label="Tags" experimental={options} />;const b = <Tokenizer label="Tags" experimental={{presentation: 'adaptive'}} {...rest} />;@@ -64,17 +64,40 @@ const d = <Tokenizer label="Tags" experimental={{...base, presentation: 'adaptivexpect(output.match(/TODO\(astryx upgrade\)/g)).toHaveLength(4);expect(flat(output)).toContain("experimental={{presentation: 'adaptive'}}");expect(flat(output)).toContain('experimental={options}');+ // Each case names its own reason.+ const text = flat(output);+ expect(text).toContain('because the value is not a literal object.');+ expect(text).toContain('because a spread may also set presentation.');+ expect(text).toContain(+ 'presentation is already set; remove experimental.presentation.',+ );+ expect(text).toContain(+ 'because the object has a spread or a computed key.',+ );});- it('moves the value past a spread that comes before experimental', async () => {+ it('names a repeated presentation key in its TODO', async () => {const output = flat(await applyTransform(`import {Tokenizer} from '@astryxdesign/core';-const a = <Tokenizer {...args} label="Tags" experimental={{presentation: 'bottom-sheet'}} />;`),+const a = <Tokenizer label="Tags" experimental={{presentation: 'adaptive', 'presentation': 'popover'}} />;`),);expect(output).toContain(- '<Tokenizer {...args} label="Tags" presentation="bottom-sheet" />',+ 'because the object sets presentation more than once.',);- expect(output).not.toContain('TODO');+ expect(output).not.toContain('presentation="');+ });++ it('leaves a TODO for a spread on either side of experimental, because the spread can set presentation', async () => {+ const source = `import {Tokenizer} from '@astryxdesign/core';+const a = <Tokenizer {...args} label="Tags" experimental={{presentation: 'bottom-sheet'}} />;+const b = <Tokenizer label="Tags" experimental={{presentation: 'bottom-sheet'}} {...args} />;`;+ const output = await applyTransform(source);+ expect(output.match(/TODO\(astryx upgrade\)/g)).toHaveLength(2);+ expect(+ flat(output).match(/because a spread may also set presentation\./g),+ ).toHaveLength(2);+ expect(flat(output)).not.toContain('presentation="bottom-sheet"');+ expect(await applyTransform(output)).toBe(output);});it('changes nothing without an experimental presentation or outside core', async () => {diff --git a/packages/cli/assets/codemods/transforms/next/promote-tokenizer-presentation.mjs b/packages/cli/assets/codemods/transforms/next/promote-tokenizer-presentation.mjsindex c02bceb86a..f03d00d4cb 100644--- a/packages/cli/assets/codemods/transforms/next/promote-tokenizer-presentation.mjs+++ b/packages/cli/assets/codemods/transforms/next/promote-tokenizer-presentation.mjs@@ -4,41 +4,49 @@* @file Codemod: move Tokenizer's experimental presentation to the stable prop** `experimental={{presentation: x}}` on a Tokenizer becomes- * `presentation={x}`, or `presentation="x"` for a string. Other keys stay in- * the `experimental` object, and an object left empty is removed. The- * deprecated spelling selects the same surface, so the result renders the- * same. Built on the shared `transformProp` helper, so it does not follow- * variables, helpers, wrappers, or types. Where it cannot prove the result it- * keeps the deprecated spelling, which still works, and leaves a TODO: an- * `experimental` value that is not an object literal, a spread or computed- * key in it, a Tokenizer that already passes `presentation`, and a spread of- * props after `experimental`, which could set `presentation` over the moved- * value. A spread before `experimental` is safe: the moved attribute takes- * `experimental`'s place, so it still wins over the spread, as the- * experimental value did, and before this release a spread's `presentation`- * did nothing. Each TODO is added once, so a second run changes- * nothing.+ * `presentation={x}`, or `presentation="x"` for a string. Tokenizer no longer+ * reads `experimental`, and `presentation` takes the same values, so the+ * rewrite restores the surface the call selected. Other keys stay in the+ * `experimental` object, and an object left empty is removed. Built on the+ * shared `transformProp` helper, so it does not follow variables, helpers,+ * wrappers, or types. Where it cannot prove the result it leaves the call+ * unchanged with a TODO: an `experimental` value that is not an object+ * literal, a spread or computed key in it, a Tokenizer that already passes+ * `presentation`, and a Tokenizer that spreads props. A spread can carry+ * `presentation`, also as `undefined`, and then the result changes with the+ * moved attribute before or after it. Each TODO names its case and is added+ * once, so a second run changes nothing.*/import {transformProp} from '../../transform-prop.mjs';export const meta = {- title: "Move Tokenizer's experimental presentation to presentation",+ title: "Move Tokenizer's removed experimental presentation to presentation",description:- 'Rewrites `experimental={{presentation: x}}` on Tokenizer to the stable ' +- '`presentation={x}`. Keeps the deprecated spelling, which still works, ' +- 'with a TODO where the experimental value is not an object literal, ' +- 'where the Tokenizer already passes presentation, and where it spreads ' +- 'props after experimental.',+ 'Rewrites `experimental={{presentation: x}}` on Tokenizer to ' ++ '`presentation={x}`; Tokenizer no longer reads `experimental`. Leaves a ' ++ 'TODO where the experimental value is not an object literal, where the ' ++ 'Tokenizer already passes presentation, and where it spreads props.',};const CORE_IMPORT_RE = /^@(astryxdesign|xds)\/core(?:\/|$)/;const COMPONENT_PROPS = new Map([['Tokenizer', new Set(['experimental'])]]);-const TODO_COMMENT =- ' TODO(astryx upgrade): experimental.presentation is deprecated. Pass ' +- 'presentation instead; this one was left unchanged because the codemod ' +- 'could not prove the rewrite. ';+const TODO_PREFIX =+ ' TODO(astryx upgrade): experimental.presentation was removed in favor of ' ++ 'presentation. ';+/** @param {string} reason */+const moveTodo = reason =>+ `${TODO_PREFIX}Move the value to presentation; the codemod left this one ` ++ `unchanged because ${reason}. `;+/** One TODO per case, so the reader knows what to check. */+const TODOS = {+ notLiteral: moveTodo('the value is not a literal object'),+ unprovenKey: moveTodo('the object has a spread or a computed key'),+ repeatedKey: moveTodo('the object sets presentation more than once'),+ presentationSet: `${TODO_PREFIX}presentation is already set; remove experimental.presentation. `,+ spread: moveTodo('a spread may also set presentation'),+};const TYPE_WRAPPERS = new Set(['TSAsExpression',@@ -129,18 +137,27 @@ export default function transformer(file, api) {) {return;}- const isProvable =- value?.type === 'ObjectExpression' &&- presentationEntries.length === 1 &&- !hasUnprovenEntry &&- !attributes.some(- (/** @type {any} */ a, /** @type {number} */ index) =>- (a.type === 'JSXSpreadAttribute' &&- index > attributes.indexOf(prop)) ||- (a.type === 'JSXAttribute' && a.name?.name === 'presentation'),- );- if (!isProvable) {- hasChanges = addComment(j, prop, TODO_COMMENT) || hasChanges;+ const hasPresentation = attributes.some(+ (/** @type {any} */ a) =>+ a.type === 'JSXAttribute' && a.name?.name === 'presentation',+ );+ const hasSpread = attributes.some(+ (/** @type {any} */ a) => a.type === 'JSXSpreadAttribute',+ );+ const todo =+ value?.type !== 'ObjectExpression'+ ? TODOS.notLiteral+ : hasUnprovenEntry+ ? TODOS.unprovenKey+ : hasPresentation+ ? TODOS.presentationSet+ : presentationEntries.length > 1+ ? TODOS.repeatedKey+ : hasSpread+ ? TODOS.spread+ : null;+ if (todo != null) {+ hasChanges = addComment(j, prop, todo) || hasChanges;return;}diff --git a/packages/core/api-report.md b/packages/core/api-report.mdindex f51a325053..ac2d19dd74 100644--- a/packages/core/api-report.md+++ b/packages/core/api-report.md@@ -2623,7 +2623,6 @@ component Tokenizer(props: TokenizerProps)prop disabledMessage?: stringprop emptySearchText?: ReactNode = 'No results found'prop endContent?: ReactNode- prop experimental?: { presentation?: TokenizerPresentation } @experimentalprop handleRef?: React.Ref<TokenizerHandle>prop hasAutoFocus?: boolean = falseprop hasClear?: boolean = falsediff --git a/packages/core/src/Tokenizer/Tokenizer.doc.mjs b/packages/core/src/Tokenizer/Tokenizer.doc.mjsindex eb9d27b32c..e48efa7239 100644--- a/packages/core/src/Tokenizer/Tokenizer.doc.mjs+++ b/packages/core/src/Tokenizer/Tokenizer.doc.mjs@@ -299,13 +299,6 @@ export const docs = {'How the field presents its choices. adaptive (the default) uses the bottom sheet on compact touch screens and the popover otherwise, resolved the same way Selector resolves it; the server render and the hydrating render are the popover. popover is the inline combobox with its anchored suggestion menu on every device. bottom-sheet replaces it on every device with a trigger showing the selected tokens that opens one tall modal sheet: a search row on top, full-width checkbox rows that keep their place while the sheet is open, a Create row with hasCreate, and a footer pinned in every state with a confirmed Clear all and Save; the sheet edits a draft, so onChange fires once, when Save commits it, and a swipe, scrim or Escape close of a changed draft asks before discarding. In the sheet presentation the trigger is the control: ref, id, aria-* and data-* reach it, and ref receives the trigger button there, so type it Ref<HTMLInputElement | HTMLButtonElement>, which the component accepts (TokenizerProps keeps its released input ref type). renderItem, renderToken, endContent, hasClear, hasEntriesOnFocus, menuWidth, tokenOverflowBehavior and hasAutoFocus have no surface in the sheet, and the field warns once in development when they are passed. Pass presentation="popover" to keep the inline field and those props on every device.',default: "'adaptive'",},- {- name: 'experimental',- type: "{presentation?: 'popover' | 'bottom-sheet' | 'adaptive'}",- stability: 'experimental',- description:- 'Experimental options: anything in this object may change or be removed in a patch release. Deprecated: experimental.presentation is the earlier spelling of presentation; use presentation. It still works with the same values, and presentation wins when both are set.',- },],theming: {targets: [@@ -652,13 +645,6 @@ export const docsZh = {'字段如何呈现选项。adaptive(默认)在紧凑触摸屏上使用底部面板,其他情况使用 popover,解析方式与 Selector 相同;服务端渲染和水合期间的渲染均为 popover。popover 在所有设备上为内联组合框及其锚定建议菜单。bottom-sheet 在所有设备上改为一个显示已选标记的触发按钮,点按后打开一个高的模态底部面板——顶部为搜索行,下方为整行复选框行(面板打开期间位置保持不变),hasCreate 时有「创建」行,底部固定显示需确认的「全部清除」和「保存」;面板编辑的是草稿,onChange 仅在「保存」提交时触发一次,草稿有改动时滑动、点击遮罩或按 Escape 关闭会先询问是否放弃。在底部面板呈现中,触发按钮即为控件:ref、id、aria-* 和 data-* 都作用于它,ref 在该呈现中收到的是触发按钮,因此请将其类型声明为组件所接受的 Ref<HTMLInputElement | HTMLButtonElement>(TokenizerProps 保留已发布的输入框 ref 类型)。renderItem、renderToken、endContent、hasClear、hasEntriesOnFocus、menuWidth、tokenOverflowBehavior 和 hasAutoFocus 在底部面板中没有作用对象,传入时开发模式下会警告一次。传入 presentation="popover" 可在所有设备上保留内联字段和这些属性。',default: "'adaptive'",},- {- name: 'experimental',- type: "{presentation?: 'popover' | 'bottom-sheet' | 'adaptive'}",- stability: 'experimental',- description:- '实验性选项:此对象中的任何内容都可能在补丁版本中更改或移除。已弃用:experimental.presentation 是 presentation 的旧写法,请改用 presentation。它仍以相同的取值生效,两者同时设置时以 presentation 为准。',- },],theming: {targets: [@@ -860,7 +846,5 @@ export const docsDense = {handleRef: 'Imperative handle for focus() and blur() control.',presentation:"'adaptive' (default: sheet on compact touch, else popover; SSR/hydration render popover) | 'popover' (inline combobox, every device) | 'bottom-sheet' (trigger + one searchable modal sheet of checkbox rows editing a draft that Save commits; onChange fires once, on Save). Sheet: ref reaches the trigger button; renderItem/renderToken/endContent/hasClear/hasEntriesOnFocus/menuWidth/tokenOverflowBehavior/hasAutoFocus inert (dev warning). presentation=\"popover\" keeps them on every device.",- experimental:- 'Experimental; may change in a patch. Deprecated presentation: old spelling of presentation; presentation wins if both set.',},};diff --git a/packages/core/src/Tokenizer/Tokenizer.props-type.test.tsx b/packages/core/src/Tokenizer/Tokenizer.props-type.test.tsxindex 251b93f9c2..fb11a75539 100644--- a/packages/core/src/Tokenizer/Tokenizer.props-type.test.tsx+++ b/packages/core/src/Tokenizer/Tokenizer.props-type.test.tsx@@ -106,14 +106,6 @@ export function compiles() {onChange={() => {}}presentation="bottom-sheet"/>- {/* The deprecated spelling still compiles. */}- <Tokenizer- label="Tags"- searchSource={source}- value={[]}- onChange={() => {}}- experimental={{presentation: 'adaptive'}}- /><Tokenizerlabel="Tags"searchSource={source}diff --git a/packages/core/src/Tokenizer/Tokenizer.tsx b/packages/core/src/Tokenizer/Tokenizer.tsxindex 0dca4c455f..56484ea7fb 100644--- a/packages/core/src/Tokenizer/Tokenizer.tsx+++ b/packages/core/src/Tokenizer/Tokenizer.tsx@@ -57,7 +57,6 @@ import {} from '../hooks/useAdaptivePresentation';import {useIsHydrating} from '../hooks/useIsHydrating';import {VisuallyHidden} from '../VisuallyHidden';-import {useDevWarning} from '../hooks/useDevWarning';import {warnOnce} from '../utils/devWarning';import type {SizeValue} from '../utils/types';import {BaseTypeahead} from '../Typeahead/BaseTypeahead';@@ -335,20 +334,6 @@ export interface TokenizerProps<T extends SearchableItem> extends Omit<ref?: React.Ref<HTMLInputElement>;/** Imperative handle ref for focus/blur control. */handleRef?: React.Ref<TokenizerHandle>;- /**- * Experimental options, outside the stable compatibility promise: anything- * in this object may change or be removed in a patch release.- * @experimental- */- experimental?: {- /**- * The earlier spelling of `presentation`, with the same values. The- * top-level `presentation` wins when both are set.- * @experimental- * @deprecated Use the stable `presentation` prop.- */- presentation?: TokenizerPresentation;- };}/** How Tokenizer presents its choices; see `TokenizerProps.presentation`. */@@ -792,8 +777,7 @@ export function Tokenizer<T extends SearchableItem>({ref,handleRef,onKeyDown,- presentation: presentationProp,- experimental,+ presentation = 'adaptive',id: idProp,'aria-describedby': ariaDescribedByProp,'aria-labelledby': ariaLabelledByProp,@@ -827,13 +811,6 @@ export function Tokenizer<T extends SearchableItem>({// `adaptive` resolves through the policy the selection controls share. An// open sheet keeps its presentation until it closes. A resolution change// during a task does not replace the open surface.- const presentation =- presentationProp ?? experimental?.presentation ?? 'adaptive';- useDevWarning(- 'Tokenizer',- '`presentation` and `experimental.presentation` are both set; `presentation` wins. Remove `experimental.presentation`.',- presentationProp !== undefined && experimental?.presentation !== undefined,- );const resolvedPresentation = useAdaptivePresentation(presentation);const [isSheetOpen, setIsSheetOpen] = useState(false);// Latched for the sheet's lifetime: a sheet stays presented after it closesdiff --git a/packages/core/src/Tokenizer/TokenizerBottomSheet.test.tsx b/packages/core/src/Tokenizer/TokenizerBottomSheet.test.tsxindex 47333b3a80..a1a284f6a7 100644--- a/packages/core/src/Tokenizer/TokenizerBottomSheet.test.tsx+++ b/packages/core/src/Tokenizer/TokenizerBottomSheet.test.tsx@@ -192,38 +192,11 @@ describe('Tokenizer presentation (FR16)', () => {it('keeps the inline combobox with presentation="popover" on a compact coarse-pointer screen', () => {stubMatchMedia(() => true);- const {unmount} = render(<Harness presentation="popover" />);+ render(<Harness presentation="popover" />);expect(screen.getByRole('combobox')).toBeInTheDocument();expect(screen.queryByRole('button', {name: 'Tags'}),).not.toBeInTheDocument();- unmount();- // An empty experimental object leaves the default in place.- render(plain({experimental: {}}));- expect(screen.queryByRole('combobox')).not.toBeInTheDocument();- });-- it('still honors the deprecated experimental.presentation, and presentation wins over it with one development warning', () => {- const warn = vi.spyOn(console, 'warn').mockImplementation(() => {});- const {unmount} = render(- plain({experimental: {presentation: 'bottom-sheet'}}),- );- expect(screen.queryByRole('combobox')).not.toBeInTheDocument();- expect(openTrigger()).toBeInTheDocument();- expect(warn).not.toHaveBeenCalled();- unmount();- render(- plain({- presentation: 'popover',- experimental: {presentation: 'bottom-sheet'},- }),- );- expect(screen.getByRole('combobox')).toBeInTheDocument();- expect(warn).toHaveBeenCalledTimes(1);- expect(String(warn.mock.calls[0][0])).toContain(- '`presentation` and `experimental.presentation` are both set',- );- warn.mockRestore();});it('forces the sheet trigger for bottom-sheet on every device', async () => {