@astryxdesign/core 0.7.1-canary.afd7e55 → 0.7.1-canary.b24d357

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@astryxdesign/core",
3
- "version": "0.7.1-canary.afd7e55",
3
+ "version": "0.7.1-canary.b24d357",
4
4
  "displayName": "Astryx Core",
5
5
  "description": "The component library. Accessible, themeable React components with built-in spacing, dark mode, and StyleX styling.",
6
6
  "author": "Meta Open Source",
@@ -787,8 +787,8 @@
787
787
  "react-dom": ">=19.0.0"
788
788
  },
789
789
  "devDependencies": {
790
- "@astryxdesign/a11y-spec": "0.7.1-canary.afd7e55",
791
- "@astryxdesign/cli": "0.7.1-canary.afd7e55",
790
+ "@astryxdesign/a11y-spec": "0.7.1-canary.b24d357",
791
+ "@astryxdesign/cli": "0.7.1-canary.b24d357",
792
792
  "@babel/cli": "^7.29.7",
793
793
  "@babel/core": "^7.29.7",
794
794
  "@babel/preset-react": "^7.29.7",
@@ -33,15 +33,15 @@ system_specs: [spec:AST-002, spec:AST-029]
33
33
 
34
34
  ## Contract at a glance
35
35
 
36
- | Area | Contract |
37
- | ----------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
38
- | Public contract | No API or default change. ChatComposerInput remains the optional rich editing surface for ChatComposer, with controlled draft, trigger, history, paste, file, and imperative seams. |
39
- | Behavior | Every edit path keeps the serialized draft observable. Files pasted or dropped reach `onFiles`; consumer `onPaste` receives first refusal over plain text before optional paste-as-token conversion. |
40
- | End-user impact | Dictated or otherwise programmatically inserted text becomes sendable and does not remain hidden behind the empty placeholder; dropped files reach the product attachment flow. |
41
- | Builder impact | Existing props, callback signatures, defaults, exports, and token serialization stay unchanged. Builders relying on the documented `onPaste` and `onFiles` paths now receive those callbacks consistently. |
42
- | Compatibility/readiness | Patch-compatible correction to released behavior. This observational record adds no public concept or visual decision. |
43
- | Review checks | Reject an edit path that mutates the DOM without updating the serialized draft, a file drop that can navigate away or bypass `onFiles`, a text paste that bypasses consumer interception, or changed submit/token semantics. |
44
- | Governing rules | `architecture:public-component-api/INV1`; `architecture:interaction-modality/INV1–INV4`; `architecture:knowledge-contracts/INV11, INV16`; `spec:AST-002`; `spec:AST-029`; rubric B15. |
36
+ | Area | Contract |
37
+ | ----------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
38
+ | Public contract | ChatComposerInput remains the optional rich editing surface for ChatComposer, with controlled draft, trigger, history, paste, file, and imperative seams. Each trigger definition may opt into multi-word queries with `hasMultiWordQuery`, default `false`. |
39
+ | Behavior | Every edit path keeps the serialized draft observable. Files pasted or dropped reach `onFiles`; consumer `onPaste` receives first refusal over plain text before optional paste-as-token conversion. |
40
+ | End-user impact | Dictated or otherwise programmatically inserted text becomes sendable and does not remain hidden behind the empty placeholder; dropped files reach the product attachment flow. |
41
+ | Builder impact | Existing props, callback signatures, prop defaults, exports, and token serialization are unchanged. Builders relying on the documented `onPaste` and `onFiles` paths receive those callbacks consistently; `hasMultiWordQuery` is the one added optional trigger field. Every trigger receives the trigger-key corrections listed under Compatibility and migration (FR10, FR13, FR15, FR16). |
42
+ | Compatibility/readiness | Patch-compatible. One additive optional trigger field (DEC-1) plus trigger-key corrections that apply to every trigger (FR10, FR13, FR15, FR16); no visual decision. |
43
+ | Review checks | Reject an edit path that mutates the DOM without updating the serialized draft, a file drop that can navigate away or bypass `onFiles`, a text paste that bypasses consumer interception, changed submit/token semantics, a trigger query that alters typed text, a key that picks a row from an earlier trigger query, or a menu that reopens after a send. |
44
+ | Governing rules | `architecture:public-component-api/INV1`; `architecture:interaction-modality/INV1–INV4`; `architecture:knowledge-contracts/INV11, INV16`; `spec:AST-002`; `spec:AST-029`; rubric B15. |
45
45
 
46
46
  This table is a review projection; the body below is authoritative.
47
47
 
@@ -55,9 +55,15 @@ imperative editing handle.
55
55
  ## Compatibility and migration
56
56
 
57
57
  - Released default preserved: yes
58
- - Compatibility class: patch-compatible behavior correction; no public type or default changes
58
+ - Compatibility class: patch-compatible; one additive optional trigger field, no prop default changes, and trigger-key corrections for every trigger
59
59
  - Controlled and composition behavior: unchanged
60
60
  - Migration decision: none
61
+ - Trigger query shape: `hasMultiWordQuery` is an additive optional trigger field; omitting it keeps single-token queries
62
+ - Every trigger, opted in or not, also receives these patch-compatible corrections:
63
+ - FR13, correction: a key never picks a row returned for an earlier query, and a result arriving after a send, clear, pick, or dismissal is discarded instead of reopening the menu.
64
+ - FR15, correction: IME composition keys never pick a row or move the highlighted row.
65
+ - FR16, correction: after Escape, the menu stays hidden while the same query keeps growing instead of reopening on the next keystroke.
66
+ - FR10, correction: a tab before the trigger character is a boundary, like a space or line break.
61
67
 
62
68
  ## Ownership boundary
63
69
 
@@ -77,29 +83,37 @@ imperative editing handle.
77
83
 
78
84
  ## Public concepts
79
85
 
80
- | Concept | Closed values or states | Meaning | Availability by state | Default | Owner | Stability | Invalid-value behavior |
81
- | ------------------ | -------------------------------------------------------------- | ------------------------------------------------------------------------------------------- | ------------------------------- | --------------------------- | ----------------------------- | --------- | --------------------------------------------------------------------- |
82
- | draft storage | DOM-owned; `value` controlled; ChatComposer context controlled | Selects the serialized draft source and observable change channel. | every editor | context or empty DOM | `component:ChatComposerInput` | stable | Explicit `value` wins; unsupported values are rejected by TypeScript. |
83
- | submission | Enter; Shift+Enter; IME Enter; consumer-cancelled Enter | Submits one trimmed non-empty draft only on uncancelled Enter without Shift or composition. | enabled editor | Enter submits | `component:ChatComposerInput` | stable | Empty or composing submission is ignored. |
84
- | trigger menu | omitted; one or more trigger definitions | Opens suggestions at a configured character and inserts text or a serialized token. | when triggers are configured | omitted | `component:ChatComposerInput` | stable | Unknown trigger characters remain ordinary text. |
85
- | history | enabled; disabled | Recalls submitted drafts at text boundaries with ArrowUp and ArrowDown. | when enabled and history exists | enabled | `component:ChatComposerInput` | stable | Mid-text arrow keys retain native caret behavior. |
86
- | text paste | consumer-handled; paste-as-token; plain text | Gives `onPaste` first refusal, then optional token conversion, then inserts plain text. | enabled editor | long-paste token conversion | `component:ChatComposerInput` | stable | A handled callback stops later insertion paths. |
87
- | file intake | pasted; dropped | Prevents browser navigation and passes the files to `onFiles`. | when files are supplied | no callback | `component:ChatComposerInput` | stable | Empty drops do nothing; disabled input does not emit files. |
88
- | imperative editing | insert token; expand token; insert text; focus; get value | Lets composing features such as dictation operate through the editor's owned behavior. | while mounted | none | `component:ChatComposerInput` | stable | Calls without a mounted editor are no-ops or return an empty value. |
86
+ | Concept | Closed values or states | Meaning | Availability by state | Default | Owner | Stability | Invalid-value behavior |
87
+ | ------------------ | -------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- | ------------------------------- | --------------------------- | ----------------------------- | --------- | --------------------------------------------------------------------- |
88
+ | draft storage | DOM-owned; `value` controlled; ChatComposer context controlled | Selects the serialized draft source and observable change channel. | every editor | context or empty DOM | `component:ChatComposerInput` | stable | Explicit `value` wins; unsupported values are rejected by TypeScript. |
89
+ | submission | Enter; Shift+Enter; IME Enter; consumer-cancelled Enter | Submits one trimmed non-empty draft only on uncancelled Enter without Shift or composition. | enabled editor | Enter submits | `component:ChatComposerInput` | stable | Empty or composing submission is ignored. |
90
+ | trigger menu | omitted; one or more trigger definitions | Opens suggestions at a configured character and inserts text or a serialized token. | when triggers are configured | omitted | `component:ChatComposerInput` | stable | Unknown trigger characters remain ordinary text. |
91
+ | trigger query | single-token; multi-word | Sets where an active trigger query ends: at whitespace, or only at a line break or the length bound. | while a trigger is active | single-token | `component:ChatComposerInput` | stable | Omitting `hasMultiWordQuery` keeps single-token queries. |
92
+ | history | enabled; disabled | Recalls submitted drafts at text boundaries with ArrowUp and ArrowDown. | when enabled and history exists | enabled | `component:ChatComposerInput` | stable | Mid-text arrow keys retain native caret behavior. |
93
+ | text paste | consumer-handled; paste-as-token; plain text | Gives `onPaste` first refusal, then optional token conversion, then inserts plain text. | enabled editor | long-paste token conversion | `component:ChatComposerInput` | stable | A handled callback stops later insertion paths. |
94
+ | file intake | pasted; dropped | Prevents browser navigation and passes the files to `onFiles`. | when files are supplied | no callback | `component:ChatComposerInput` | stable | Empty drops do nothing; disabled input does not emit files. |
95
+ | imperative editing | insert token; expand token; insert text; focus; get value | Lets composing features such as dictation operate through the editor's owned behavior. | while mounted | none | `component:ChatComposerInput` | stable | Calls without a mounted editor are no-ops or return an empty value. |
89
96
 
90
97
  ## Behavioral and layout contract
91
98
 
92
- | ID | Candidate invariant | Basis | Draft review state |
93
- | --- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------- | ------------------ |
94
- | FR1 | Every user or imperative edit that changes serialized content MUST update empty state and emit the effective value through the active `onChange` channel. | Shipped `onChange` contract, imperative handle, and ChatDictation callsite. | settled |
95
- | FR2 | Enter without Shift MUST submit one trimmed non-empty draft and clear it unless the event is composing, the trigger menu consumes it, or a consumer prevents default. | Shipped implementation and consumer docs. | verify |
96
- | FR3 | Shift+Enter and mid-text history arrows MUST retain native multiline editing behavior. | Shipped implementation and focused tests. | verify |
97
- | FR4 | `value` supplied directly on ChatComposerInput MUST win over ChatComposer context, while an emitted echo MUST NOT rebuild the DOM or move the caret. | Shipped controlled precedence and regression tests. | verify |
98
- | FR5 | Plain-text paste precedence MUST be consumer `onPaste` → configured/default paste-as-token → plain insertion. | Public callback meaning and objective callback composition. | settled |
99
- | FR6 | File paste and file drop MUST prevent native insertion/navigation and deliver the same ordered `File[]` to `onFiles`; disabled editors MUST NOT emit file callbacks. | Shipped public `onFiles` contract and consumer docs. | settled |
100
- | FR7 | Trigger-menu keyboard handling MUST run before consumer and built-in editor handling; IME composition MUST never submit. | Shipped interaction contract and tests. | verify |
101
- | FR8 | History recall MUST operate only at the draft boundaries and MUST restore the pending draft after stepping past the newest item. | Shipped behavior and tests. | verify |
102
- | FR9 | The root MUST keep forwarding its ref, BaseProps attributes, and styling seams; the imperative handle remains separate in `handleRef`. | Released public API and `architecture:public-component-api`. | verify |
99
+ | ID | Candidate invariant | Basis | Draft review state |
100
+ | ---- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------- | ------------------ |
101
+ | FR1 | Every user or imperative edit that changes serialized content MUST update empty state and emit the effective value through the active `onChange` channel. | Shipped `onChange` contract, imperative handle, and ChatDictation callsite. | settled |
102
+ | FR2 | Enter without Shift MUST submit one trimmed non-empty draft and clear it unless the event is composing, the trigger menu consumes it, or a consumer prevents default. | Shipped implementation and consumer docs. | verify |
103
+ | FR3 | Shift+Enter and mid-text history arrows MUST retain native multiline editing behavior. | Shipped implementation and focused tests. | verify |
104
+ | FR4 | `value` supplied directly on ChatComposerInput MUST win over ChatComposer context, while an emitted echo MUST NOT rebuild the DOM or move the caret. | Shipped controlled precedence and regression tests. | verify |
105
+ | FR5 | Plain-text paste precedence MUST be consumer `onPaste` → configured/default paste-as-token → plain insertion. | Public callback meaning and objective callback composition. | settled |
106
+ | FR6 | File paste and file drop MUST prevent native insertion/navigation and deliver the same ordered `File[]` to `onFiles`; disabled editors MUST NOT emit file callbacks. | Shipped public `onFiles` contract and consumer docs. | settled |
107
+ | FR7 | Trigger-menu keyboard handling MUST run before consumer and built-in editor handling; IME composition MUST never submit. | Shipped interaction contract and tests. | verify |
108
+ | FR8 | History recall MUST operate only at the draft boundaries and MUST restore the pending draft after stepping past the newest item. | Shipped behavior and tests. | verify |
109
+ | FR9 | The root MUST keep forwarding its ref, BaseProps attributes, and styling seams; the imperative handle remains separate in `handleRef`. | Released public API and `architecture:public-component-api`. | verify |
110
+ | FR10 | A trigger activates when its character starts the text or follows a space, a tab, or a line break, and its query runs from after that character to the caret. A no-break space, such as the one after an inserted token, is not a boundary. A single-token query ends at a space, a tab, or a line break. | Shipped trigger detection; DEC-1. | settled |
111
+ | FR11 | A trigger with `hasMultiWordQuery: true` keeps its query through spaces and punctuation. The query ends only at a line break or past an implementation-owned length bound of at least 64 characters; no word count, punctuation list, or termination callback applies. | DEC-1. | settled |
112
+ | FR12 | Ending a trigger query MUST leave the typed text unchanged. Only an explicit pick of a current row replaces the range from the trigger character to the caret. | DEC-1. | settled |
113
+ | FR13 | While a newer search for the active query is pending, Enter without Shift submits the draft as typed and MUST NOT pick a row; no key picks a row returned for an earlier query. Results for a superseded query, or arriving after a pick, dismissal, submission, or the query ending, are discarded, so the menu never reopens over a sent or cleared draft. This applies to every trigger. | DEC-1; reference chat composer behavior. | settled |
114
+ | FR14 | When a multi-word query settles with no matches, the menu is hidden unless the trigger supplies `emptySearchText`. A single-token query with no matches shows the empty message. | DEC-1. | settled |
115
+ | FR15 | Keys pressed during IME composition MUST NOT pick a row or move the highlighted row. | DEC-1; FR7. | settled |
116
+ | FR16 | Escape on a visible menu dismisses it, and the menu stays hidden while the same query keeps growing from the same trigger. | DEC-1. | settled |
103
117
 
104
118
  ### Allowed variation
105
119
 
@@ -115,6 +129,8 @@ imperative editing handle.
115
129
  | typed or imperatively inserted text | Placeholder is absent and the same serialized value is observable to ChatComposer and callbacks. | Draft content. |
116
130
  | controlled update | External value is reflected without corrupting a live caret or treating a stale echo as authoritative. | Parent update timing. |
117
131
  | trigger menu open | Combobox semantics and active option wiring are exposed; menu interaction owns its keys. | Search source and item rendering. |
132
+ | trigger search pending | Enter submits the draft as typed; no earlier query's row can be picked. | Loading copy and source latency. |
133
+ | trigger menu hidden | The editor reports a collapsed combobox and the menu consumes no keys. | Why the menu is hidden. |
118
134
  | file paste or drop | Native insertion/navigation is prevented and files reach `onFiles` once. | File types and product handling. |
119
135
  | disabled | Editing and file callbacks are unavailable and disabled state is exposed. | Product reason and surrounding status. |
120
136
 
@@ -138,19 +154,20 @@ imperative editing handle.
138
154
  - **AR2 — Disabled state.** Disabled editing is exposed with `aria-disabled` and cannot accept content or file callbacks.
139
155
  - **AR3 — Keyboard ownership.** IME, trigger-menu keys, consumer cancellation, Enter submission, and boundary-only history do not steal one another's keys.
140
156
  - **AR4 — Focus visibility.** When composed in ChatComposer, the semantic editor focus owner drives the shell's shared keyboard focus indicator.
157
+ - **AR5 — Collapsed suggestions.** While the menu is hidden, the editor reports `aria-expanded="false"`, exposes no active descendant, and arrow keys, Enter, and Escape reach the editor and its surroundings.
141
158
 
142
159
  ## Design relationships
143
160
 
144
- | Anatomy or state | Design requirement | Representation authority | Hierarchy role | Component contract |
145
- | ---------------- | ---------------------------------- | ------------------------ | -------------- | ------------------ |
146
- | input root | existing themed target | observed implementation | supporting | FR9 |
147
- | editable surface | ordinary composer editing surface | ChatComposer family | prominent | FR1–FR4, AR1–AR4 |
148
- | placeholder | secondary text while empty | current token role | supporting | FR1 |
149
- | trigger menu | delegated Typeahead behavior | Typeahead owner | floating | FR7 |
150
- | inline token | structured Badge or caller content | Badge or caller owner | supporting | AV2 |
161
+ | Anatomy or state | Design requirement | Representation authority | Hierarchy role | Component contract |
162
+ | ---------------- | ---------------------------------- | ------------------------ | -------------- | ------------------- |
163
+ | input root | existing themed target | observed implementation | supporting | FR9 |
164
+ | editable surface | ordinary composer editing surface | ChatComposer family | prominent | FR1–FR4, AR1–AR4 |
165
+ | placeholder | secondary text while empty | current token role | supporting | FR1 |
166
+ | trigger menu | delegated Typeahead behavior | Typeahead owner | floating | FR7, FR10–FR16, AR5 |
167
+ | inline token | structured Badge or caller content | Badge or caller owner | supporting | AV2 |
151
168
 
152
- The existing `chat-composer-input` target remains on the root. This observational
153
- draft does not add a theming target or decide a new visual state.
169
+ The existing `chat-composer-input` target remains on the root. This record does not
170
+ add a theming target or decide a new visual state.
154
171
 
155
172
  ## Family and system relationships
156
173
 
@@ -161,18 +178,37 @@ draft does not add a theming target or decide a new visual state.
161
178
 
162
179
  ## Verification map
163
180
 
164
- | Contract | Verification | Representative states | Mutation or failure expectation | Audit section |
165
- | --------------------- | ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------- | --------------------------------------- |
166
- | FR1, ORD1–ORD2 | focused imperative insertion and controlled-sync tests; `ImperativeInsertion` play | empty → inserted text; controlled echo; external override | Text appears only in the DOM, placeholder remains, callback is stale, or the caret jumps. | `audit:ChatComposerInput/behavior` |
167
- | FR2–FR3, FR7–FR8, AR3 | focused keyboard, IME, trigger, and history tests | Enter; Shift+Enter; composition; cancelled key; boundary and mid-text arrows | A key submits twice, submits during composition, or steals native editing. | `audit:ChatComposerInput/interaction` |
168
- | FR5, ORD4 | focused long-paste interception tests | consumer handled; token conversion; plain insertion | Consumer interception is skipped or multiple insertion paths run. | `audit:ChatComposerInput/behavior` |
169
- | FR6, ORD5, AR2 | focused paste/drop tests and `FileDrop` play | paste; drop; disabled | Files navigate away, insert into the editor, bypass `onFiles`, or emit while disabled. | `audit:ChatComposerInput/behavior` |
170
- | AR1, AR4 | role/name/ARIA tests plus exact-head accessibility and visual gates | textbox; combobox; disabled; keyboard focus | Name, role, multiline, expanded, disabled, or visible focus semantics regress. | `audit:ChatComposerInput/accessibility` |
171
- | FR9 | ref, target, package, and repository checks | ref; BaseProps; xstyle; className; style | Root ownership or a styling seam moves or disappears. | `audit:ChatComposerInput/api` |
181
+ | Contract | Verification | Representative states | Mutation or failure expectation | Audit section |
182
+ | --------------------- | ---------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | --------------------------------------- |
183
+ | FR1, ORD1–ORD2 | focused imperative insertion and controlled-sync tests; `ImperativeInsertion` play | empty → inserted text; controlled echo; external override | Text appears only in the DOM, placeholder remains, callback is stale, or the caret jumps. | `audit:ChatComposerInput/behavior` |
184
+ | FR2–FR3, FR7–FR8, AR3 | focused keyboard, IME, trigger, and history tests | Enter; Shift+Enter; composition; cancelled key; boundary and mid-text arrows | A key submits twice, submits during composition, or steals native editing. | `audit:ChatComposerInput/interaction` |
185
+ | FR10–FR16, AR5 | focused trigger-query and trigger keyboard tests | single-token; multi-word; line break; length bound; pending search; no matches; IME; Escape | A query ends early or alters text, Enter picks an earlier query's row or fails to submit while a search is pending, a late result reopens the menu after a send, or a hidden menu consumes keys. | `audit:ChatComposerInput/interaction` |
186
+ | FR5, ORD4 | focused long-paste interception tests | consumer handled; token conversion; plain insertion | Consumer interception is skipped or multiple insertion paths run. | `audit:ChatComposerInput/behavior` |
187
+ | FR6, ORD5, AR2 | focused paste/drop tests and `FileDrop` play | paste; drop; disabled | Files navigate away, insert into the editor, bypass `onFiles`, or emit while disabled. | `audit:ChatComposerInput/behavior` |
188
+ | AR1, AR4 | role/name/ARIA tests plus exact-head accessibility and visual gates | textbox; combobox; disabled; keyboard focus | Name, role, multiline, expanded, disabled, or visible focus semantics regress. | `audit:ChatComposerInput/accessibility` |
189
+ | FR9 | ref, target, package, and repository checks | ref; BaseProps; xstyle; className; style | Root ownership or a styling seam moves or disappears. | `audit:ChatComposerInput/api` |
172
190
 
173
191
  ## Decision log
174
192
 
175
- No component-local policy decision is created by this observational draft.
193
+ ### DEC-1 — Trigger queries are non-destructive and act only on current results
194
+
195
+ **Reference:** `component:ChatComposerInput/DEC-1`
196
+ **Decider:** `cixzhang`, `2026-10-06`; pending-search Enter, `2026-10-14`
197
+
198
+ Only the caller knows whether its suggestions contain spaces, so multi-word
199
+ queries are a per-trigger opt-in and single-token triggers such as commands keep
200
+ ending at whitespace. A multi-word query never changes what the person typed: it
201
+ lives until a line break or a length bound, and only an explicit pick replaces
202
+ text. Suggestions act only on the current query: while a search is pending, Enter
203
+ sends the message as typed and never picks a row from an earlier query, and
204
+ results that arrive after the send are dropped so the menu never reopens over the
205
+ cleared composer. This matches the reference chat composer, where a message may
206
+ simply start with a trigger. An unmatched multi-word phrase hides the menu instead of
207
+ covering prose with an empty panel.
208
+
209
+ Rejected: word caps, punctuation terminators, or a termination callback; they cut off real names and depend on language.
210
+
211
+ Rejected: holding Enter until a pending search settles; it blocks sending a message that only starts with a trigger.
176
212
 
177
213
  ## Open questions
178
214
 
@@ -181,5 +217,5 @@ None.
181
217
  ## Content boundary
182
218
 
183
219
  This file does not duplicate consumer prop tables, examples, current audit scores,
184
- or visual design rationale. It records shipped behavior and objective corrections
185
- without expanding the public API or deciding a new visual representation.
220
+ or visual design rationale. It records shipped behavior, objective corrections, and
221
+ the trigger-query contract in DEC-1, without deciding a new visual representation.
@@ -16,6 +16,8 @@ verified_by:
16
16
  packages/core/src/Selector/Selector.source-build.test.mjs,
17
17
  packages/core/src/Selector/__tests__/Selector.listbox.a11y.test.tsx,
18
18
  packages/core/src/Selector/__tests__/Listbox.a11y.chromium.spec.ts,
19
+ packages/core/src/Selector/__tests__/Selector.combobox.a11y.test.tsx,
20
+ packages/core/src/Selector/__tests__/Selector.combobox.a11y.chromium.spec.ts,
19
21
  apps/storybook/stories/Selector.stories.tsx,
20
22
  .github/scripts/story-play-guard.js,
21
23
  ]
@@ -329,17 +331,18 @@ new theming target.
329
331
 
330
332
  ## Verification map
331
333
 
332
- | Contract | Verification | Representative states | Mutation or failure expectation | Audit section |
333
- | --------------------- | -------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------- |
334
- | FR1, AR2, AR3 | `Selector.test.tsx` selection, focus, and keyboard suites | closed/open, search/non-search, disabled option | Removing selection wiring, focus movement, or keyboard behavior fails the named interaction tests | `audit:Selector/behavior` |
335
- | FR2 | placement and selected-item geometry tests | default, explicit, RTL, transformed entry | Using the wrong positioning model fails the expected position-area or margin | `audit:Selector/behavior` |
336
- | FR3, AV1 | Focused `Selector.test.tsx` computed-display checks plus guarded Chromium Storybook matrix and stable visual stories | popover/bottom sheet, narrow/wide, start/end, LTR/RTL, selected/unselected, check/radio | Empty output reserves width, visible output collapses, logical placement flips incorrectly, or row content overflows | `audit:Selector/design-rendered` |
337
- | FR4, AR1, AR2 | presentation tests plus `aria-haspopup` source review | pointer, compact coarse pointer, search/non-search | Wrong Popover/dialog roles or focus destinations fail tests; `aria-haspopup` values require source/a11y review | `audit:Selector/accessibility` |
338
- | AR1, AV2 | `Selector.listbox.a11y.test.tsx` and `Listbox.a11y.chromium.spec.ts` against the shared Listbox contract | popover/sheet, flat/grouped, selected/unselected, disabled, search, loading, custom RTL | A new or wider loss of role, listbox/option name, state, or ownership gates; the exact unnamed no-search sheet state remains known debt | `audit:Selector/accessibility` |
339
- | FR5 | loading, empty-state, and live-region tests | empty options, unmatched search, loading | Empty/no-results output appears or is announced while loading | `audit:Selector/behavior` |
340
- | FR6, AR4 | read-only interaction, form, ARIA, and theme-state tests | search/non-search, clearable, open→read-only, disabled precedence | A value changes, popup or edit affordance remains, form value disappears, or read-only semantics are absent | `audit:Selector/accessibility` |
341
- | FR7 | `Selector.test.tsx` press model suite | finger release over another option, finger/mouse release outside, listbox marker | The press option is selected, the listbox takes focus, a finger release outside closes the list, or the stray click selects | `audit:Selector/behavior` |
342
- | source-build contract | `Selector.source-build.test.mjs` | package source compiled by consumer Babel | Moving evaluated StyleX values outside the supported source form fails compilation | `audit:Selector/code-health` |
334
+ | Contract | Verification | Representative states | Mutation or failure expectation | Audit section |
335
+ | ---------------------------------- | -------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------- |
336
+ | FR1, AR2, AR3 | `Selector.test.tsx` selection, focus, and keyboard suites | closed/open, search/non-search, disabled option | Removing selection wiring, focus movement, or keyboard behavior fails the named interaction tests | `audit:Selector/behavior` |
337
+ | FR2 | placement and selected-item geometry tests | default, explicit, RTL, transformed entry | Using the wrong positioning model fails the expected position-area or margin | `audit:Selector/behavior` |
338
+ | FR3, AV1 | Focused `Selector.test.tsx` computed-display checks plus guarded Chromium Storybook matrix and stable visual stories | popover/bottom sheet, narrow/wide, start/end, LTR/RTL, selected/unselected, check/radio | Empty output reserves width, visible output collapses, logical placement flips incorrectly, or row content overflows | `audit:Selector/design-rendered` |
339
+ | FR4, AR1, AR2 | presentation tests plus `aria-haspopup` source review | pointer, compact coarse pointer, search/non-search | Wrong Popover/dialog roles or focus destinations fail tests; `aria-haspopup` values require source/a11y review | `audit:Selector/accessibility` |
340
+ | AR1, AV2 | `Selector.listbox.a11y.test.tsx` and `Listbox.a11y.chromium.spec.ts` against the shared Listbox contract | popover/sheet, flat/grouped, selected/unselected, disabled, search, loading, custom RTL | A new or wider loss of role, listbox/option name, state, or ownership gates; the exact unnamed no-search sheet state remains known debt | `audit:Selector/accessibility` |
341
+ | FR5, FR6, AR1, AR2 (anchored), AR4 | `Selector.combobox.a11y.test.tsx` and `Selector.combobox.a11y.chromium.spec.ts` against the shared Combobox contract | closed, open with active option, read-only, busy, bottom-sheet open, search input with active option | The trigger or search input loses its role/name/state or popup kind, its open popup or active option relationship breaks, or read-only exposes a selection surface; the bottom-sheet trigger's `aria-controls` naming the inner listbox remains exact known debt | `audit:Selector/accessibility` |
342
+ | FR5 | loading, empty-state, and live-region tests | empty options, unmatched search, loading | Empty/no-results output appears or is announced while loading | `audit:Selector/behavior` |
343
+ | FR6, AR4 | read-only interaction, form, ARIA, and theme-state tests | search/non-search, clearable, open→read-only, disabled precedence | A value changes, popup or edit affordance remains, form value disappears, or read-only semantics are absent | `audit:Selector/accessibility` |
344
+ | FR7 | `Selector.test.tsx` press model suite | finger release over another option, finger/mouse release outside, listbox marker | The press option is selected, the listbox takes focus, a finger release outside closes the list, or the stray click selects | `audit:Selector/behavior` |
345
+ | source-build contract | `Selector.source-build.test.mjs` | package source compiled by consumer Babel | Moving evaluated StyleX values outside the supported source form fails compilation | `audit:Selector/code-health` |
343
346
 
344
347
  ## Decision log
345
348
 
@@ -991,7 +991,10 @@ describe('Selector', () => {
991
991
  expect(screen.getByRole('combobox', h)).toBeInTheDocument();
992
992
  });
993
993
 
994
- it('wires the search input as the combobox with activedescendant (comboboxes-4)', async () => {
994
+ // The search input's expanded state, popup relationship, and active option
995
+ // are bound to the shared Combobox contract (Selector.combobox.a11y.test.tsx,
996
+ // search-active); this keeps only the Selector-specific wiring.
997
+ it('moves combobox semantics to the list-autocomplete search input (comboboxes-4)', async () => {
995
998
  const user = userEvent.setup();
996
999
  render(
997
1000
  <Selector
@@ -1008,12 +1011,6 @@ describe('Selector', () => {
1008
1011
  await user.click(triggerBtn);
1009
1012
  const search = screen.getByRole('combobox', h);
1010
1013
  expect(search).toHaveAttribute('aria-autocomplete', 'list');
1011
- expect(search).toHaveAttribute('aria-expanded', 'true');
1012
- expect(search).toHaveAttribute('aria-controls');
1013
- // ArrowDown moves the highlight; the search input reports it via
1014
- // aria-activedescendant (previously silent on the trigger).
1015
- await user.keyboard('{ArrowDown}');
1016
- expect(search).toHaveAttribute('aria-activedescendant');
1017
1014
  });
1018
1015
 
1019
1016
  it('PageDown/PageUp jump the highlight to the last/first filtered option', async () => {
@@ -1352,7 +1349,6 @@ describe('Selector', () => {
1352
1349
  <Selector label="Fruit" options={[]} onChange={() => {}} isLoading />,
1353
1350
  );
1354
1351
  const trigger = screen.getByRole('combobox', {name: 'Fruit'});
1355
- expect(trigger).toHaveAttribute('aria-busy', 'true');
1356
1352
  expect(screen.getByRole('status', {name: 'Loading'})).toBeInTheDocument();
1357
1353
 
1358
1354
  await user.click(trigger);
@@ -0,0 +1,27 @@
1
+ // Copyright (c) Meta Platforms, Inc. and affiliates.
2
+
3
+ /**
4
+ * @file Combobox.a11y.known-failures.ts
5
+ * @input Uses KnownFailure from @astryxdesign/a11y-spec
6
+ * @output Current public-safe Selector Combobox binding failures
7
+ * @position AST-021 debt records; operational ownership remains outside public source.
8
+ */
9
+
10
+ import type {KnownFailure} from '@astryxdesign/a11y-spec';
11
+
12
+ export const SELECTOR_COMBOBOX_KNOWN_FAILURES: ReadonlyArray<KnownFailure> = [
13
+ {
14
+ expectation: 'combobox.popup.relationship',
15
+ binding: 'Selector.trigger',
16
+ state: 'sheet-open',
17
+ evidenceLayer: 'dom',
18
+ failureEquals:
19
+ 'aria-controls does not reference the rendered combobox popup',
20
+ standardsReference:
21
+ 'WAI-ARIA 1.2 combobox: aria-controls refers to the displayed popup element; WCAG 2.2 1.3.1 Info and Relationships (Level A)',
22
+ userImpact:
23
+ 'On touch screens the trigger announces that it opens a dialog, but its controls relationship points past that dialog to the list inside it, so assistive technology that follows the relationship reaches the list without the sheet that hosts it.',
24
+ reason:
25
+ 'The trigger declares the sheet dialog as its popup kind while aria-controls names the inner listbox. Pointing both at one popup changes Selector runtime semantics under AR1, which needs its own decision; this test-only binding records the gap.',
26
+ },
27
+ ];
@@ -0,0 +1,145 @@
1
+ // Copyright (c) Meta Platforms, Inc. and affiliates.
2
+
3
+ /**
4
+ * Explicit Selector states bound to the reusable Combobox contract, plus the
5
+ * states that stay out of it and why.
6
+ */
7
+
8
+ import type {ComboboxStateFacts} from '@astryxdesign/a11y-spec';
9
+
10
+ export interface SelectorComboboxScenario {
11
+ readonly id:
12
+ 'closed' | 'open' | 'read-only' | 'busy' | 'sheet-open' | 'search-active';
13
+ /** `trigger` is the Selector button; `search` is the popup's search input. */
14
+ readonly binding: 'Selector.trigger' | 'Selector.search';
15
+ readonly storyId: string;
16
+ readonly open: boolean;
17
+ /** Move the highlight to the first option from the search input. */
18
+ readonly highlightFirst?: boolean;
19
+ readonly props: {
20
+ readonly isReadOnly?: boolean;
21
+ readonly isLoading?: boolean;
22
+ readonly value?: string;
23
+ readonly presentation?: 'bottom-sheet';
24
+ readonly hasSearch?: boolean;
25
+ };
26
+ readonly facts: ComboboxStateFacts;
27
+ }
28
+
29
+ const baseFacts: ComboboxStateFacts = {
30
+ name: 'Fruit',
31
+ expanded: false,
32
+ popupRole: 'listbox',
33
+ popupVisible: false,
34
+ activeDescendant: false,
35
+ readOnly: false,
36
+ busy: false,
37
+ inertUnderOwnModal: false,
38
+ };
39
+
40
+ export const SELECTOR_COMBOBOX_SCENARIOS: ReadonlyArray<SelectorComboboxScenario> =
41
+ [
42
+ {
43
+ id: 'closed',
44
+ binding: 'Selector.trigger',
45
+ storyId: 'a11y-combobox-pattern--selector-closed',
46
+ open: false,
47
+ props: {},
48
+ facts: baseFacts,
49
+ },
50
+ {
51
+ id: 'open',
52
+ binding: 'Selector.trigger',
53
+ storyId: 'a11y-combobox-pattern--selector-open',
54
+ open: true,
55
+ props: {},
56
+ facts: {
57
+ ...baseFacts,
58
+ expanded: true,
59
+ popupVisible: true,
60
+ activeDescendant: true,
61
+ },
62
+ },
63
+ {
64
+ id: 'read-only',
65
+ binding: 'Selector.trigger',
66
+ storyId: 'a11y-combobox-pattern--selector-read-only',
67
+ open: false,
68
+ props: {isReadOnly: true, value: 'apple'},
69
+ facts: {...baseFacts, readOnly: true},
70
+ },
71
+ {
72
+ id: 'busy',
73
+ binding: 'Selector.trigger',
74
+ storyId: 'a11y-combobox-pattern--selector-busy',
75
+ open: false,
76
+ props: {isLoading: true},
77
+ facts: {...baseFacts, busy: true},
78
+ },
79
+ {
80
+ // AR1: the touch presentation's popup is a modal dialog that contains
81
+ // the listbox, and the trigger declares aria-haspopup="dialog".
82
+ id: 'sheet-open',
83
+ binding: 'Selector.trigger',
84
+ storyId: 'a11y-combobox-pattern--selector-sheet-open',
85
+ open: true,
86
+ props: {presentation: 'bottom-sheet'},
87
+ facts: {
88
+ ...baseFacts,
89
+ expanded: true,
90
+ popupRole: 'dialog',
91
+ popupVisible: true,
92
+ activeDescendant: true,
93
+ // The modal sheet makes the trigger inert, so the browser leaves it
94
+ // out of the accessibility tree until the sheet closes.
95
+ inertUnderOwnModal: true,
96
+ },
97
+ },
98
+ {
99
+ // With hasSearch, focus moves into the popup's search input, which owns
100
+ // the combobox role and reports the highlighted option.
101
+ id: 'search-active',
102
+ binding: 'Selector.search',
103
+ storyId: 'a11y-combobox-pattern--selector-search-active',
104
+ open: true,
105
+ highlightFirst: true,
106
+ props: {hasSearch: true},
107
+ facts: {
108
+ ...baseFacts,
109
+ name: 'Search options',
110
+ expanded: true,
111
+ popupVisible: true,
112
+ activeDescendant: true,
113
+ },
114
+ },
115
+ ];
116
+
117
+ /** Selector states that change a combobox outcome but are not bound here. */
118
+ export const SELECTOR_COMBOBOX_EXCLUSIONS = [
119
+ {
120
+ owner: 'Selector trigger with hasSearch',
121
+ reason:
122
+ 'Editable search mode moves combobox semantics to the popup search input, bound as Selector.search; the trigger is not a combobox in that mode.',
123
+ },
124
+ {
125
+ owner: 'Selector search input inside the bottom sheet',
126
+ reason:
127
+ 'The search input keeps the semantics bound in search-active; the sheet changes only its modal host, which the modal-dialog owner covers.',
128
+ },
129
+ {
130
+ owner: 'Selector interaction suites',
131
+ reason:
132
+ 'Keyboard activation, arrow/Home/End/typeahead movement, Escape, Tab, and selection policy are verified by Selector.test.tsx (AR3); this contract encodes semantics only.',
133
+ },
134
+ {
135
+ owner: 'Disabled and disabledMessage triggers',
136
+ reason:
137
+ 'Availability state belongs to the disabled-state owners; this contract has no disabled expectation.',
138
+ },
139
+ {
140
+ owner:
141
+ 'MultiSelector, Typeahead, Tokenizer, PowerSearch, ComplexSelector, CommandPalette',
142
+ reason:
143
+ 'Later bounded adopters; this first binding is limited to Selector.',
144
+ },
145
+ ] as const;
@@ -0,0 +1,108 @@
1
+ // Copyright (c) Meta Platforms, Inc. and affiliates.
2
+
3
+ /** Chromium accessibility-tree and relationship proof for Selector's Combobox binding. */
4
+
5
+ import {expect, test, type Locator, type Page} from '@playwright/test';
6
+ import {
7
+ blockingResults,
8
+ checkAccessibilitySpec,
9
+ formatFailures,
10
+ unmatchedKnownFailures,
11
+ type BindingResult,
12
+ } from '@astryxdesign/a11y-spec';
13
+ import {createChromiumHarness} from '@astryxdesign/a11y-spec/chromium';
14
+ import {
15
+ DEFAULT_STORYBOOK_DIR,
16
+ serveStorybook,
17
+ type StaticServer,
18
+ } from '@astryxdesign/a11y-spec/storybook';
19
+ import {COMBOBOX_PATTERN} from '@astryxdesign/a11y-spec';
20
+ import {
21
+ SELECTOR_COMBOBOX_SCENARIOS,
22
+ type SelectorComboboxScenario,
23
+ } from './Combobox.a11y.states';
24
+ import {SELECTOR_COMBOBOX_KNOWN_FAILURES} from './Combobox.a11y.known-failures';
25
+
26
+ let storybook: StaticServer;
27
+ const observedResults: BindingResult[] = [];
28
+
29
+ test.beforeAll(async () => {
30
+ storybook = await serveStorybook(
31
+ process.env.ASTRYX_STORYBOOK_DIR ?? DEFAULT_STORYBOOK_DIR,
32
+ );
33
+ });
34
+
35
+ test.afterAll(async () => {
36
+ await storybook?.close();
37
+ expect(
38
+ unmatchedKnownFailures(SELECTOR_COMBOBOX_KNOWN_FAILURES, observedResults),
39
+ ).toEqual([]);
40
+ });
41
+
42
+ async function awaitScenario(
43
+ page: Page,
44
+ scenario: SelectorComboboxScenario,
45
+ ): Promise<void> {
46
+ if (!scenario.open) {
47
+ return;
48
+ }
49
+ await expect(page.getByRole('listbox')).toBeVisible();
50
+ if (scenario.highlightFirst) {
51
+ await expect(
52
+ page.getByRole('combobox', {name: scenario.facts.name}),
53
+ ).toHaveAttribute('aria-activedescendant', /.+/);
54
+ }
55
+ }
56
+
57
+ for (const scenario of SELECTOR_COMBOBOX_SCENARIOS) {
58
+ test(`Selector Combobox contract — ${scenario.id}`, async ({page}) => {
59
+ await page.goto(
60
+ `${storybook.origin}/iframe.html?id=${scenario.storyId}&viewMode=story`,
61
+ {waitUntil: 'load'},
62
+ );
63
+ await awaitScenario(page, scenario);
64
+
65
+ // A modal sheet makes the trigger inert, so find it among hidden nodes too.
66
+ const subject = page.getByRole('combobox', {
67
+ name: scenario.facts.name,
68
+ includeHidden: true,
69
+ });
70
+ if (
71
+ scenario.binding === 'Selector.trigger' &&
72
+ scenario.facts.popupVisible
73
+ ) {
74
+ // AR1: the trigger names the popup kind its presentation renders.
75
+ await expect(subject).toHaveAttribute(
76
+ 'aria-haspopup',
77
+ scenario.facts.popupRole,
78
+ );
79
+ }
80
+ const related: Record<string, Locator> = {};
81
+ if (scenario.facts.popupVisible) {
82
+ related.popup =
83
+ scenario.facts.popupRole === 'dialog'
84
+ ? page.getByRole('dialog', {name: 'Fruit'})
85
+ : page.getByRole('listbox');
86
+ }
87
+ if (scenario.facts.activeDescendant) {
88
+ related['active-descendant'] = page.getByRole('option', {name: 'Apple'});
89
+ }
90
+ const cdp = await page.context().newCDPSession(page);
91
+ const run = await checkAccessibilitySpec({
92
+ spec: COMBOBOX_PATTERN,
93
+ binding: scenario.binding,
94
+ state: scenario.id,
95
+ facts: scenario.facts,
96
+ knownFailures: SELECTOR_COMBOBOX_KNOWN_FAILURES,
97
+ mount: async () => createChromiumHarness({page, cdp, subject, related}),
98
+ });
99
+ observedResults.push(run);
100
+
101
+ expect(formatFailures(blockingResults([run]))).toBe('');
102
+ expect(
103
+ run.results
104
+ .filter(result => result.status === 'unrun')
105
+ .map(result => `${result.expectation}: ${result.detail ?? ''}`),
106
+ ).toEqual([]);
107
+ });
108
+ }
@@ -0,0 +1,126 @@
1
+ // Copyright (c) Meta Platforms, Inc. and affiliates.
2
+
3
+ /** Selector's first binding to the reusable Combobox semantic contract. */
4
+
5
+ import {cleanup, render, screen, waitFor, within} from '@testing-library/react';
6
+ import userEvent from '@testing-library/user-event';
7
+ import {describe, expect, it} from 'vitest';
8
+ import {
9
+ COMBOBOX_PATTERN,
10
+ expectAccessibilitySpec,
11
+ } from '@astryxdesign/a11y-spec';
12
+ import {Selector} from '../Selector';
13
+ import {installListboxDialogStubs} from './Listbox.a11y.dom';
14
+ import {
15
+ SELECTOR_COMBOBOX_EXCLUSIONS,
16
+ SELECTOR_COMBOBOX_SCENARIOS,
17
+ type SelectorComboboxScenario,
18
+ } from './Combobox.a11y.states';
19
+ import {SELECTOR_COMBOBOX_KNOWN_FAILURES} from './Combobox.a11y.known-failures';
20
+
21
+ installListboxDialogStubs();
22
+
23
+ const hidden = {hidden: true} as const;
24
+
25
+ function subjectFor(scenario: SelectorComboboxScenario): HTMLElement {
26
+ return screen.getByRole('combobox', {...hidden, name: scenario.facts.name});
27
+ }
28
+
29
+ describe('Selector Combobox semantic binding', () => {
30
+ it.each(SELECTOR_COMBOBOX_SCENARIOS)('$id', async scenario => {
31
+ await expectAccessibilitySpec({
32
+ spec: COMBOBOX_PATTERN,
33
+ binding: scenario.binding,
34
+ state: scenario.id,
35
+ facts: scenario.facts,
36
+ knownFailures: SELECTOR_COMBOBOX_KNOWN_FAILURES,
37
+ render: async () => {
38
+ render(
39
+ <Selector
40
+ label="Fruit"
41
+ options={[
42
+ {value: 'apple', label: 'Apple'},
43
+ {value: 'banana', label: 'Banana'},
44
+ ]}
45
+ onChange={() => {}}
46
+ {...scenario.props}
47
+ />,
48
+ );
49
+ if (!scenario.open) {
50
+ return;
51
+ }
52
+ const user = userEvent.setup();
53
+ await user.click(
54
+ scenario.props.hasSearch
55
+ ? screen.getByRole('button', {name: /Fruit/})
56
+ : screen.getByRole('combobox', {name: 'Fruit'}),
57
+ );
58
+ await screen.findByRole('listbox', hidden);
59
+ if (scenario.highlightFirst) {
60
+ const search = subjectFor(scenario);
61
+ await waitFor(() => expect(search).toHaveFocus());
62
+ await user.keyboard('{ArrowDown}');
63
+ }
64
+ },
65
+ subject: () => subjectFor(scenario),
66
+ related: () => {
67
+ const related: Record<string, Element> = {};
68
+ if (!scenario.facts.popupVisible) {
69
+ return related;
70
+ }
71
+ const listbox = screen.getByRole('listbox', hidden);
72
+ if (scenario.binding === 'Selector.trigger') {
73
+ // AR1: the trigger names the popup kind its presentation renders.
74
+ expect(subjectFor(scenario)).toHaveAttribute(
75
+ 'aria-haspopup',
76
+ scenario.facts.popupRole,
77
+ );
78
+ }
79
+ related.popup =
80
+ scenario.facts.popupRole === 'dialog'
81
+ ? screen.getByRole('dialog', {...hidden, name: 'Fruit'})
82
+ : listbox;
83
+ if (scenario.facts.activeDescendant) {
84
+ expect(
85
+ subjectFor(scenario).getAttribute('aria-activedescendant'),
86
+ ).not.toBeNull();
87
+ related['active-descendant'] = within(listbox).getByRole('option', {
88
+ ...hidden,
89
+ name: 'Apple',
90
+ });
91
+ }
92
+ return related;
93
+ },
94
+ cleanup,
95
+ });
96
+ });
97
+
98
+ it('keeps the bounded first-adopter state matrix explicit', () => {
99
+ expect(
100
+ SELECTOR_COMBOBOX_SCENARIOS.map(scenario => [
101
+ scenario.binding,
102
+ scenario.id,
103
+ ]),
104
+ ).toEqual([
105
+ ['Selector.trigger', 'closed'],
106
+ ['Selector.trigger', 'open'],
107
+ ['Selector.trigger', 'read-only'],
108
+ ['Selector.trigger', 'busy'],
109
+ ['Selector.trigger', 'sheet-open'],
110
+ ['Selector.search', 'search-active'],
111
+ ]);
112
+ expect(SELECTOR_COMBOBOX_EXCLUSIONS).toHaveLength(5);
113
+ });
114
+
115
+ it('pins every known failure to exactly one bound state', () => {
116
+ expect(SELECTOR_COMBOBOX_KNOWN_FAILURES).toHaveLength(1);
117
+ for (const record of SELECTOR_COMBOBOX_KNOWN_FAILURES) {
118
+ expect(
119
+ SELECTOR_COMBOBOX_SCENARIOS.filter(
120
+ scenario =>
121
+ scenario.binding === record.binding && scenario.id === record.state,
122
+ ),
123
+ ).toHaveLength(1);
124
+ }
125
+ });
126
+ });