Repository navigation
Conversation
Typeahead and Tokenizer dropped a result's `action` with a development warning. The panel now adopts the option-action grid: once a result carries an action, the list is a grid for the life of the field; each row has the option cell and the action cell, named by the option cell; a titled group is a rowgroup. On a row the arrow keys reached, the arrow toward the inline end moves to the action and the other moves back; Enter there, or a press, runs only the caller's control. While typing, the horizontal arrows keep moving the caret. A control with no name warns once in development. The "nothing matched" message is presentational in both roles and the live region still speaks it.
Two plain state values replace the grid-cell object, the horizontal-arrow check is one condition, the direction check reads the computed style in place, and the unnamed-control warning reads the rendered panel on every development render. A page that renders Typeahead without actions now loads 300 B gzip more than main, inside INV10's 0.3 KB.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
AI review status for this pull request.
|
|
/approve-spec c2b91e3 |
PR Analysis Report
Generated by PR Enrichment workflow | View current CI run |
- Enter on an action finds its cell from the input's root node, so it fires in a field inside a shadow root too (new test). - The unnamed-control check runs when an action cell attaches (a callback ref), not in an Effect; production builds drop it. - The changeset names the popover Tokenizer only; the bottom sheet still drops the control and warns. - The Result Actions story passes an Icon to IconButton. - A Chromium spec checks the grid with an accessibility engine, the actions at rest, and the keys in both directions. - spec:AST-058 FR5 says an automatic highlight does not take the inline arrows from a text input's caret; FR6 names the action cell, which holds the caller's control. - Stale record and comment lines removed; the grid-mode empty message has its own test.
Keeps a page that renders Typeahead without actions inside INV10's 0.3 KB (+300 B gzip, reference-pages measurer).
|
/approve-spec cbe2500 |
There was a problem hiding this comment.
Changes requested: the panel's grid adoption and the owner-approved record edits look right, but three things need fixing first.
- Enter on a result's action clicks only the first
FOCUSABLE_SELECTORmatch in the action cell (BaseTypeahead.tsx:2161-2164), so arole="button"element or a link withouthrefgets the highlight ring but Enter does nothing, whileMultiSelectorfires the same node; share one activation lookup and name check withMultiSelector, or at least use the same set of controls. - A page that renders
Tokenizerwithout any action grows 338 B gzip with the import-boundaries check's build (Typeahead +288 B, PowerSearch +301 B), over INV10's 0.3 KB, though a built-package measurement gives +268 B; trim the grid code until every method is under 307 B, or move it behind its own import. - The description's evidence and overlap lines are out of date: the new test file has 18 cases and 17 of them fail on the merge base, and #11629 and #11526 also change
TokenizerBottomSheet.tsx(#11526 alsoBaseTypeahead.test.tsx).
The earlier shadow-root, changeset, story-icon and accessibility-engine points are fixed, and the AST-058 FR5/FR6 and BaseTypeahead FR11 edits carry an engineering owner's approval for this head. Two small record follow-ups are worth taking along: the BaseTypeahead record's Design relationships table still calls the empty message a disabled option, and FR5's Space clause and new caret rule should be reconciled with MultiSelector's search field.
Claims and files checked
- Claim: Typeahead and Tokenizer's popover now show a result's action: verified (host tests).
- Claim: the control used to be dropped with a development warning: verified (the base panel's warning).
- Claim: a result with an action turns the list into a grid of result and control: verified (role tests, Chromium probe).
- Claim: after the arrows reach a row, the inline-end arrow reaches the control and Enter or a press runs it without selecting or closing: verified for button controls; false for a
role="button"element or a link withouthref, where Enter does nothing. - Claim: Tokenizer's bottom sheet still drops the control and warns: verified (
TokenizerBottomSheet.tsx:642). - Claim: the empty message is no longer a disabled option and is still announced: verified (
role="presentation", live-region assertions). - Claim: no new prop or type: verified (the API surface generator lists no change).
- Claim: without an action only the empty message changes: verified (code; the empty-results frame is pixel-identical).
- Claim: with an action the panel is a grid for the life of the field, with
aria-haspopup="grid": verified (latch tests, Chromium probe). - Claim: Left and Right move the caret until Up, Down, Home or End reach a row: verified (caret test, Chromium probe).
- Claim: the active descendant names the action cell: verified (key tests, Chromium probe).
- Claim: only the option cell selects in a grid: verified (pointer test).
- Claim: importing the shared direction helper would add a module to Typeahead pages: verified that Typeahead's graph does not reach it; the byte count was not checked.
- Claim: a dynamic-import alternative measured larger: not checkable (the alternative is not in the pull request).
- Claim: the new test file has 16 cases and 15 fail on main: false (18 cases, 17 fail on the merge base).
- Claim: the empty-message tests were updated: verified.
- Claim: the Chromium spec covers the accessibility engine, visibility and keys in both directions: verified by reading; not run.
- Claim: Enter fires the action inside a shadow root: verified (test).
- Claim: Typeahead +300 B, Tokenizer +253 B, PowerSearch +264 B, all within INV10: Tokenizer is +338 B with the import-boundaries build (+268 B built); Typeahead +288 B / +276 B; PowerSearch +301 B / +249 B.
- Claim: about 170 product lines in
BaseTypeahead.tsx: roughly (190 lines added, 55 deleted). - Claim: the overlapping pull requests share only
BaseTypeahead.tsx, and #10411 its record: false (#11629 and #11526 also shareTokenizerBottomSheet.tsx, #11526 alsoBaseTypeahead.test.tsx). - Claim: the Typeahead, Tokenizer and PowerSearch suites pass (1112 tests): verified (reproduced).
- Claim: typecheck, lint and the knowledge check pass: verified (Core typecheck, lint on the changed files, knowledge check).
- Claim: the writing rubric results match the record edits: verified, except the Design relationships row named above.
- File
.changeset/typeahead-result-actions.md: clear. - File
apps/storybook/stories/Typeahead.stories.tsx: clear. - File
docs/specs/AST-058-option-actions/spec.md: owner-approved; follow-up on FR5 for text-input hosts. - File
docs/specs/components/Typeahead/BaseTypeahead.spec.md: owner-approved; stale Design relationships row. - File
packages/core/src/Tokenizer/TokenizerBottomSheet.tsx: clear. - File
packages/core/src/Typeahead/BaseTypeahead.emptyState.a11y.chromium.spec.ts: clear (not run). - File
packages/core/src/Typeahead/BaseTypeahead.incremental.test.tsx: clear. - File
packages/core/src/Typeahead/BaseTypeahead.optionActions.test.tsx: clear (its case count in the description is wrong). - File
packages/core/src/Typeahead/BaseTypeahead.test.tsx: clear. - File
packages/core/src/Typeahead/BaseTypeahead.tsx: Enter activation drift; INV10 size; a JSDoc separated from its function. - File
packages/core/src/Typeahead/__tests__/TypeaheadResultActions.a11y.chromium.spec.ts: clear (not run). - File
packages/core/src/Typeahead/types.ts: clear.
Enter on a result's action clicked the first focusable element in the cell, so a role="button" element or a link without href got the ring but did nothing. The cell now fires, and checks for a name, the same control set MultiSelector's option actions use. The option cell reuses the content style, and the inline-direction check is one comparison, so a page without actions stays within INV10 (Typeahead +305 B gzip by the reference-pages measurer). The record's design table no longer calls the empty message a disabled option.
|
/approve-spec 199af59 |
There was a problem hiding this comment.
Changes requested: the panel's grid adoption works, but one record conflict needs fixing first.
- Miss:
spec:AST-058FR5's new text-input sentence (docs/specs/AST-058-option-actions/spec.md:194) keeps the inline arrows on the caret until Up, Down, Home or End move the highlight, which contradictscomponent:MultiSelectorFR16 and FR12 (its search field moves them to the action on any highlighted row, a hover or PageDown included), and the same row still says Space activates the action while this panel types a space, so please move the sentence intocomponent:BaseTypeaheadFR11 or amend MultiSelector's record with it, handle Space on the action cell or state that Space types in a text input, and re-approve at the new head.
Everything else checks out at this head: the grid latch, the two-cell rows, Enter on the action and the presentational empty message are covered by tests, and every page stays within INV10's 0.3 KB (Typeahead +301 B gzip). Required CI has not run on this draft head yet.
Claims and files checked
Review mode: same-head; reason: none
Claims:
- Before, Typeahead and Tokenizer dropped a result's control with a development warning: verified (the removed warning in
BaseTypeahead.tsx; the bottom sheet's warning). - MultiSelector already renders the control: verified (MultiSelector's grid cells).
- The control shows on its row at rest, and a press runs only it with the result unselected and the list open: verified (pointer test; Chromium frames).
- After Down or Up reach a row, the inline-end arrow reaches the control, Enter runs it, the other arrow moves back, and while typing Left and Right keep moving the caret: verified (key and caret tests; Chromium probes).
- With an action the list is a grid of option and action cells, each row named by its option alone, with titled groups as row groups: verified (role and name tests; Chromium probe).
- The "nothing matched" message is no longer a disabled option in either role and is still spoken: verified (three updated test files; Chromium probe shows
presentation). - Nothing to opt into, and an unnamed control warns once in development: verified (name test;
warnOnce). - Tokenizer's bottom sheet still drops the control and warns: verified (
TokenizerBottomSheet.tsx:642). - The governing record is current and names Typeahead and Tokenizer as adopters through the panel: verified (record front matter and FR9).
- No new prop or type, only the JSDoc of
action: verified (API surface generator; diff). - Without an action the panel stays a listbox and only the empty message changes: verified (listbox test).
- With an action the panel is a grid for the life of the field and the input says
aria-haspopup="grid": verified (latch test; probe). - The horizontal arrows move between cells only on a row Down, Up, Home or End reached, and FR5 now says so: verified in code; the FR5 sentence conflicts with MultiSelector's record (finding above).
- The active descendant names the action cell, as in MultiSelector, and FR6 now says so: verified.
- No shared option-action module, because the record asks for one behavior and MultiSelector's trigger is not a text input: true as worded (its trigger is a button), but MultiSelector's search field is a text input, which is where the two FR5 readings meet (finding above).
- The direction check reads the computed style in place because the shared helper costs about 19 B over the allowance: not measured.
- INV10 is measured on bundles of the built packages: consistent with INV10's text.
- Only the option cell selects with the pointer: verified (pointer test).
- A deferred-import split measured larger: not measured.
- The new test file has 20 cases with the listed coverage: verified.
- On the base, 19 of the 20 fail and only the listbox case passes: verified.
- The empty-message tests and Chromium spec assert the message is shown and is not an option: verified.
- The Chromium spec runs an accessibility engine over the grid and checks visibility, keys and Enter in both directions: verified by reading (not run on this draft).
- Enter fires the action in a shadow root: verified (test).
- Real-Chrome stills will follow before the draft ends: pending.
- First-load growth is within INV10 on the Typeahead, Tokenizer and PowerSearch pages and zero on the four reference pages: verified (+301 B, +289 B, +252 B on built-package bundles; the description's figures from another measurer also pass).
- About 170 product lines in
BaseTypeahead.tsx: roughly (190 added, 55 removed, many of them comments). - Overlap with four other open pull requests on the shared files: verified.
- The Typeahead, Tokenizer and PowerSearch suites pass (1114 tests): verified.
- Typecheck, lint and the knowledge check pass: verified.
- The record edits state behavior in the present tense and drop the gap sentences: verified.
- Changeset: the result's control, the grid, the arrow then Enter or press path without selecting or closing, the unchanged bottom sheet and the empty message: verified.
Files:
.changeset/typeahead-result-actions.md: clearapps/storybook/stories/Typeahead.stories.tsx: cleardocs/specs/AST-058-option-actions/spec.md: FR5 conflict (blocking); FR7 stale verification state (non-blocking)docs/specs/components/Typeahead/BaseTypeahead.spec.md: clearpackages/core/src/Tokenizer/TokenizerBottomSheet.tsx: clearpackages/core/src/Typeahead/BaseTypeahead.emptyState.a11y.chromium.spec.ts: clearpackages/core/src/Typeahead/BaseTypeahead.incremental.test.tsx: clearpackages/core/src/Typeahead/BaseTypeahead.optionActions.test.tsx: clearpackages/core/src/Typeahead/BaseTypeahead.test.tsx: clearpackages/core/src/Typeahead/BaseTypeahead.tsx: Space on the action cell types (part of the FR5 finding); two comment notes (non-blocking)packages/core/src/Typeahead/__tests__/TypeaheadResultActions.a11y.chromium.spec.ts: clearpackages/core/src/Typeahead/types.ts: clear
|
/approve-spec 8b41da3 |
There was a problem hiding this comment.
Changes requested: the panel's grid adoption works at this head, but the spec:AST-058 FR5 conflict from the last review is unchanged.
- Miss:
spec:AST-058FR5's new text-input sentence (docs/specs/AST-058-option-actions/spec.md:194) keeps the inline arrows on the caret until Up, Down, Home or End move the highlight, which contradictscomponent:MultiSelectorFR16 and FR12 (its search field moves them to the action on any highlighted row, a hover or PageDown included), and the same row still says Space activates the action while this panel types a space, so please move the sentence intocomponent:BaseTypeaheadFR11 or amend MultiSelector's record with it, and either handle Space on the action cell or state that Space types in a text input.
Everything else checks out: the grid latch, the two-cell rows, Enter on the action and the presentational empty message are covered by passing tests, the public API is unchanged, and every page stays within INV10's 0.3 KB (Typeahead +273 B gzip). The record edit needs a fresh /approve-spec at its new head. Required CI has not run on this draft head yet.
Claims and files checked
Review mode: same-head; reason: none
Claims:
- Before, Typeahead and Tokenizer dropped a result's control with a development warning: verified (the removed warning in
BaseTypeahead.tsx; the bottom sheet's warning stays). - MultiSelector already renders the control: verified (its grid cells and its record).
- The control shows on its row at rest, and a press runs only it with the result unselected and the list open: verified (pointer test; Chromium frames).
- After Down or Up reach a row, the inline-end arrow reaches the control, Enter runs it, the other arrow moves back, and while typing Left and Right keep moving the caret: verified (key and caret tests; Chromium probes).
- With an action the list is a grid of option and action cells, each row named by its option alone, with titled groups as row groups: verified (role and name tests; Chromium probe).
- The "nothing matched" message is no longer a disabled option in either role and is still spoken: verified (updated tests; Chromium probe shows
presentation; frames unchanged). - Nothing to opt into, and an unnamed control warns once in development: verified (name test;
warnOnce). - Tokenizer's bottom sheet still drops the control and warns: verified (
TokenizerBottomSheet.tsx). - The governing record is current and names Typeahead and Tokenizer as adopters through the panel: verified (record front matter and FR9).
- No new prop or type, only the JSDoc of
action: verified (API surface generator, no rows; diff). - Without an action the panel stays a listbox and only the empty message changes: verified (listbox test; probe).
- With an action the panel is a grid for the life of the field and the input says
aria-haspopup="grid": verified (latch test; probe). - The horizontal arrows move between cells only on a row Down, Up, Home or End reached, and FR5 now says so: verified in code; the FR5 sentence conflicts with MultiSelector's record (finding above).
- The active descendant names the action cell because the host may not give the caller's control an id, as in MultiSelector, and FR6 now says so: verified (FR1 forbids inspecting or wrapping the node; MultiSelector's record names the row or the action cell).
- No shared option-action module, because the record asks for one behavior and MultiSelector's trigger is not a text input: true as worded (its trigger is a button), but MultiSelector's search field is a text input, which is where the two FR5 readings meet (finding above).
- The direction check reads the computed style in place because the shared helper costs about 19 B over the allowance: not measured.
- INV10 is measured with the reference-pages measurer on built packages: consistent with INV10's text; used here.
- Only the option cell selects with the pointer: verified (pointer test).
- A deferred-import split measured larger: not measured.
- The new test file has 20 cases with the listed coverage: verified.
- On the base, 19 of the 20 fail and only the listbox case passes: verified at an earlier head; the test file and the grid code are unchanged since.
- The empty-message tests and Chromium spec assert the message is shown and is not an option: verified.
- The Chromium spec runs an accessibility engine over the grid and checks visibility, keys and Enter in both directions: verified by reading (not run; CI skipped this draft).
- Enter fires the action in a shadow root: verified (test).
- Real-Chrome stills will follow before the draft ends: pending.
- First-load growth is within INV10 on the Typeahead, Tokenizer and PowerSearch pages and zero on the four reference pages: verified (+273 B, +285 B, +245 B against this base; the description's figures, against an older base, also pass).
- About 170 product lines in
BaseTypeahead.tsx: roughly (190 added, 55 removed, many of them comments). - Overlap with four other open pull requests on the shared files, with one merging first: verified for that one (both merges of
mainare clean); not rechecked for the rest. - The Typeahead, Tokenizer and PowerSearch suites pass: verified at this head (29 files, 1,116 tests).
- Typecheck, lint and the knowledge check pass: verified at this head (Core's source and test typecheck, lint on the changed files, the knowledge check).
- The record edits state behavior in the present tense and drop the gap sentences: verified.
- Changeset: the result's control, the grid, the arrow then Enter or press path without selecting or closing, the unchanged bottom sheet and the empty message: verified.
Files:
.changeset/typeahead-result-actions.md: clearapps/storybook/stories/Typeahead.stories.tsx: cleardocs/specs/AST-058-option-actions/spec.md: FR5 conflict (blocking); FR7 stale verification state (non-blocking)docs/specs/components/Typeahead/BaseTypeahead.spec.md: clearpackages/core/src/Tokenizer/TokenizerBottomSheet.tsx: clearpackages/core/src/Typeahead/BaseTypeahead.emptyState.a11y.chromium.spec.ts: clearpackages/core/src/Typeahead/BaseTypeahead.incremental.test.tsx: clearpackages/core/src/Typeahead/BaseTypeahead.optionActions.test.tsx: clearpackages/core/src/Typeahead/BaseTypeahead.test.tsx: clearpackages/core/src/Typeahead/BaseTypeahead.tsx: Space on the action cell types (part of the FR5 finding); two comment notes (non-blocking)packages/core/src/Typeahead/__tests__/TypeaheadResultActions.a11y.chromium.spec.ts: clearpackages/core/src/Typeahead/types.ts: clear
…R5 says Space types in a text input The text-input caret rule sat in spec:AST-058 FR5, which binds every adopter, and contradicted component:MultiSelector FR16 and FR12 (its search field moves the arrows to the action on any highlighted row). It now sits in component:BaseTypeahead FR11 as that panel's reading. FR5 instead states what both adopters do: where focus stays in a text input, Space types and Enter activates the control on the action cell. FR7's verification state drops a clause this change made stale. Two comments in BaseTypeahead.tsx are fixed: the option-cell note names its subject, and isBelowMinQueryLength's doc comment sits on its function again.
|
/approve-spec 048dcd2 |
There was a problem hiding this comment.
Changes requested: the record conflict and the Space gap from the last review are fixed, and the grid works by keyboard and pointer, but one interaction between the two needs a fix.
- Miss: after the keyboard reaches a result's action, moving the pointer to another row and back onto that result's name puts the active descendant back on the action, so Enter runs the action instead of picking the result under the pointer, against
component:BaseTypeaheadFR11's rule that a pointer highlight does not take the inline arrows (BaseTypeahead.tsx:2447never clears the reached row); passing() => setGridRow(-1)ashighlightOnHover's callback, asMultiSelectorresets its cell on hover, plus a test would fix it.
Everything else checks out: the public API is unchanged, every page stays within the 0.3 KB first-load allowance (Typeahead +273 B gzip), and the accessibility-engine and empty-state Chromium specs pass. The records will need a fresh /approve-spec at the new head. Required CI has not run on this draft head yet.
Claims and files checked
Review mode: full; reason: spec-record
Claims:
- Before, Typeahead and Tokenizer dropped a result's control with a development warning: verified (the removed warning in
BaseTypeahead.tsx; the bottom sheet's warning stays). - MultiSelector already renders the control: verified (its grid cells and its record).
- The control shows on its row at rest, and a press runs only it with the result unselected and the list open: verified (pointer test; Chromium frames).
- After Down or Up reach a row, the inline-end arrow reaches the control, Enter runs it, the other arrow moves back, and while typing Left and Right keep moving the caret: verified (key and caret tests; Chromium probes); a pointer return to that row re-targets Enter (finding above).
- With an action the list is a grid of option and action cells, each row named by its option alone, with titled groups as row groups: verified (role and name tests; Chromium probe; the axe spec passes).
- The "nothing matched" message is no longer a disabled option in either role and is still spoken: verified (updated tests; the empty-state Chromium spec passes; pixel-identical frames).
- Nothing to opt into, and an unnamed control warns once in development: verified (name test).
- Tokenizer's bottom sheet still drops the control and warns: verified (
TokenizerBottomSheet.tsx). - The governing record is current and names Typeahead and Tokenizer as adopters through the panel: verified (record front matter and its adopters clause).
- No new prop or type, only the JSDoc of
action: verified (the repository's API surface generator lists no row). - Without an action the panel stays a listbox and only the empty message changes: verified (listbox test; probe).
- With an action the panel is a grid for the life of the field and the input says
aria-haspopup="grid": verified (latch test; probe). - The horizontal arrows move between cells only on a row Down, Up, Home or End reached, the panel's record states this, and the system record's new line says Space types and Enter activates in a text input, as both adopters do: verified (records; key and caret tests; Space typed
ain Chromium; MultiSelector's search breaks out of Space). - The active descendant names the action cell because the host may not give the caller's control an id, as in MultiSelector, and the system record now says so: verified (the record forbids touching the node; MultiSelector's record names the row or the action cell).
- No shared option-action module, because the record asks for one behavior: true as worded; the two copies already differ on hover (finding above).
- The direction check reads the computed style in place because the shared helper costs about 19 B over the allowance: not measured.
- Only the option cell selects with the pointer: verified (pointer test).
- A deferred-import split measured larger: not measured.
- The new test file has 20 cases with the listed coverage: verified.
- On the base, 19 of the 20 fail and only the listbox case passes: verified (run on the issued base).
- The empty-message tests and Chromium spec assert the message is shown and is not an option: verified (run).
- The Chromium spec runs an accessibility engine over the grid and checks visibility, keys and Enter in both directions: verified (run here, passes).
- Enter fires the action in a shadow root: verified (test).
- Real-Chrome stills will follow before the draft ends: pending.
- First-load growth is within the 0.3 KB allowance on the Typeahead, Tokenizer and PowerSearch pages and zero on the four reference pages: verified (+273 B, +284 B, +246 B against this base; the description's figures, against an older base, also pass).
- About 170 product lines in
BaseTypeahead.tsx: roughly (194 added, 59 removed, many of them comments). - Overlap with four other open pull requests on shared files, one merging first: verified for that one (both merges of
mainare clean); not rechecked for the rest. - The Typeahead, Tokenizer and PowerSearch suites pass: verified at this head (29 files, 1,116 tests; the description's 1,114 predates two merges of
main). - Typecheck, lint and the knowledge check pass: verified at this head.
- The record edits are present tense, name the new tests, and drop the gap sentences and the stale verification clause: verified.
- Changeset: the result's control, the grid, the arrow then Enter or press path without selecting or closing, the unchanged bottom sheet and the empty message: verified.
Files:
.changeset/typeahead-result-actions.md: clearapps/storybook/stories/Typeahead.stories.tsx: cleardocs/specs/AST-058-option-actions/spec.md: cleardocs/specs/components/Typeahead/BaseTypeahead.spec.md: clear (the code does not yet meet its pointer rule: finding above)packages/core/src/Tokenizer/TokenizerBottomSheet.tsx: clearpackages/core/src/Typeahead/BaseTypeahead.emptyState.a11y.chromium.spec.ts: clearpackages/core/src/Typeahead/BaseTypeahead.incremental.test.tsx: clearpackages/core/src/Typeahead/BaseTypeahead.optionActions.test.tsx: clearpackages/core/src/Typeahead/BaseTypeahead.test.tsx: clearpackages/core/src/Typeahead/BaseTypeahead.tsx: pointer return re-targets Enter (blocking)packages/core/src/Typeahead/__tests__/TypeaheadResultActions.a11y.chromium.spec.ts: clearpackages/core/src/Typeahead/types.ts: clear
…the keys reached an action After the arrow keys reached a result's action, moving the pointer to another row and back left the reached row recorded, so the active cell returned to the action and Enter ran it instead of picking the result under the pointer. The row's mouse-move highlight now clears the reached row, as MultiSelector resets its cell on hover. New case in BaseTypeahead.optionActions.test.tsx (red before this change).
|
/approve-spec b6e6d1a |
There was a problem hiding this comment.
Approved pending CI: CI has not run on this head yet.
The pointer-return fix works: once the keys have reached a result's action, a pointer highlight gives the row back to its option cell, so Enter picks the result under the pointer, and the new case fails on the previous head and passes here. The record edits carry an approval for this exact head, the public API is unchanged, every page stays within the 0.3 KB first-load allowance (Tokenizer +289 B gzip), and the accessibility-engine and empty-state Chromium specs pass.
- Non-blocking: the description's test count (1,114; 1,117 now) and PowerSearch size (+280 B; +249 B measured here) are a few commits old, and both still pass.
Claims and files checked
Review mode: incremental; reason: none
Claims:
- Before, Typeahead and Tokenizer dropped a result's control with a development warning: verified (the removed warning in
BaseTypeahead.tsx; the bottom sheet's own warning stays). - MultiSelector already renders the control: verified (its grid cells and its record).
- The control shows on its row at rest, and a press runs only it, with the result unselected and the list open: verified (pointer case; Chromium frames).
- After Down or Up reach a row, the inline-end arrow reaches the control, Enter runs it and the other arrow moves back; while typing, Left and Right move the caret: verified (key and caret cases; Chromium probes and the pull request's key spec in both directions).
- With an action the list is a grid of option and action cells, each row named by its option alone, with titled groups as row groups: verified (role and name cases; the accessibility-engine spec passes).
- The "nothing matched" message is no longer a disabled option in either role and is still spoken: verified (updated cases; the empty-state Chromium spec passes).
- Nothing to opt into, and an unnamed control warns once in development: verified (name case).
- Tokenizer's bottom sheet still drops the control and warns: verified (
TokenizerBottomSheet.tsx). - The governing record is current, approved by its owner, and names Typeahead and Tokenizer as adopters through the panel: verified (record front matter and its adopters clause).
- No new prop or type, only the JSDoc of
action: verified (the repository's API surface generator lists no row). - Without an action the panel stays a listbox and only the empty message changes: verified (listbox case; Chromium probe).
- With an action the panel is a grid for the life of the field and the input says
aria-haspopup="grid": verified (latch case; probe). - The horizontal arrows move between cells only on a row Down, Up, Home or End reached, and an automatic or pointer highlight does not take them, as the panel's record states; the system record's new line says Space types and Enter activates in a text input: verified (records; caret case; the new pointer case, which fails on the previous head; Chromium pointer-return probe).
- The active descendant names the action cell because the host may not touch the caller's control, as in MultiSelector, and the system record now says so: verified (records).
- No shared option-action module, because the record asks for one behavior: true as worded; the hover fix uses the shared highlight hook's existing callback, as MultiSelector does.
- The direction check reads the computed style in place because the shared helper costs about 19 B over the allowance: not measured; consistent with the Tokenizer page's 18 B of headroom.
- Only the option cell selects with the pointer: verified (pointer case).
- A deferred-import split measured larger: not measured.
- The new test file has 20 cases with the listed coverage: verified (20 cases; 21 tests with the parameterized case expanded).
- On main, 19 of the 20 cases fail and only the listbox case passes: verified (run on the issued base: 20 of 21 tests fail, both rows of the parameterized case among them).
- The empty-message cases and Chromium spec assert the message is shown and is not an option: verified (run).
- The Chromium spec runs an accessibility engine over the grid and checks visibility, keys and Enter in both directions: verified (run here, passes).
- Enter fires the action in a shadow root: verified (case).
- Real-Chrome stills will follow before the draft ends: pending.
- First-load growth is within the 0.3 KB allowance on the Typeahead, Tokenizer and PowerSearch pages and zero on the four reference pages: verified (+279 B, +289 B and +249 B gzip measured here against the same base; the description's figures also pass).
- About 170 product lines in
BaseTypeahead.tsx: roughly (199 added, 60 removed, comments included). - Overlap with four other open pull requests, one merging first and this branch merging main after it: verified for that one; not rechecked for the rest.
- The Typeahead, Tokenizer and PowerSearch suites pass: verified at this head (29 files, 1,117 tests; the description's 1,114 predates the last commits).
- Typecheck, lint and the knowledge check pass: verified at this head.
- The record edits are present tense, name the new tests, and drop the gap sentences and the stale verification clause: verified.
- Changeset: the result's control in Typeahead and the popover Tokenizer, the earlier warning, the grid, the arrow then Enter or press path without selecting or closing, the unchanged bottom sheet, and the empty message: verified; a
[feat]patch bump matches the contributing guide.
Files:
.changeset/typeahead-result-actions.md: clearapps/storybook/stories/Typeahead.stories.tsx: cleardocs/specs/AST-058-option-actions/spec.md: cleardocs/specs/components/Typeahead/BaseTypeahead.spec.md: clear (the code now meets its pointer rule)packages/core/src/Tokenizer/TokenizerBottomSheet.tsx: clearpackages/core/src/Typeahead/BaseTypeahead.emptyState.a11y.chromium.spec.ts: clearpackages/core/src/Typeahead/BaseTypeahead.incremental.test.tsx: clearpackages/core/src/Typeahead/BaseTypeahead.optionActions.test.tsx: clearpackages/core/src/Typeahead/BaseTypeahead.test.tsx: clearpackages/core/src/Typeahead/BaseTypeahead.tsx: clear (the pointer-return defect is fixed)packages/core/src/Typeahead/__tests__/TypeaheadResultActions.a11y.chromium.spec.ts: clearpackages/core/src/Typeahead/types.ts: clear
|
/approve-spec 6a5c670 |
There was a problem hiding this comment.
Changes requested: the grid adoption and its owner-approved record edits hold at this head, but two things need fixing first.
- Regression: a page that renders
Typeaheadwithout anyactiongrows +316 B gzip of first-load JavaScript on the current base (pnpm size:pages), over the 307 B thatarchitecture:component-import-boundariesINV10 allows, so the grid code needs trimming by at least 10 B gzip or a deferred load, and the description's Size table needs updating. - Miss: after Home and ArrowRight reach a row's control, Escape and then ArrowDown reopen the list with the active descendant back on that control, so Enter runs it instead of picking the result; resetting the reached row and cell when the list hides (
BaseTypeahead.tsx:1163) and requiring a highlighted row inisGridRowReached(:759) fixes it, with an Escape-then-ArrowDown test.
Tokenizer (+277 B) and PowerSearch (+271 B) stay within the allowance, the public API is unchanged, and the Typeahead, Tokenizer and PowerSearch suites pass at this head.
Claims and files checked
Review mode: same-head; reason: none
Claims:
- Before this change, Typeahead and Tokenizer dropped a result's control with a development warning: verified (the removed warning in
BaseTypeahead.tsx; the bottom sheet keeps its own). - MultiSelector already renders the control: verified (its grid cells).
- The control shows on its row at rest, and a press runs only it, with the result unselected and the list open: verified (pointer case; Chromium frames).
- After Down or Up reach a row, the inline-end arrow reaches the control, Enter runs it and the other arrow moves back, while typing keeps Left and Right on the caret: verified, except that a list reopened after Escape lands on the last reached control (Chromium and jsdom probes).
- With an action the list is a grid of option and action cells, each row named by its option alone, with titled groups as row groups: verified (role and name cases; Chromium).
- The "nothing matched" message is no longer a disabled option in either role and is still spoken: verified (updated cases in three suites).
- Nothing to opt into, and an unnamed control warns once in development: verified (name case).
- Tokenizer's bottom sheet still drops the control and warns: verified (
TokenizerBottomSheet.tsx). - The governing record is current, approved by its owner, and names Typeahead and Tokenizer as adopters through the panel: verified (front matter and its adopters clause).
- No new prop or type, only the JSDoc of
action: verified (the repository's surface generator lists 0 rows). - Without an action the panel stays a listbox and only the empty message changes: verified (listbox case; Chromium on both trees).
- With an action the panel is a grid for the life of the field and the input says
aria-haspopup="grid": verified (latch case; Chromium). - The horizontal arrows move between cells only on a row Down, Up, Home or End reached, and an automatic or pointer highlight does not take them: false for a list reopened after Escape, whose automatic first-row highlight takes the last reached control (probes).
- The system record's new line says Space types and Enter activates in a text input: verified (record; Enter cases).
- The active descendant names the action cell, as in MultiSelector, and the system record now says so: verified (record; Chromium).
- No shared option-action module, because the record asks for one behavior: as stated; small copies of MultiSelector's control selector and name check remain.
- The direction check reads the computed style in place to save about 19 B: not measured.
- Only the option cell selects with the pointer: verified (pointer case).
- A deferred-import split measured larger: not measured.
- The new test file has 20 cases with the listed coverage: verified (20 cases).
- On main, 19 of the 20 cases fail: not rerun on this base.
- The empty-message suites and Chromium spec assert the message is shown and is not an option: verified for the unit suites; the Chromium spec was read, not rerun.
- The Chromium spec runs an accessibility engine over the grid and checks visibility, keys and Enter in both directions: read, not rerun.
- Enter fires the action in a shadow root: verified (case passes).
- Real-Chrome stills follow before the draft ends: pending.
- First-load growth passes the 0.3 KB allowance (Typeahead +282 B, Tokenizer +286 B, PowerSearch +280 B) and is zero on the four reference pages: false on the current base for Typeahead (+316 B gzip); Tokenizer +277 B, PowerSearch +271 B and the reference pages (0) pass.
- About 170 product lines in
BaseTypeahead.tsx: roughly (199 added, 60 removed, comments included). - Overlap with four other open pull requests: not rechecked.
- The Typeahead, Tokenizer and PowerSearch suites pass: verified (29 files, 1,118 tests; the description's 1,114 is older).
- Typecheck, lint and the knowledge check pass: verified (the core typecheck, lint on the changed files and the knowledge check exit 0 at this head).
- The record edits are present tense, name the new tests and drop the gap sentences: verified.
- Changeset: Typeahead and the popover Tokenizer show the control, the grid, the arrow then Enter or press path without selecting or closing, the unchanged bottom sheet and the empty message: verified, apart from the reopen path above.
Files:
.changeset/typeahead-result-actions.md: clearapps/storybook/stories/Typeahead.stories.tsx: cleardocs/specs/AST-058-option-actions/spec.md: cleardocs/specs/components/Typeahead/BaseTypeahead.spec.md: clear (the code misses its reopen reading)packages/core/src/Tokenizer/TokenizerBottomSheet.tsx: clearpackages/core/src/Typeahead/BaseTypeahead.emptyState.a11y.chromium.spec.ts: clearpackages/core/src/Typeahead/BaseTypeahead.incremental.test.tsx: clearpackages/core/src/Typeahead/BaseTypeahead.optionActions.test.tsx: no case for a list reopened after Escapepackages/core/src/Typeahead/BaseTypeahead.test.tsx: clearpackages/core/src/Typeahead/BaseTypeahead.tsx: the reopen Miss and the INV10 Regressionpackages/core/src/Typeahead/__tests__/TypeaheadResultActions.a11y.chromium.spec.ts: clearpackages/core/src/Typeahead/types.ts: clear
…reached After Home and ArrowRight reached a row's action, Escape then ArrowDown reopened the list with the active descendant back on that action, so Enter ran the control instead of picking the result. The list's hide now resets the reached row, and a reached row needs a highlighted row. The active descendant's id is built once with its cell suffix.
There was a problem hiding this comment.
Changes requested: the result-action grid and its owner-approved record edits hold at this head, and the reopen fix works, but one thing needs fixing first.
- Regression: a page that renders
Typeaheadwithout anyactionnow grows +319 B gzip of first-load JavaScript against the pull request's base, over INV10's 307 B limit (Tokenizer +286 B, PowerSearch +276 B), and the description's Size table still reports +282 B as a pass; trim the grid code by at least 12 B gzip or move it behind its own import or a deferred load, then update the table.
The fix since the last review works: after the keys reach a result's action, Escape and then ArrowDown reopen the list on the result itself, and Enter picks it. The description's test counts are also stale (1,119 tests pass at this head).
Claims and files checked
Review mode: incremental; reason: none
Claims:
- A result's control shows on its row at rest, and a press runs only the control: verified (pointer test; real-browser frames show one Edit control per row).
- After Up, Down, Home or End reach a row, the arrow toward the row's end reaches the control, Enter runs it and the other arrow moves back, in both directions; typing keeps the arrows on the caret: verified (key, right-to-left and caret tests; real-browser keys and right-to-left captures).
- A list that closes forgets the reached row, so Escape then ArrowDown lands on the result: verified (new test; real-browser reopen capture picks the result on Enter).
- Once a result carries an action the list is a grid of two-cell rows named by the option cell, titled groups are row groups, and the role latches: verified (role and latch tests; real-browser grid of 4 rows and 8 cells).
- The "nothing matched" message is presentational in both roles and the live region still speaks it: verified (
BaseTypeahead.tsx:2399-2405; three suites). - An unnamed control warns once in development: verified (
BaseTypeahead.tsx:596-619; names test). - Enter fires a button-role element, a link without href, and a field in a shadow root: verified (tests;
BaseTypeahead.tsx:2171). - Only the option cell selects; the row has no click handler in a grid: verified (
BaseTypeahead.tsx:2445). - Tokenizer's bottom sheet still drops the control and warns: verified (
TokenizerBottomSheet.tsx:648-658). - No new prop or type; only the
actionJSDoc changes: verified (types.ts:41-48; the API surface generator lists no change). - The direction check reads the computed style in place: verified (
BaseTypeahead.tsx:2140). - Size table (Typeahead +282 B pass, Tokenizer +286 B, PowerSearch +280 B, against an older main): false at the current base (Typeahead +319 B fails, Tokenizer +286 B, PowerSearch +276 B).
- The option-actions file has 20 cases and the three suites pass 1,114 tests: stale (21 cases; 1,119 pass).
- Type check, lint and the knowledge check pass: verified at this head.
- The release note's claims (popover Tokenizer and Typeahead show the action, the grid, the keys, the bottom sheet warning, the empty message): verified as above.
Files:
packages/core/src/Typeahead/BaseTypeahead.tsx: Regression (INV10 overrun); the reopen fix is clear.packages/core/src/Typeahead/types.ts: clear.packages/core/src/Tokenizer/TokenizerBottomSheet.tsx: clear (comment only).packages/core/src/Typeahead/BaseTypeahead.optionActions.test.tsx: clear.packages/core/src/Typeahead/BaseTypeahead.test.tsx: clear.packages/core/src/Typeahead/BaseTypeahead.incremental.test.tsx: clear.packages/core/src/Typeahead/BaseTypeahead.emptyState.a11y.chromium.spec.ts: clear.packages/core/src/Typeahead/__tests__/TypeaheadResultActions.a11y.chromium.spec.ts: clear (not run here).apps/storybook/stories/Typeahead.stories.tsx: clear.docs/specs/AST-058-option-actions/spec.md: clear (owner-approved at this head).docs/specs/components/Typeahead/BaseTypeahead.spec.md: clear (owner-approved at this head)..changeset/typeahead-result-actions.md: clear.
User need
A product builder puts a secondary control on a search result, such as an Edit or More button on a person or a label. In
TypeaheadandTokenizer, that control (the result'saction) was dropped with a development warning, so the person picking a result had no way to reach it, by pointer or keyboard. The other option pickers (MultiSelector) already render it.Problem and solution fit
actionon a result. A control with no accessible name warns once in development.Typeaheadand the popoverTokenizeruse. Tokenizer's bottom sheet, its presentation on compact touch screens, has its own rows; it still shows the result without the control and warns (spec:AST-058FR9 for a non-adopting host).Current specification
spec:AST-058(authority: current; its front matter recordsapproved_by: cixzhang,approved_at: 2026-10-03), FR2–FR9 and AR2–AR4. FR9 namesTypeaheadandTokenizeras adopters through the panelBaseTypeaheadrenders.Decision: spec:AST-058/FR9
Public delta and caller burden
SearchableItem.actionalready exists, and its JSDoc now describes what the panel does with it.action: the panel is the listbox it was. The only change is the empty-search message:role="presentation"instead of a disabled option (spec:AST-058FR7).action: the panel isrole="grid"for the life of the field, and the input hasaria-haspopup="grid".Design and alternatives
spec:AST-058DEC-5 requires: a later list without actions never switches the role back.component:BaseTypeaheadFR11 states this as the panel's own reading: an automatic or pointer highlight does not take the arrows.spec:AST-058FR5 adds one consistency line both adopters already meet: where focus stays in a text input, Space types and Enter activates the action's control.spec:AST-058FR6 now names the cell, asMultiSelectoralready does.isRtlElementadds its module to every Typeahead page, about 19 B over INV10's allowance.pnpm size:pages(built packages) is INV10's measurement; the import-boundaries check's source build (StyleX uncompiled) is an early signal only.import(). The split adds shared-chunk wiring and measured larger (+0.45 KB) than the inline code.Evidence
BaseTypeahead.optionActions.test.tsx(20 cases), covering:role="button"element and on a link withouthref(the control set MultiSelector fires), Enter in a shadow root, and the unnamed-control warning;main, 19 of the 20 fail. The one that passes, "stays a listbox when no result carries an action", holds trivially there.BaseTypeahead.test.tsx,BaseTypeahead.incremental.test.tsxand theBaseTypeahead.emptyStateChromium spec now assert the message is shown and is not an option.TypeaheadResultActions.a11y.chromium.spec.ts: an accessibility engine (axe) over the grid, the actions visible in their rows, and the keys plus Enter in left-to-right and right-to-left.Size
First-load JavaScript (
architecture:component-import-boundariesINV10), gzip, for a page that renders the component without anyaction. Base ismain484f7af, head b194ed8. Measured with the reference-pages measurer (pnpm size:pageson main: Core compiled asbuild:esmcompiles it, bundled with the size report's esbuild options, Core'ssideEffectsapplied):BaseTypeahead.tsx. The rest is tests, the story, the record and the changeset.Scope
Components: BaseTypeahead, Typeahead, Tokenizer
Overlap checked: #11201, #11629, #10411, #11526 (each shares
BaseTypeahead.tsxon different lines; #11629 and #11526 also changeTokenizerBottomSheet.tsx, #11526 alsoBaseTypeahead.test.tsx, and #10411 also the BaseTypeahead record; #11629 merges first and this branch merges main after it)Testing
pnpm vitest run --project ui packages/core/src/Typeahead packages/core/src/Tokenizer packages/core/src/PowerSearch: 1114 passed.tscis clean, and lint andpnpm check:knowledgepass.Writing rubric results
BaseTypeahead.optionActions.test.tsxand the cases it covers.spec:AST-058FR5 and FR6 (consistency lines): present tense, no change references; FR5 adds that in a text input Space types and Enter activates the action's control, FR6 names the action cell. FR7's verification state drops a stale clause.component:BaseTypeaheadFR11: adds the text-input caret rule as the panel's reading, present tense.Owner and land path
spec:AST-058.