An open source design system that's fully customizable and agent ready
TypeScript
spec(AST-085): disabled controls stay focusable (#7793)
Cindy Zhang7b6691327e74
diff --git a/docs/families/buttons.md b/docs/families/buttons.mdindex 4dc2de7a56..f4b666c03d 100644--- a/docs/families/buttons.md+++ b/docs/families/buttons.md@@ -115,9 +115,8 @@ Membership follows public responsibility, not an import of Button or a renderedotherwise. Button's `href` mode is the explicit navigation variation and alsofollows `family:navigation-destinations`.- **FR3 — Disabled means non-operable.** A disabled member MUST NOT invoke its- callback or Action. When a disabled reason requires focus, the component MAY use- focusable `aria-disabled` semantics while still blocking activation. A group- disabled state overrides member availability.+ callback or Action. Disabled members stay focusable and follow+ `spec:AST-085`. A group disabled state overrides member availability.- **FR4 — Pending feedback preserves purpose and geometry.** Where a memberexposes loading or an Action, pending work MUST set `aria-busy`, keep thecontrol's dimensions stable, and present a Spinner without changing the@@ -230,7 +229,7 @@ and any later fill or outline treatment requires separate visual review.| Contract | Verification | Representative members and states | Mutation or failure expectation || --------- | ----------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------ |-| FR1–FR3 | role/name, keyboard, callback, disabled, and disabled-reason tests | text Button, IconButton, ToggleButton, link mode, member/group disabled | a member loses its name, keyboard path, or invokes while disabled |+| FR1–FR3 | role/name, keyboard, callback, disabled, and disabled-reason tests; native-disabled assertions pending conformance (`spec:AST-085`) | text Button, IconButton, ToggleButton, link mode, member/group disabled | a member loses its name, keyboard path, or invokes while disabled || FR4–FR6 | `ToggleButton.test.tsx`: callback/Action order and cancellation, callback-only no-pending path, Action-only settlement, and optimistic re-click tests | standalone ToggleButton with either/both callbacks; Button fire-once Action | callback is dropped, an empty Action reports busy, cancellation is bypassed, or stale state wins || FR7 | unit plus real-browser geometry checks | all sizes; text/icon-only; pressed/unpressed; loading | family heights diverge, icon-only stops being square, or state shifts outer size || FR8–FR10 | data attribute, theme metadata, and computed-shadow tests | standalone Button/IconButton/ToggleButton; connected and spaced groups; every elevation tier | shadow lands on the wrong box, state changes depth, or public/theme/rendered values disagree |diff --git a/docs/families/input-fields.md b/docs/families/input-fields.mdindex f3bc0f523c..8997a81a1f 100644--- a/docs/families/input-fields.md+++ b/docs/families/input-fields.md@@ -158,8 +158,9 @@ another implementation helper.capabilities rather than a permanent allowlist. Family membership or contextconsumption alone is insufficient.- **FR4 — Disabled reasons remain reachable where supported.** When a member- exposes `disabledMessage`, the inactive field remains focusable enough to- expose the reason while editing, selection, and activation stay blocked.+ exposes `disabledMessage`, the inactive field remains focusable+ (`spec:AST-085`) and exposes the reason while editing, selection, and+ activation stay blocked.Components without that public concept are not required to add it.- **FR5 — Input loading describes the value, not supporting data.** Where amember exposes `isLoading`, it means the field value is resolving or beingdiff --git a/docs/specs/AST-011/spec.md b/docs/specs/AST-011/spec.mdindex f8dd1e31c7..bafbebd7bb 100644--- a/docs/specs/AST-011/spec.md+++ b/docs/specs/AST-011/spec.md@@ -133,8 +133,8 @@ pointer and keyboard opening are blocked. The implicit listbox popup describesthe widget's selection capability; it does not promise that every state can openit.-Rejected: mapping this state to `isDisabled`, because disabled values are dimmed,-removed from the tab order by default, and excluded from form submission.+Rejected: mapping this state to `isDisabled`, because disabled values are dimmed+and excluded from form submission.## Open questionsdiff --git a/docs/specs/AST-085-focusable-disabled/spec.md b/docs/specs/AST-085-focusable-disabled/spec.mdnew file mode 100644index 0000000000..bf2a461c82--- /dev/null+++ b/docs/specs/AST-085-focusable-disabled/spec.md@@ -0,0 +1,184 @@+---+schema_version: 4+template_version: 2+kind: system-spec+id: spec:AST-085+authority: current+archive_reason: null+superseded_by: null+approved_by: cixzhang+approved_at: 2026-10-21+phase: accepted+owners: [cixzhang]+affects_architecture: [architecture:interaction-modality]+affects_families: [family:buttons, family:input-fields]+affects_contributing: []+affects_consumer_docs:+ [+ Button,+ ButtonGroup,+ IconButton,+ ClickableCard,+ Collapsible,+ CheckboxInput,+ CheckboxList,+ DateInput,+ DateRangeInput,+ DateTimeInput,+ FileInput,+ MultiSelector,+ NumberInput,+ PowerSearch,+ RadioList,+ RichTextEditor,+ SegmentedControl,+ Selector,+ Slider,+ Switch,+ TextArea,+ TextInput,+ TimeInput,+ Tokenizer,+ Typeahead,+ BaseTypeahead,+ CommentPin,+ useInteractiveRole,+ useIndicatorFocusRing,+ useMenuPress,+ ]+---++# Focusable disabled controls system spec++## Intent++Keyboard and screen-reader users can always reach a disabled control. They can+find it, hear that it is disabled, and read why when a reason exists. They never+lose their place when the control they are on becomes disabled.++Builders keep using `isDisabled`. Astryx components turn it into a focusable,+non-operable control. No component renders the native `disabled` attribute.++## Non-goals++- Which items arrow keys visit inside a composite widget (listbox, menu, grid,+ tablist, roving group). The composite's own record decides that.+- Read-only. `spec:AST-011` keeps read-only distinct from disabled.+- Disabled paint, tokens, and theme states. They keep their current owners.+- Elements a caller renders inside an Astryx slot. The caller owns their+ attributes.+- Equivalent internal implementations remain valid when they satisfy this+ contract.++## Requirements++- **FR1 — Disabled controls stay focusable.** A component MUST NOT put the+ native `disabled` attribute on any element it renders. A disabled control+ exposes `aria-disabled="true"` and keeps the focus order it has when enabled:+ a tab stop stays a tab stop, and an element with `tabIndex={-1}` stays out of+ the tab order.+- **FR2 — Disabled blocks every change.** A disabled control MUST NOT change its+ value, activate, navigate, open a surface, or invoke a callback or Action.+ This covers pointer, touch, Enter, Space, typing, paste, drop, drag, wheel,+ increment, and selection paths.+- **FR3 — Disabled values are not submitted.** A disabled field contributes no+ value to form submission and does not block submission through constraint+ validation. This matches native `disabled` form behavior.+- **FR4 — Becoming disabled keeps focus.** A control that becomes disabled while+ it holds focus keeps focus. A component MAY instead move focus, before the+ change, to a destination its own record names inside the same component. When+ a component removes a focused control, that component's record names the+ destination.+- **FR5 — Disabled state is announced.** The disabled state is exposed to+ assistive technology on the focusable element itself, together with its+ accessible name and any description or disabled reason. When a focused+ control becomes disabled, the change is exposed on that element; whether it is+ spoken follows `spec:AST-009`.+- **FR6 — Disabled stays visibly inert.** Disabled paint applies to the+ disabled state. A control that is busy but not disabled keeps its pending+ treatment (`family:buttons` FR4), even though it also exposes+ `aria-disabled`. Hover, pressed, and drag affordances MUST+ NOT appear. The focus indicator still appears under keyboard modality+ (`architecture:interaction-modality` INV1, INV5).+- **FR7 — Group disablement follows the same rule.** Members disabled by a group+ or form-level default follow FR1–FR6.++### Platform support++- Supported feature/engine floor: the package's supported browsers.+- Unsupported behavior: none. The rule uses standard ARIA and event handling.+- Browser evidence: keyboard focus order and blocked activation need real+ browser checks; FR5 needs accessibility-tree evidence. Spoken output follows+ `spec:AST-009` only when a claim depends on it.++## Current-state impact++- `family:buttons` FR3 changes from "MAY use focusable `aria-disabled`" to+ "follows `spec:AST-085`". Button already does this for busy and tooltip cases.+- `family:input-fields` FR4 is satisfied for every member. "Focusable enough"+ becomes "focusable".+- `component:DateRangeInput` AR3 and its disabled-preset state, and+ `component:Tokenizer`'s disabled state and verification, follow this record+ instead of native `disabled`. Their tests that assert native disabled are+ pending conformance.+- `component:Slider` AR1: a disabled thumb without a message gains a Tab stop;+ its disabled-thumb tests are pending conformance.+- `component:Selector`: a disabled trigger with a reason keeps its Tab stop, as+ every disabled trigger now does.+- Consumer docs that describe disabled controls as natively disabled, not+ focusable, out of the tab order, dropping focus, or swallowing the events an+ external Tooltip needs change with conformance work. The record's+ `affects_consumer_docs` list names each one.+- `BaseTypeahead`'s public `isFocusableDisabled` has no remaining effect: every+ disabled input is focusable (FR1), and Enter cannot select while disabled+ (FR2). It stays accepted until a public-API change under `spec:AST-002`+ removes it.+- `useIndicatorFocusRing`: its `isDisabled` input suppresses the keyboard focus+ ring. Under FR6 a focused disabled control still shows it.+- `family:buttons` and `component:Tokenizer` tests that assert native disabled+ are pending conformance.+- Draft records for ClickableCard, BaseTypeahead, CheckboxInput, ChatComposer,+ and CommentPin describe native `disabled` as observed behavior; they change+ with conformance work.+- `spec:AST-011` DEC-1's rejected line no longer says disabled values leave the+ tab order.+- `spec:AST-011` FR5 stays true: disabled focus, submission, and paint still win+ over read-only.+- Components that render native `disabled` today switch to the FR1 shape. Text+ fields use read-only plus change guards, as TextInput does with a disabled+ reason. Fields with a form value drop it from submission (FR3).+- Pagination, Calendar, Lightbox, and the touch date pickers stop dropping focus+ to the page body at their boundaries (FR4).+- Consumers who select disabled controls with `:disabled`, query them with+ `toBeDisabled()`, or rely on disabled controls being skipped by Tab see a+ change. Release notes name it.++## Verification++| Contract | Verification | Representative states | Mutation or failure expectation |+| -------- | ------------------------------------------------------ | ----------------------------------------------------------------------- | ---------------------------------------------------------------- |+| FR1 | Shared test over every component's disabled story | Button, text field, checkbox, switch, selector, slider, group-disabled | Any rendered `disabled` attribute, or a changed tab order, fails |+| FR2 | Per-component keyboard, pointer, paste, and drop tests | Each change path the component supports | A value change, activation, navigation, or callback fails |+| FR3 | Form submission tests reading `FormData` | Disabled text, checkbox, selector, required-and-disabled field | A submitted disabled value, or a blocked submit, fails |+| FR4 | Real-browser focus-transition checks | Last Pagination page, Calendar max month, last Lightbox item, group off | Focus on the document body fails |+| FR5 | Accessibility-tree checks | Focused disabled control with and without a disabled reason | Missing disabled state, name, or reason fails |+| FR6 | Real-browser computed-style checks | Disabled at rest, hover, pressed, keyboard focus | Hover or pressed paint, or a missing focus indicator, fails |++## Decision log++### DEC-1 — Disabled controls are focusable; native `disabled` is not used++**Reference:** `spec:AST-085/DEC-1`+**Decider:** cixzhang, 2026-10-21++Native `disabled` removes a control from focus. Keyboard users then cannot find+it, cannot read why it is unavailable, and lose their place when the control+they are on becomes disabled. One focusable shape for every disabled control+removes all three failures, and components keep the same `isDisabled` API.++Rejected: moving focus to a component-chosen fallback when a control becomes+disabled — every component needs its own destination, and focus still jumps.++## Open questions++None.diff --git a/packages/core/src/DateRangeInput/DateRangeInput.spec.md b/packages/core/src/DateRangeInput/DateRangeInput.spec.mdindex 34305b8795..142dc7613b 100644--- a/packages/core/src/DateRangeInput/DateRangeInput.spec.md+++ b/packages/core/src/DateRangeInput/DateRangeInput.spec.md@@ -90,12 +90,12 @@ preset-list anatomy and its additive theming surface.### Representative states-| State | Required invariant | Allowed variation |-| ----------------- | ------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------- |-| No presets | No preset group or preset-button target renders. | Calendar configuration |-| Presets, no match | Every button carries the preset target with no selected state. | Preset count and labels |-| Applied preset | The matching button carries `aria-current="true"` and the target's selected state. | Selected range |-| Disabled preset | A preset that violates an endpoint date constraint or a range-span constraint is natively disabled and carries the target's disabled state. | Constraint source |+| State | Required invariant | Allowed variation |+| ----------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------- |+| No presets | No preset group or preset-button target renders. | Calendar configuration |+| Presets, no match | Every button carries the preset target with no selected state. | Preset count and labels |+| Applied preset | The matching button carries `aria-current="true"` and the target's selected state. | Selected range |+| Disabled preset | A preset that violates an endpoint date constraint or a range-span constraint is disabled per `spec:AST-085` and carries the target's disabled state. | Constraint source |### Transformation and precedence order@@ -120,8 +120,8 @@ No new performance or resource constraint is introduced.- **AR2 — Current state.** The applied preset remains exposed with`aria-current="true"`; theme state reflection is additive.- **AR3 — Disabled state.** A preset that violates an endpoint date constraint or- a range-span constraint remains natively disabled; theme state reflection does- not replace that behavior.+ a range-span constraint is disabled and stays focusable (`spec:AST-085`); theme+ state reflection does not replace that behavior.## Design relationships@@ -172,11 +172,11 @@ No new performance or resource constraint is introduced.## Verification map-| Contract | Verification | Representative states | Mutation or failure expectation | Audit section |-| ------------------- | -------------------------------------------------------------------------- | ---------------------------------------------------------------------- | --------------------------------------------------------------------------- | ------------------------------ |-| FR1, FR2, AR1–AR3 | `DateRangeInput.test.tsx` | no match, applied preset, endpoint-invalid preset, span-invalid preset | Semantics or state attributes disappear | `audit:DateRangeInput/presets` |-| FR3, FR4 | `DateRangeInput.test.tsx`, `themingTargets.test.ts`, generated probe theme | group target, selected button, disabled button | Target class/state is missing, undocumented, or placed on the wrong element | `audit:DateRangeInput/theming` |-| Theming anatomy map | `scripts/check-knowledge.mjs` | all documented anatomy | Target ownership or anatomy names drift | `audit:DateRangeInput/theming` |+| Contract | Verification | Representative states | Mutation or failure expectation | Audit section |+| ------------------- | --------------------------------------------------------------------------------- | ---------------------------------------------------------------------- | --------------------------------------------------------------------------- | ------------------------------ |+| FR1, FR2, AR1–AR3 | `DateRangeInput.test.tsx`; disabled-preset focusability (AR3) pending conformance | no match, applied preset, endpoint-invalid preset, span-invalid preset | Semantics or state attributes disappear | `audit:DateRangeInput/presets` |+| FR3, FR4 | `DateRangeInput.test.tsx`, `themingTargets.test.ts`, generated probe theme | group target, selected button, disabled button | Target class/state is missing, undocumented, or placed on the wrong element | `audit:DateRangeInput/theming` |+| Theming anatomy map | `scripts/check-knowledge.mjs` | all documented anatomy | Target ownership or anatomy names drift | `audit:DateRangeInput/theming` |## Decision logdiff --git a/packages/core/src/Selector/Selector.spec.md b/packages/core/src/Selector/Selector.spec.mdindex 050ce75c12..2914bd6bdc 100644--- a/packages/core/src/Selector/Selector.spec.md+++ b/packages/core/src/Selector/Selector.spec.md@@ -163,17 +163,17 @@ These requirements describe shipped behavior on current `main`.### Representative states-| State | Required invariant | Allowed variation |-| ------------------------ | ----------------------------------------------------------------------------------------- | ---------------------------------------------------------- |-| closed with no value | Label and placeholder identify the field | Consumer placeholder text |-| closed with a value | Selected option is represented in the trigger | Custom `renderValue` content |-| pointer / popover | Anchored surface exposes the listbox without modal-dialog semantics | Default or explicit placement |-| compact coarse pointer | BottomSheet exposes a modal dialog containing the listbox | Default or explicit `adaptive`, or explicit `bottom-sheet` |-| searching | Visible options, keyboard navigation, and announced result count use one filter | Consumer search and empty text |-| loading | Trigger is busy; empty and no-results output is suppressed | Consumer loading duration |-| disabled with reason | Trigger remains focusable enough to expose the reason while activation stays blocked | Consumer reason text |-| read-only | Value stays focusable and submittable; menu, clear, and disclosure affordances are absent | Value rendering, status, and busy presentation |-| selected/unselected rows | Empty marks consume no width; visible marks retain space at the logical edge | State-dependent label position/width and themed indicators |+| State | Required invariant | Allowed variation |+| ------------------------ | ------------------------------------------------------------------------------------------- | ---------------------------------------------------------- |+| closed with no value | Label and placeholder identify the field | Consumer placeholder text |+| closed with a value | Selected option is represented in the trigger | Custom `renderValue` content |+| pointer / popover | Anchored surface exposes the listbox without modal-dialog semantics | Default or explicit placement |+| compact coarse pointer | BottomSheet exposes a modal dialog containing the listbox | Default or explicit `adaptive`, or explicit `bottom-sheet` |+| searching | Visible options, keyboard navigation, and announced result count use one filter | Consumer search and empty text |+| loading | Trigger is busy; empty and no-results output is suppressed | Consumer loading duration |+| disabled with reason | Trigger remains focusable (`spec:AST-085`) and exposes the reason; activation stays blocked | Consumer reason text |+| read-only | Value stays focusable and submittable; menu, clear, and disclosure affordances are absent | Value rendering, status, and busy presentation |+| selected/unselected rows | Empty marks consume no width; visible marks retain space at the logical edge | State-dependent label position/width and themed indicators |### Transformation and precedence orderdiff --git a/packages/core/src/Slider/Slider.spec.md b/packages/core/src/Slider/Slider.spec.mdindex acc3f617ab..17552e5d07 100644--- a/packages/core/src/Slider/Slider.spec.md+++ b/packages/core/src/Slider/Slider.spec.md@@ -134,8 +134,8 @@ value-tooltip behavior; AR1 records the keyboard model and its one correction.thumb as one composite control: every thumb is `role="slider"` with anaccessible name (a range names each thumb), `aria-valuemin`, `aria-valuemax`,`aria-valuenow`, `aria-valuetext` when a formatter changes the spoken value,- `aria-orientation`, and `aria-disabled` when disabled; an enabled thumb, and a- disabled thumb that carries a disabled message, is a Tab stop.+ `aria-orientation`, and `aria-disabled` when disabled; every thumb is a Tab+ stop, enabled or disabled (`spec:AST-085`).ArrowUp and ArrowDown step by `step`; on a horizontal track the horizontalarrows follow the track's direction — ArrowRight increases and ArrowLeftdecreases under LTR, and under RTL ArrowLeft increases and ArrowRight@@ -225,15 +225,15 @@ separately listed value tooltip retains Tooltip's target.## Verification map-| Contract | Verification | Representative states | Mutation or failure expectation | Audit section |-| ------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------- |-| FR1 | `Slider.test.tsx` structure, range, and marks suites | Single, range, horizontal, vertical, marks | Removing or misaligning stable parts breaks existing role, position, or mark assertions. | `audit:Slider/anatomy` |-| AR1 | Slider accessibility contract (`internal/a11y-spec`, pending) bound to Slider, in jsdom and Chromium; `Slider.test.tsx` keyboard suites, including "follows the mirrored track under RTL: ArrowLeft increases, ArrowRight decreases, Up/Down unchanged" and "keeps ArrowLeft decreasing on a vertical track under RTL"; the Page, Home/End and Up/Down cases under the contract | Single and range; horizontal LTR and RTL; vertical; disabled; formatted value | A thumb loses its role, name or value properties; an arrow, Page, Home or End key stops stepping or steps against the mirrored track; a range thumb crosses the other | `audit:Slider/accessibility` |-| FR2 | `Slider.test.tsx`, `themingTargets.test.ts`, generated probe theme, and Chromium | Root, horizontal/vertical control, disabled control, track, and thumb | A target class/state is missing, undocumented, or placed outside its owning anatomy. | `audit:Slider/theming` |-| FR3 | Source and consumer-doc review | Filled range, marks, labels, adjacent text value | A missing target is inaccurately documented as present or intentionally permanent. | `audit:Slider/theming` |-| FR4 | Source inspection; focused tests cover label, status, and disabled-reason Tooltip only | Label, status, value tooltip, disabled reason | Shared composition or its accessible association disappears; value-tooltip composition still lacks focused coverage. | `audit:Slider/anatomy` |-| FR5 | Pending: `Slider.test.tsx` change-end cases driven by an owner that renders, clamps, or rejects the emitted value (not yet in the suite) | Single and range; pointer release before and after the owner re-renders; each keyboard step | `onChangeEnd` reports a value the owner did not render, fires more than once per interaction, or skips a completed keyboard step | `audit:Slider/accessibility` |-| Theming anatomy map | `scripts/check-knowledge.mjs` | Canonical anatomy and four current local targets | Missing, extra, prefixed, stale, or unclaimed mappings fail repository validation. | `audit:Slider/theming` |+| Contract | Verification | Representative states | Mutation or failure expectation | Audit section |+| ------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------- |+| FR1 | `Slider.test.tsx` structure, range, and marks suites | Single, range, horizontal, vertical, marks | Removing or misaligning stable parts breaks existing role, position, or mark assertions. | `audit:Slider/anatomy` |+| AR1 | Slider accessibility contract (`internal/a11y-spec`, pending) bound to Slider; disabled-thumb Tab stop pending conformance; in jsdom and Chromium; `Slider.test.tsx` keyboard suites, including "follows the mirrored track under RTL: ArrowLeft increases, ArrowRight decreases, Up/Down unchanged" and "keeps ArrowLeft decreasing on a vertical track under RTL"; the Page, Home/End and Up/Down cases under the contract | Single and range; horizontal LTR and RTL; vertical; disabled; formatted value | A thumb loses its role, name or value properties; an arrow, Page, Home or End key stops stepping or steps against the mirrored track; a range thumb crosses the other | `audit:Slider/accessibility` |+| FR2 | `Slider.test.tsx`, `themingTargets.test.ts`, generated probe theme, and Chromium | Root, horizontal/vertical control, disabled control, track, and thumb | A target class/state is missing, undocumented, or placed outside its owning anatomy. | `audit:Slider/theming` |+| FR3 | Source and consumer-doc review | Filled range, marks, labels, adjacent text value | A missing target is inaccurately documented as present or intentionally permanent. | `audit:Slider/theming` |+| FR4 | Source inspection; focused tests cover label, status, and disabled-reason Tooltip only | Label, status, value tooltip, disabled reason | Shared composition or its accessible association disappears; value-tooltip composition still lacks focused coverage. | `audit:Slider/anatomy` |+| FR5 | Pending: `Slider.test.tsx` change-end cases driven by an owner that renders, clamps, or rejects the emitted value (not yet in the suite) | Single and range; pointer release before and after the owner re-renders; each keyboard step | `onChangeEnd` reports a value the owner did not render, fires more than once per interaction, or skips a completed keyboard step | `audit:Slider/accessibility` |+| Theming anatomy map | `scripts/check-knowledge.mjs` | Canonical anatomy and four current local targets | Missing, extra, prefixed, stale, or unclaimed mappings fail repository validation. | `audit:Slider/theming` |The focused Slider suite asserts the `slider-control` target's orientation anddisabled state. Source/metadata guards cover all four target declarations. Thediff --git a/packages/core/src/Tokenizer/Tokenizer.spec.md b/packages/core/src/Tokenizer/Tokenizer.spec.mdindex 907dd9ba22..a021a59ff0 100644--- a/packages/core/src/Tokenizer/Tokenizer.spec.md+++ b/packages/core/src/Tokenizer/Tokenizer.spec.md@@ -166,23 +166,23 @@ pending.### Representative states-| State | Required invariant | Allowed variation |-| ------------------------------------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- |-| Empty field | The mounted inner input is the opening control; a full-width menu stays aligned to the outer field. | Placeholder and bootstrap results may vary. |-| Focus bootstrap, choices remain | A committed selection is removed from the displayed cohort; the input and popup remain active on the next valid remaining choice. | Internal cohort storage and projection may vary. |-| Focus bootstrap, selected choice was last | The nearest preceding remaining choice becomes active without changing the displayed order. | Option identity representation may vary. |-| Focus bootstrap, no choices or max reached | The popup closes and no active descendant remains; pending work cannot reopen it. | Source cancellation mechanism may vary. |-| Source pending or replaced | Busy semantics identify pending work; stale work cannot add choices or reopen a terminal popup. | A settled current cohort may be retained internally. |-| Disabled | No choice can be committed; an open popup closes and clears its active descendant while disabled-reason focusability remains available where configured. | Native-disabled or focusable-disabled representation follows current Tokenizer behavior. |-| One or many tokens | The same input remains after tokens and moves with wrapping; full-width placement does not follow that movement. | Token labels, wrapping rows, and custom content may vary. |-| At `maxEntries` | The input identity remains mounted but its zero-width/hidden box is unusable as geometry; opening falls back to the outer field. | Search remains unavailable under current behavior. |-| Token removal or clear | Input identity survives and current refocus behavior remains. | Token count and input position change. |-| `unfocusedInline` | Blurred OverflowList and focused direct-token layouts resolve the same live input identity; a collapsed input is not used as geometry. | Visible token count may vary with width. |-| `unfocusedLayer`, focused | The live wrapper/input may be reparented into the context layer without descriptor churn. | Corrective portal location may vary. |-| `unfocusedLayer`, unfocused | The hidden-layer input is unusable for a new open; the ordinary-flow outer-field fallback is used. | Placeholder token count may vary. |-| Default or custom token edit | The actual activated token/control is captured before edit state changes; if no usable descendant control exists, input then outer-field fallback applies. | Custom token markup may vary. |-| LTR or RTL | Physical proximity selects an edge only for a narrower surface; logical start wins ties and full-width placement. | Collision may move the final rendered surface. |-| SSR, hydration, or unmount | No server geometry read occurs; first client open prepares normally; unmount clears identities and pending show work. | Hydration timing may vary. |+| State | Required invariant | Allowed variation |+| ------------------------------------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------- |+| Empty field | The mounted inner input is the opening control; a full-width menu stays aligned to the outer field. | Placeholder and bootstrap results may vary. |+| Focus bootstrap, choices remain | A committed selection is removed from the displayed cohort; the input and popup remain active on the next valid remaining choice. | Internal cohort storage and projection may vary. |+| Focus bootstrap, selected choice was last | The nearest preceding remaining choice becomes active without changing the displayed order. | Option identity representation may vary. |+| Focus bootstrap, no choices or max reached | The popup closes and no active descendant remains; pending work cannot reopen it. | Source cancellation mechanism may vary. |+| Source pending or replaced | Busy semantics identify pending work; stale work cannot add choices or reopen a terminal popup. | A settled current cohort may be retained internally. |+| Disabled | No choice can be committed; an open popup closes and clears its active descendant while disabled-reason focusability remains available where configured. | The disabled representation follows `spec:AST-085`. |+| One or many tokens | The same input remains after tokens and moves with wrapping; full-width placement does not follow that movement. | Token labels, wrapping rows, and custom content may vary. |+| At `maxEntries` | The input identity remains mounted but its zero-width/hidden box is unusable as geometry; opening falls back to the outer field. | Search remains unavailable under current behavior. |+| Token removal or clear | Input identity survives and current refocus behavior remains. | Token count and input position change. |+| `unfocusedInline` | Blurred OverflowList and focused direct-token layouts resolve the same live input identity; a collapsed input is not used as geometry. | Visible token count may vary with width. |+| `unfocusedLayer`, focused | The live wrapper/input may be reparented into the context layer without descriptor churn. | Corrective portal location may vary. |+| `unfocusedLayer`, unfocused | The hidden-layer input is unusable for a new open; the ordinary-flow outer-field fallback is used. | Placeholder token count may vary. |+| Default or custom token edit | The actual activated token/control is captured before edit state changes; if no usable descendant control exists, input then outer-field fallback applies. | Custom token markup may vary. |+| LTR or RTL | Physical proximity selects an edge only for a narrower surface; logical start wins ties and full-width placement. | Collision may move the final rendered surface. |+| SSR, hydration, or unmount | No server geometry read occurs; first client open prepares normally; unmount clears identities and pending show work. | Hydration timing may vary. |### Transformation and precedence order@@ -282,8 +282,8 @@ consumer docs, and Changeset together. Exact-head browser evidence must exercisenext remaining option active.2. The fallback when the committed option was last, plus terminal closure for noremaining choice and `maxEntries`.-3. Escape, Tab or outside focus departure, transition to native-disabled and- focusable-disabled states, and pending or stale source settlement without a+3. Escape, Tab or outside focus departure, transition to the disabled state,+ and pending or stale source settlement without alater reopen.4. The unchanged path when `hasEntriesOnFocus` is off and direct single-selectBaseTypeahead selection still closes.@@ -297,15 +297,15 @@ 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 | 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` |-| 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` |+| 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