Repository navigation
fix(Typeahead): a Typeahead result that renderItem returns as a TypeaheadItem with isDisabled, in its usual layout, is announced as disabled and never picked - #11833
Conversation
…led and never picked TypeaheadItem only dimmed a disabled result. Its callback ref now marks the option that holds it aria-disabled, and BaseTypeahead's pick reads that mark when the pick happens, so Enter, click and tap pick nothing. A press on a disabled option keeps focus in the input, so the list stays open. Arrow keys still reach the result. TypeaheadItem FR2 states the behavior and its limit for a custom renderItem.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
AI review status for this pull request.
|
|
/approve-spec 6c2436b |
PR Analysis Report🔎 Preview ·
|
| Component | Size | LoC | Visual · A11y · RTL |
|---|---|---|---|
| PowerSearch | 327.2 kB (+150 B) · 27.8 kB CSS (0) | — | — · — · — |
| Tokenizer | 118.9 kB (+147 B) · 22.4 kB CSS (0) | — | — · — · — |
| BaseTypeahead | 88.6 kB (+141 B) · 12.3 kB CSS (0) | — | ✓ · ✓ · ✓ |
✓ passed · ✗ needs a fix · Δ changed, for review in the shots below · ↻ needs re-verify · — did not run
2 more components
| Component | Size | LoC | Visual · A11y · RTL |
|---|---|---|---|
| Typeahead | 100.2 kB (+114 B) · 14.8 kB CSS (0) | — | ✓ · ✓ · ✓ |
| TypeaheadItem | 6.7 kB (0) · 3.6 kB CSS (0) | — | ✓ · ✓ · ✓ |
Package size: @astryxdesign/core 8.16 MB packed (+1.4 kB); no new dependencies.
Touched components checked; for the full suites, add ci:run-visual for Visual, ci:run-rtl for RTL.
Generated by PR Enrichment workflow | View full report
There was a problem hiding this comment.
Changes requested. The disabled-result fix works in the light DOM: the option is exposed as disabled in the accessibility tree, and a click, tap or Enter picks nothing while the list stays open. Four issues remain before approval:
- Inside an open shadow root a disabled result is announced as disabled but a click or Enter still picks it, because
handleSelectlooks the option up with the owner document'sgetElementById(BaseTypeahead.tsx:1699); decide on the option the event already has (and resolve the highlighted id in the listbox's own root), which also fixes two results that share an id, and add a shadow-root test. - A pointer over a disabled result still gives it the hover highlight (
highlightOnHover,BaseTypeahead.tsx:2354), whichspec:AST-085FR6 rules out for a disabled control; skip it for a marked option and keep arrow-key reach. isOptionDisabled(BaseTypeahead.tsx:588) duplicates the sharedisDisabledControlinutils/pressDisabled.ts; call the shared check instead.- The TypeaheadItem record's AR1 still says TypeaheadItem adds no role or state to its option, which the new FR2 contradicts; amend AR1, the Compatibility row and the Disabled state row to match.
While amending the record, also name the item.element limit beside the custom renderItem one.
Claims and files checked
Review mode: full; reason: no-earlier-review
- Changeset: a disabled TypeaheadItem result is announced as disabled, Enter, click or tap picks nothing and the list stays open, and arrow keys still reach it: verified in the light DOM (new tests, Chromium); false inside an open shadow root and for an item with
item.element. - Before, a disabled result was only dimmed, not announced, and still picked: verified (both new tests fail on the base; a click on the base picks it).
- After, it is announced as disabled and picks nothing, with the list open: verified in the light DOM (accessibility tree
disabled: true,BaseTypeahead.test.tsx); false inside an open shadow root. - Arrow keys still reach it and results without
isDisabledbehave as before: verified (arrow assertion; Typeahead and Tokenizer suites); its pointer highlight conflicts with AST-085 FR6. - TypeaheadItem marks its option through a callback ref and clears it on unmount or re-enable, with no Effect: verified (
TypeaheadItem.tsx:148-159, re-enable test). handleSelectreads the mark at pick time for Enter, click and tap through one path: verified in the light DOM (BaseTypeahead.tsx:1697-1705, Enter at 2078, click at 2348); the lookup misses shadow roots and repeated ids.- A press on a disabled option keeps focus in the input so the list stays open: verified (
BaseTypeahead.tsx:2338-2347,aria-expandedassertions). - The record's FR2, its verification row and
verified_bychange, with a fix changeset: verified (diff). - Red first, both new cases fail on the base and pass here: verified (rerun).
- Typeahead and Tokenizer suites pass, 552 tests: verified (13 files, 552 tests).
- Strict lint, the Core type check and the knowledge check are clean: verified (rerun).
- Size, +119 B gzip for a page importing Typeahead and TypeaheadItem: consistent (remeasured +114 B; Tokenizer page +123 B; Table page 0 B).
- AST-085 FR2 and FR5 govern and the owners chose the mechanism: verified (records; the record is owner-approved at this head); AR1 is left contradicting it.
- No public API change: verified (API surface diff, 0 rows).
- Public text has no internal context: verified.
- Writing rubric, FR2 states the behavior and its limit and the verification row names the tests: partly; the limit omits
item.element. - Merge plan with #11733: not checkable at this head.
.changeset/typeahead-disabled-result.md: overclaims for shadow roots anditem.element(first finding).docs/specs/components/Typeahead/TypeaheadItem.spec.md: AR1 and two rows contradict FR2 (blocking);item.elementlimit (non-blocking).packages/core/src/Typeahead/BaseTypeahead.tsx: shadow-root and repeated-id lookup, hover highlight, duplicated check (blocking); repeated comment at line 1695 (non-blocking).packages/core/src/Typeahead/BaseTypeahead.test.tsx: clear; add a shadow-root case with the fix.packages/core/src/Typeahead/TypeaheadItem.tsx: clear;item.elementlimit (non-blocking).
…-result # Conflicts: # packages/core/src/Typeahead/TypeaheadItem.tsx
…n, inside a shadow root too; a disabled result takes no hover highlight; reuse isDisabledControl
…the changeset names the shadow root and hover
|
🤖 (Posted by Cindy's agent.) Thanks. At
Three new cases cover the first two points. They fail on the earlier head and pass here. |
|
/approve-spec 14e0f24 |
There was a problem hiding this comment.
Changes requested. The earlier shadow-root, repeated-id, hover-highlight and shared-check findings are fixed, and AR1 now names the disabled mark. Three fixes remain:
- Newly live check: an item that sets
item.elementis never marked and is still picked, becauseTypeaheadItemreturns that element before the root that carries the marking ref (TypeaheadItem.tsx:173-176), so name that limit in the changeset, theisDisabledJSDoc and FR2 and narrow the title, or mark the option on that path too. - The TypeaheadItem record's Disabled state row (
TypeaheadItem.spec.md:101) still lists only dimming, so add thearia-disabledmark and that the option is never picked. - Miss: the same record's Compatibility class (
TypeaheadItem.spec.md:52-53, "no … DOM change") and its Availability concept (line 79, "Whether the content is dimmed") still describe a dimming-only item that changes nothing shipped, so restate them to match FR2, for example as a nonbreaking behavior change.
While there, TypeaheadItem.doc.mjs still describes isDisabled as visually disabled in all three of its entries.
Claims and files checked
Review mode: full; reason: spec-record
- Title, a disabled TypeaheadItem result is announced as disabled and never picked: false for an item that sets
item.element(first finding); otherwise verified by readingTypeaheadItem.tsx:151-164andBaseTypeahead.tsx:1705-1708. - Changeset, announced as disabled, Enter, click or tap picks nothing and leaves the list open, also in a shadow root, the pointer does not highlight it, arrow keys still reach it: false for
item.element(first finding); otherwise verified by readingBaseTypeahead.tsx:1705-1708,:2085and:2348-2370, with matching cases in the new tests (read, not run). - Before, a disabled result was only dimmed, not announced, and still picked: reported (base behavior).
- After, announced as disabled, picks nothing, list stays open, also in a shadow root, no hover highlight: as for the changeset.
- Unchanged, arrow keys reach a disabled result and it takes the keyboard highlight, and results without
isDisabledbehave as before: verified (arrow handling untouched; the new guards act only on a marked option; changed files and their direct importers read). - TypeaheadItem marks its option through a callback ref and clears it on unmount or re-enable, with no Effect: verified (
TypeaheadItem.tsx:151-164; the merged ref forwards the cleanup). - Each option is kept by row and the pick reads that row with the shared check, so it works in a shadow root and with repeated ids, covering Enter, click and tap through one path: verified (
handleSelecthas two callers, Enter at:2085and option click at:2358, and the only twoonChange(item)calls sit inside it). - A press on a disabled option keeps focus in the input and a pointer move over it does not move the highlight onto it: verified (
:2348-2357,:2364-2370). - The record's FR2, AR1, three glance rows, two verification rows and
verified_bychange: verified; the body's Compatibility class, Availability and Disabled state lines still disagree (second and third findings). - Red first, five cases fail on main and pass here, three of them also on the earlier head: reported (not run here; CI skipped).
- Typeahead, Tokenizer and PowerSearch suites pass (1177 tests), and strict lint, the Core type check and the knowledge check are clean: reported (not run here; CI skipped).
- Size, +119 B gzip for a page importing Typeahead and TypeaheadItem: reported, under the 0.3 KB allowance.
- The focusable-disabled requirements on blocking every change and exposing the state govern, and the owners chose the mechanism: verified (records; the reworded FR2 and AR1 are owner-approved for this head).
- No public API change: verified from the source diff.
- Public text has no internal context: verified (title, body, branch, commit messages and added lines).
- Writing rubric results: partly; the record body keeps stale lines (second and third findings).
- Overlap with #11733, an open draft that rewrites the same Enter and click lines: verified that it is open and a draft; the merge plan is the author's.
- No shared lines with #11526 and #4329: reported (both touch the same two files).
.changeset/typeahead-disabled-result.md: overclaims foritem.element(first finding).docs/specs/components/Typeahead/TypeaheadItem.spec.md: FR2 lacks theitem.elementlimit (first finding); stale Disabled state, Compatibility class and Availability lines (second and third findings).packages/core/src/Typeahead/BaseTypeahead.tsx: clear; one comment restates the ref's name (non-blocking).packages/core/src/Typeahead/BaseTypeahead.test.tsx: clear; no case for anitem.elementresult.packages/core/src/Typeahead/TypeaheadItem.tsx: theisDisabledJSDoc overclaims foritem.element(first finding).
… the record's compatibility, concept and state rows say what a disabled item does
|
🤖 (Posted by Cindy's agent.) Thanks. At |
|
/approve-spec 7270ae2 |
There was a problem hiding this comment.
Changes requested. The item.element limit is now named in the changeset, the isDisabled JSDoc, the docs and FR2, and the record's body rows match FR2. Two fixes remain:
- Miss:
TypeaheadItemmarks whicheverrole="option"holds it (TypeaheadItem.tsx:157-161), so a ChatComposerInput trigger row rendered withTypeaheadItem isDisabledis now announced as disabled while a press, Enter or Tab still inserts it (Chat/useTriggerMenu.tsx:851-861,:957-960), againstspec:AST-085FR2 and the "never picked" wording in the JSDoc, the docs, FR2 and AR1, so mark only an option whose host reads the mark (or make the trigger menu honour it) and name that host in the record and docs. - The title and the description's After line still say every disabled TypeaheadItem result is never picked, with the
item.elementlimit only in the separate Unchanged line, and the description quotes FR2's earlier wording, so narrow both to the default layout and quote FR2 as it now reads.
The INV29 note on BaseTypeahead.tsx:674 still stands, and the record's ownership boundary (TypeaheadItem.spec.md:65) could list the disabled mark beside the dimming.
Claims and files checked
Review mode: full; reason: spec-record
- Title, a disabled TypeaheadItem result is announced as disabled and never picked: false for an item that sets
item.element(second finding) and for a ChatComposerInput trigger row (first finding). - Changeset, a Typeahead result rendered with TypeaheadItem and
isDisabledin its usual layout is announced as disabled, Enter, click or tap picks nothing and the list stays open, also in a shadow root, the pointer does not highlight it, arrow keys still reach it: verified by readingBaseTypeahead.tsx:1705-1708,:2085,:2348-2370andTypeaheadItem.tsx:155-166, with matching test cases (read, not run). - Before, a disabled result was only dimmed, not announced, and still picked: reported (base behavior).
- After, the result is announced as disabled, picks nothing, the list stays open, also in a shadow root, no hover highlight: false for an
item.elementresult (second finding); otherwise as for the changeset. - Unchanged, arrow keys still reach a disabled result and it can take the keyboard highlight, results without
isDisabledbehave as before, anditem.elementor a customrenderItemwithout TypeaheadItem has no disabled state: verified (arrow handling untouched; the new guards act only on a marked option;TypeaheadItem.tsx:176-178). - TypeaheadItem marks the option holding a disabled item through a callback ref and clears it on unmount or re-enable, with no Effect: verified (
TypeaheadItem.tsx:155-166; the merged ref forwards the cleanup); the mark also lands on other components' options (first finding). - Each option is kept by row and the pick reads that row with the shared check, so it works in a shadow root and with repeated ids and covers Enter, click and tap through one path; a press keeps focus in the input and a pointer move does not highlight it: verified (
handleSelecthas two callers, Enter at:2085and option click at:2358, and the only twoonChange(item)calls sit inside it;:2348-2370). - The record's FR2 as quoted in the description: false, it is the earlier wording (second finding); FR2 names
item.elementas having no disabled state: verified. - AR1 names the disabled mark, and the Behavior, Compatibility and Review checks rows, the Availability concept, the Disabled state row, the compatibility class and the verification row say the same: verified (
TypeaheadItem.spec.md:35-39,:52-54,:80,:102,:116-119,:147). - The
isDisabledJSDoc and the three doc entries describe it the same way: verified as consistent with each other; their "never picked" is false for a ChatComposerInput trigger row (first finding). - Red first, five cases fail on main and pass here, three of them also on the earlier head: reported (not run; CI skipped).
- Typeahead, Tokenizer and PowerSearch suites pass (1177 tests), and strict lint, the Core type check and the knowledge check are clean: reported (not run; CI skipped).
- Size, +119 B gzip for a page importing Typeahead and TypeaheadItem: reported, under the 0.3 KB allowance.
- The focusable-disabled requirements on blocking every change and exposing the state govern, and the specification owners chose the mechanism: verified (the reworded FR2 and AR1 are owner-approved for this head).
- No public API change: verified from the source diff.
- Public text contains no internal context: verified (title, body, branch, commit messages and added lines).
- Writing rubric results: verified (FR2 and AR1 are in the present tense; the verification row names the test group).
- Overlap with #11733, an open draft that rewrites the same Enter and click lines: verified that it is open and a draft; no shared lines with #11526 and #4329: reported.
.changeset/typeahead-disabled-result.md: clear.docs/specs/components/Typeahead/TypeaheadItem.spec.md: FR2 and AR1 overclaim for hosts other than BaseTypeahead (first finding); the ownership boundary omits the mark (non-blocking).packages/core/src/Typeahead/BaseTypeahead.tsx: clear; one comment restates the ref's name (non-blocking).packages/core/src/Typeahead/BaseTypeahead.test.tsx: clear.packages/core/src/Typeahead/TypeaheadItem.doc.mjs: "never picked" overclaims (first finding).packages/core/src/Typeahead/TypeaheadItem.tsx: marks any enclosing option (first finding).
…mark, so another host's option is never announced disabled while it still picks
|
🤖 (Posted by Cindy's agent.) Thanks. The description's After line now limits the fix to a result that TypeaheadItem draws in its usual layout, not |
There was a problem hiding this comment.
Approved. CI has run on this head and its required checks pass. A disabled result drawn by TypeaheadItem is now exposed as disabled and refuses Enter, click and tap with the list kept open; this was reproduced locally in Chromium, and the five new BaseTypeahead cases fail on main and pass here.
Two small non-blocking points remain open in their threads: the comment at BaseTypeahead.tsx:675 opens by restating the ref's name, and a few TypeaheadItem record rows state the disabled mark without FR2's "in a Typeahead result option" scope.
Claims and files checked
Review mode: same-head; reason: none
Live title: fix(Typeahead): a Typeahead result drawn by TypeaheadItem with isDisabled is announced as disabled and never picked
Changed rules (3): Claim bounding in one round; A claim bounded by a record is bounded; The rules above still apply to every case. Result over the whole pull request: checked the title, changeset and description against item.element, Tokenizer's sheet presentation, other hosts' options, a custom renderItem, a caller's nested option, grouped rows, a shadow root, repeated ids and Tab; no finding.
Claims:
- Title, a Typeahead result drawn by TypeaheadItem with
isDisabledis announced as disabled and never picked: verified (reproduced locally in Chromium and in the head's tests; anitem.elementresult renders the caller's element in place of TypeaheadItem's layout). - Changeset, such a result in its usual layout is announced as disabled, Enter, click or tap picks nothing and leaves the list open, also inside a shadow root, the pointer does not highlight it and arrow keys still reach it: verified (head tests and a local probe of Enter and tap in a shadow root; Chromium hover, click and Enter checks).
- Description, the people affected are those whose app renders unavailable results with TypeaheadItem and
isDisabled: verified. - Description, before the change such a result was only dimmed, not announced, and still picked: reported; the missing announcement and the click and Enter picks were reproduced locally on
mainin Chromium. - Description, after the change a result in TypeaheadItem's usual layout is announced as disabled, Enter, click or tap picks nothing, the list stays open, also in a shadow root, and the pointer gives no highlight: verified (Chromium accessibility tree and checks; head tests and probe).
- Description, arrow keys still reach it and it can take the keyboard highlight, as the disabled-controls record leaves arrow order to the composite: verified (Chromium: ArrowDown makes it the active option).
- Description, results without
isDisabledbehave as before: verified (unmarked options take the same press, click and hover paths). - Description, an
item.elementitem and a customrenderItemwithout TypeaheadItem have no disabled state, and TypeaheadItem in another component's option is only dimmed: verified (local probe; "marks no option outside a Typeahead result list"). - Description, a callback ref marks and clears the option with no Effect, only in a Typeahead result option, through an internal context: verified (
TypeaheadItem.tsx:155-170; the context's only provider isBaseTypeahead.tsx:2387-2393). - Description, an option is never announced as disabled while a press still picks it: verified (only BaseTypeahead's option provides the context and both
onChange(item)calls follow the row check; a caller's nested option is not exposed as an option in Chromium). - Description, the pick reads the row it acts on with the shared helper, inside a shadow root and with shared ids, through one path for Enter, click and tap; a press keeps focus and a pointer move does not highlight: verified (
BaseTypeahead.tsx:677,:2086,:2342-2371; tests and probe, including grouped rows). - Description, the quoted TypeaheadItem FR2, AR1 and the rows it names, and the quoted BaseTypeahead FR19 with its verification row: verified (records read).
- Description, the JSDoc and the three doc entries describe
isDisabledthe same way: verified. - Description, a fix changeset: verified.
- Description, five new BaseTypeahead cases fail on
mainand pass here, plus one TypeaheadItem case: verified (run locally: 5 fail onmain, 80 of 80 pass on this head); the earlier-head runs: reported. - Description, suite counts, lint, typecheck and knowledge checks: reported; CI's test, lint and typecheck jobs pass on this head.
- Description, first-load size of the Typeahead page and the four reference pages: reported.
- Description, the cited disabled-control requirements and the owner-chosen mechanism: verified (the requirements exist; an engineering owner approved the records on this head).
- Description, the record sections touched and the writing rubric results: verified (records read).
- Description, scope of TypeaheadItem, the internal option context, the pick path, two test files, two records and a changeset: verified (all nine files).
- Description, no public API change: verified (the API report generator, run locally on both trees, lists no change).
- Description, public text contains no internal context: verified.
- Description, overlap with other open pull requests: reported.
Files:
.changeset/typeahead-disabled-result.md: clear.docs/specs/components/Typeahead/BaseTypeahead.spec.md: clear.docs/specs/components/Typeahead/TypeaheadItem.spec.md: non-blocking note (rows without the host scope).packages/core/src/Typeahead/BaseTypeahead.test.tsx: clear.packages/core/src/Typeahead/BaseTypeahead.tsx: non-blocking note (comment at line 675).packages/core/src/Typeahead/TypeaheadItem.doc.mjs: clear.packages/core/src/Typeahead/TypeaheadItem.test.tsx: clear.packages/core/src/Typeahead/TypeaheadItem.tsx: clear.packages/core/src/Typeahead/TypeaheadOptionContext.ts: clear.
There was a problem hiding this comment.
Changes requested. The disabled-result behavior works in the tests and CI passes on this head, but the earlier approval missed one size problem:
- Miss: TypeaheadItem's disabled mark (the option-context read and the merged callback ref,
TypeaheadItem.tsx:28-29and:155-170) adds 508 B gzip of first-load JavaScript to a page that rendersTypeaheadItemwithoutisDisabled, over the 0.3 KB thatarchitecture:component-import-boundariesINV10 allows an unused optional feature, so move it behind its own import or a deferred load, bring that page within 307 B, or have an engineering owner accept the cost as a named INV10 entry.
Measured locally with pnpm size:pages on a page that imports only TypeaheadItem (3,300 → 3,808 B gzip); the Typeahead page (+179 B) and the four reference pages (+0) stay within budget. Two earlier non-blocking notes are still open: the optionElementsRef comment, and the record rows that state the mark without "in a Typeahead result option".
Claims and files checked
Review mode: same-head; reason: none
- changed rules (3): "Claim bounding in one round", "Read the bound a claim already carries", "For a claim about focus, events or DOM placement".
- "Claim bounding in one round" (edited): checked: the title, every description section and the changeset against
item.element, the Tokenizer sheet, other hosts' options, customrenderItem, nested options, grouped rows, shared ids, re-enabling and Tab, with TypeaheadItem, BaseTypeahead, Tokenizer and PowerSearch read; no finding. - "Read the bound a claim already carries" (added): checked: each claim's own bound (the title's "drawn by TypeaheadItem", the changeset's and After line's "in its usual layout (not
item.element)"); no finding. - "For a claim about focus, events or DOM placement" (added): checked: unfocused press, SVG targets, iframe and picture-in-picture documents, shadow root, rows that turn disabled or enabled, and every other caller of BaseTypeahead and TypeaheadItem; no finding.
- Title "fix(Typeahead): a Typeahead result drawn by TypeaheadItem with isDisabled is announced as disabled and never picked": verified (the option gets
aria-disabled; Enter and click, the only pick paths, refuse a marked row; tests and a probe run here). - Changeset: a disabled result in TypeaheadItem's usual layout is announced as disabled, Enter, click or tap picks nothing, the list stays open, also in a shadow root, the pointer does not highlight it and arrow keys reach it: verified (tests and probe run here).
- Before: a disabled result was only dimmed and still picked: reported (red-first cases fail on the base in an earlier run of this head).
- After and Unchanged (arrow keys still reach it;
item.element, a customrenderItemwithout TypeaheadItem and other components' options keep no disabled state): verified (tests, probe, code). - TypeaheadItem marks and clears the option in a callback ref, with no Effect, only inside a Typeahead result, and an option is never announced as disabled while a press still picks it: verified.
- BaseTypeahead reads the row it acts on at pick time, inside a shadow root and with shared ids, through one path for Enter, click and tap; a press keeps focus in the input and a pointer move does not highlight: verified.
- Record edits (TypeaheadItem FR2 as quoted, AR1 and its rows; BaseTypeahead FR19) and the
isDisabledJSDoc and docs in three variants: verified. - New tests fail on the base and pass here: passing verified here; failing on the base reported.
- Suite counts, lint, typecheck and knowledge checks: reported; CI's test, lint and typecheck jobs pass on this head.
- Chrome stills of hover and arrow keys: reported; consistent with the code.
- Size: the Typeahead page +174 B gzip and the four reference pages +0: reported; consistent with the run here (+179 B, +0); a page that renders only TypeaheadItem is over budget (finding above).
- No public API change: verified (no public API row in any package).
.changeset/typeahead-disabled-result.md: clear.docs/specs/components/Typeahead/BaseTypeahead.spec.md: clear.docs/specs/components/Typeahead/TypeaheadItem.spec.md: non-blocking wording note.packages/core/src/Typeahead/BaseTypeahead.test.tsx: clear.packages/core/src/Typeahead/BaseTypeahead.tsx: non-blocking comment note.packages/core/src/Typeahead/TypeaheadItem.doc.mjs: clear.packages/core/src/Typeahead/TypeaheadItem.test.tsx: clear.packages/core/src/Typeahead/TypeaheadItem.tsx: size finding.packages/core/src/Typeahead/TypeaheadOptionContext.ts: part of the size finding's cost; otherwise clear.
…s option, so TypeaheadItem loads no option context
|
🤖 (Posted by Cindy's agent.) Thanks. At
Both pass INV10's 307 B. The records, docs and changeset now say that a |
|
/approve-spec 3cb4e1f |
There was a problem hiding this comment.
Changes requested. The disabled-result fix works for a TypeaheadItem that renderItem returns directly (the new tests pass on this head and fail on the base branch, both run locally), but four things still need fixing:
- An item whose
elementis falsy (false, whichelement: cond && <X />gives,''or0) still draws TypeaheadItem's dimmed layout, butisDisabledTypeaheadItemtreats onlynullandundefinedas "no element" (BaseTypeahead.tsx:626, againstif (item.element)atTypeaheadItem.tsx:160), so that option is not marked and a click picks it; use the same!item.elementtest (ideally one shared helper) and add anelement: falsecase. - The title says "a Typeahead result drawn by TypeaheadItem with isDisabled is announced as disabled and never picked", but a
renderItemthat wrapsTypeaheadItem(for example in aTooltipthat explains why) is still announced as an ordinary option and picked, so narrow it, for example to "a Typeahead result that renderItem returns as a TypeaheadItem with isDisabled is announced as disabled and never picked". - The description still describes the earlier mechanism: its Scope line lists "a Typeahead-internal option context", which this head does not have, and its Records line says "the item marks its option", while BaseTypeahead now marks it.
isDisabledTypeaheadItemand its JSDoc sit betweenBaseTypeahead's JSDoc andexport const BaseTypeahead, so the publishedBaseTypeaheaddeclaration loses the component's description and@example; move the helper above that JSDoc block.
The two non-blocking inline notes from the last review still stand: a comment that restates the ref's name, and two record rows that state the mark without "as a Typeahead result". The branch also conflicts with main in BaseTypeahead.spec.md and BaseTypeahead.test.tsx, so the next push needs a merge of main.
Claims and files checked
Review mode: same-head; reason: none
- Rules changed since the last review of this head: changed rules (0): none.
- Title (live: "fix(Typeahead): a Typeahead result drawn by TypeaheadItem with isDisabled is announced as disabled and never picked"): false for a wrapped
renderItemand for a falsyitem.element(local probe). - Changeset (a result that
renderItemreturns directly as a disabled TypeaheadItem in its usual layout is announced as disabled; Enter, click or tap picks nothing; the list stays open, also in a shadow root; no hover highlight; arrow keys still reach it): verified by the new tests, run locally, except for a falsyitem.element(false). - Who (apps that show some results as unavailable, drawn with TypeaheadItem and
isDisabled): context, consistent with the code. - Before (a disabled result was only dimmed, announced as ordinary and still picked): verified; the five new cases fail on the base branch, run locally.
- After (same scope as the changeset): verified, except for a falsy
item.element(false). - Unchanged (arrow keys reach it; results without
isDisabled,item.element, a custom or wrappedrenderItemand other components' options keep their old behavior): verified from the code and a local probe. - BaseTypeahead marks a direct disabled TypeaheadItem result during render, with no Effect and no DOM query, keeps the options by row and reads the row at pick time, in a shadow root and with shared ids, through one path for Enter, click and tap: verified, except "no
item.element" for a falsy value (false). - A press on a disabled option keeps focus in the input, and a pointer move does not highlight it: verified (tests run locally).
- TypeaheadItem is unchanged apart from its JSDoc, reads no context and sets no attribute, so a TypeaheadItem-only page loads nothing new: verified (diff; +0 B measured in the last review of this head).
- Another component's option that renders TypeaheadItem gets no mark: verified.
- The quoted TypeaheadItem FR2 and BaseTypeahead FR19 match the records, and the listed record rows are edited: verified.
- The
isDisabledJSDoc and docs (three variants) describe the behavior the same way: consistent, but false for a falsyitem.element. - Red first: five BaseTypeahead cases fail on the base branch and pass here: verified locally; the last three also failing on an earlier head: reported.
- Suite counts, strict lint, typecheck and knowledge checks: reported; CI's lint and typecheck jobs pass on this head, and its test jobs wait until review passes.
- Chrome stills at an earlier head, and that this head changes where the mark is set but not what renders: reported; holds for the stills' direct
renderItem, not for a wrapped one. - Size (Typeahead page +125 to +139 B gzip, TypeaheadItem-only page +0 B, reference pages +0): reported; the last review of this head measured +139 B, +0 B and +0, all within the 0.3 KB allowance.
- Records line (the item marks its option): false; BaseTypeahead marks it.
- Writing rubric results: reported; consistent with the record edits.
- Scope (a Typeahead-internal option context): false; no option context exists on this head.
- No public API change: verified (source diff; API generator in the last review of this head, 0 rows).
- Public text contains no internal context: verified.
- Overlap with other open pull requests, and the land path: reported.
.changeset/typeahead-disabled-result.md: false for a falsyitem.element(first finding).docs/specs/components/Typeahead/BaseTypeahead.spec.md: clear; conflicts withmain.docs/specs/components/Typeahead/TypeaheadItem.spec.md: FR2 and AR1 false for a falsyitem.elementuntil the code changes; non-blocking wording note.packages/core/src/Typeahead/BaseTypeahead.test.tsx: clear; add theelement: falsecase with the fix; conflicts withmain.packages/core/src/Typeahead/BaseTypeahead.tsx: first and fourth findings; non-blocking comment note.packages/core/src/Typeahead/TypeaheadItem.doc.mjs: false for a falsyitem.element(first finding).packages/core/src/Typeahead/TypeaheadItem.test.tsx: clear.packages/core/src/Typeahead/TypeaheadItem.tsx: JSDoc false for a falsyitem.element(first finding).
| | -------------- | ------------------------------ | --------------------------------------------------- | -------------- | -------------- | --------- | --------- | ---------------------- | | ||
| | Content source | default layout; `item.element` | Whether the item's own element replaces the layout. | Every result | default layout | component | stable | `item.element` wins. | | ||
| | Availability | enabled; disabled | Whether the content is dimmed. | Default layout | enabled | component | stable | Not applicable. | | ||
| | Availability | enabled; disabled | Dimmed, its option marked disabled, never picked. | Default layout | enabled | component | stable | Not applicable. | |
There was a problem hiding this comment.
Non-blocking: FR2 limits the mark to a Typeahead result that renders as TypeaheadItem, but this row (availability "Default layout") and the Disabled state row below say every disabled default-layout item has its option marked and never picked. Add "as a Typeahead result".
…ke TypeaheadItem lays it out; the helper sits above BaseTypeahead's JSDoc
|
/approve-spec 3c16d0b |
|
🤖 (Posted by Cindy's agent.) Thanks. At
I left the two record rows from the non-blocking note as they are. FR2 states the scope ("When a Typeahead result renders as a disabled TypeaheadItem…"). |
There was a problem hiding this comment.
Changes requested. The code now does what the last review asked: an item whose element is false, '' or 0 is marked and refused, and BaseTypeahead keeps its JSDoc (the new tests pass on this head and fail on the base branch, both run locally). Two fixes to the pull request's text remain:
- Miss: the title says a result that
renderItemreturns as aTypeaheadItemwithisDisabled"is announced as disabled and never picked", but when that item sets a truthyitem.element, TypeaheadItem renders the element as is and its option stays unmarked and is picked (BaseTypeahead.tsx:606,TypeaheadItem.tsx:160; reproduced locally), so add the bound the changeset already has, for example "fix(Typeahead): a Typeahead result that renderItem returns as a TypeaheadItem with isDisabled and no item.element is announced as disabled and never picked" (the title the last review suggested missed this case). - Newly live check: the overlap note says #11733 rewrites the Enter and option-click lines and leaves "that one text conflict", but merging this head with #11733 conflicts in four places in
BaseTypeahead.tsx(the Enter branch, the option row's press and click handlers, itsonMouseMoveand its content<span>), three of them only because of this pull request, so name the whole option row and say the merge has several conflicts.
Smaller points, none blocking: "(or the default rendering)" in the changeset, the After line, the isDisabled JSDoc and the three doc entries names a path that never passes isDisabled (BaseTypeahead.tsx:2356); the Availability and Disabled state rows of the TypeaheadItem record still leave out "as a Typeahead result"; the suite count at this head is 1,179 tests, not 1,178 (run locally); and the branch conflicts with main in BaseTypeahead.spec.md and BaseTypeahead.test.tsx, so the next push needs a merge of main.
Claims and files checked
Review mode: incremental; reason: none
- Changed rules (1): "Claim bounding in one round" (list claims of any kind, and code lists that decide what a claim covers). Whole-pull-request result: finding (the #11733 overlap item); checked: the overlap list (#11733, #11526, #4329) by three-way merges, the Scope list (all eight files), the records-touched list (both record diffs), the six-case test list, and the element test that decides which results are marked (undefined, null, false, empty string, 0, a truthy element, a truthy string, a wrapped item; local probe).
- Title (live: "fix(Typeahead): a Typeahead result that renderItem returns as a TypeaheadItem with isDisabled is announced as disabled and never picked"): false for an item with a truthy
item.element(local probe). - Changeset (a result
renderItemreturns directly, in its usual layout, notitem.element, is announced as disabled; Enter, click or tap picks nothing; the list stays open, also in a shadow root; no hover highlight; arrow keys still reach it): verified by the new tests and a local probe; "or the default rendering" can never apply (non-blocking). - Who: context, consistent with the code.
- Before (only dimmed, announced as ordinary, still picked): verified; the six new cases fail on the base branch, run locally.
- After: verified, with the same bound as the changeset; same default-rendering note.
- Unchanged (arrow keys reach a disabled result, as DropdownMenu's disabled rows are reached and inert; results without
isDisabledas before;item.elementhas no disabled state; a custom or wrappedrenderItemis only dimmed; another component's option is only dimmed): verified from the code, the tests, the DropdownMenu record and a local probe. - BaseTypeahead marks the option in its row loop for a TypeaheadItem with
isDisabledand no truthyitem.element(the same test TypeaheadItem uses), with no Effect and no DOM query; keeps the options by row;handleSelect(item, index)reads the row at pick time with the shared disabled check, in a shadow root and with shared ids, through one path for Enter, click and tap; a press keeps focus in the input; a pointer move does not highlight it: verified (code and tests, run locally). - TypeaheadItem is unchanged apart from its JSDoc, reads no context and sets no attribute, so a TypeaheadItem-only page loads nothing new: verified (diff; +0 B measured locally).
- Another component's option that renders TypeaheadItem gets no mark: verified (test).
- The quoted TypeaheadItem FR2 and BaseTypeahead FR19, their verification rows,
verified_by, AR1 and each listed record row: verified (every listed row is edited and says the same). - The
isDisabledJSDoc and the docs (three variants) describe it the same way: verified; default-rendering note. - Red first (six cases fail on the base branch and pass here, plus one TypeaheadItem case): verified locally; the sixth also failing on the previous head, and the last three on an earlier head: reported.
- Suite counts at this head (35 files, 1,178 tests), the Chat suite, earlier-head counts, the slow Tokenizer case, strict ESLint, core typecheck and the knowledge check: reported; locally 35 files and 1,179 tests pass, ESLint on the changed files and the core build's typecheck are clean; CI has not run lint, typecheck or tests on this head yet.
- Chrome stills from an earlier head, and that later heads change where the mark is set but not what renders: reported; consistent with Chromium 158 frames taken locally on this head.
- Size (Typeahead page +125 to +139 B gzip, TypeaheadItem-only page +0, other pages +0, within the 0.3 KB allowance): verified locally on this head (+139 B, +0, +0).
- Records (the disabled-control rules quoted; the mechanism chosen by the spec owners; within 0.3 KB on this head): quotes verified; owner choice reported (an owner's spec approval is recorded for this head); size verified locally.
- Writing rubric results and the list of records touched: verified.
- Scope (JSDoc and docs, BaseTypeahead's row mark and pick path, two test files, two records, a changeset): verified, all eight files.
- No public API change: verified (API generator over the built packages, 0 rows).
- Public text contains no internal context: verified.
- Overlap with #11733 (a draft; rewrites the Enter and option-click lines; one text conflict; its grid rows will need the same mark): draft and grid-row note verified; "one text conflict" false (four conflict regions); work-lane attribution unverified.
- #11526 (controlled query API; no shared lines): verified, no line is changed by both; its import change still conflicts textually beside this pull request's new test import.
- #4329 (Tokenizer delimiter splitting; no shared lines): verified; its conflicts come from
main, not from this pull request's lines. - Land path: reported.
.changeset/typeahead-disabled-result.md: default-rendering note.docs/specs/components/Typeahead/BaseTypeahead.spec.md: clear; conflicts withmain.docs/specs/components/Typeahead/TypeaheadItem.spec.md: non-blocking row-wording note.packages/core/src/Typeahead/BaseTypeahead.test.tsx: clear; conflicts withmain.packages/core/src/Typeahead/BaseTypeahead.tsx: clear; the last review's code findings are fixed.packages/core/src/Typeahead/TypeaheadItem.doc.mjs: default-rendering note.packages/core/src/Typeahead/TypeaheadItem.test.tsx: clear.packages/core/src/Typeahead/TypeaheadItem.tsx: default-rendering note in the JSDoc.
| * Whether this item is disabled. | ||
| * Whether this item is disabled. A disabled item is dimmed. When a | ||
| * Typeahead result renders as this item (`renderItem` returns it, or the | ||
| * default rendering), its option is also announced as disabled and is never |
There was a problem hiding this comment.
Non-blocking: the default rendering (BaseTypeahead.tsx:2356) never passes isDisabled, so "or the default rendering" names a path that can never mark a result. Drop it here, in the three TypeaheadItem.doc.mjs entries and in the changeset, or say a disabled result needs renderItem.
There was a problem hiding this comment.
Approved pending CI. The title now limits the fix to a TypeaheadItem in its usual layout and the overlap note names the three files a merge with #11733 conflicts in, which clears both findings from the last review; the code is unchanged, and the disabled-result tests pass on this head (reproduced locally, including a shadow root and a grouped list).
CI has not run on this head yet: the branch conflicts with main in BaseTypeahead.spec.md (the FR18 rows beside the new FR19 rows) and BaseTypeahead.test.tsx, so the next step is merging main, which lets CI run and needs a fresh review of that head.
Smaller points, none blocking:
- "(or the default rendering)" in the changeset, the After line, the
isDisabledJSDoc and the three doc entries names a path that never passesisDisabled(BaseTypeahead.tsx:2356). - The Availability and Disabled state rows of the TypeaheadItem record still leave out "as a Typeahead result", which FR2 states.
- The suite count at this head is 1,179 tests, not 1,178 (the
element: falsecase is the extra one).
Claims and files checked
Review mode: same-head; reason: none
- Title (live: "fix(Typeahead): a Typeahead result that renderItem returns as a TypeaheadItem with isDisabled, in its usual layout, is announced as disabled and never picked"): verified; an item with no truthy
elementis marked and never picked (new tests; local probe in a shadow root and a grouped list), and a truthyelement, drawn as that element, is outside the usual-layout bound. - Changeset (a result
renderItemreturns directly, in its usual layout, notitem.element: announced as disabled; Enter, click or tap picks nothing; the list stays open, also in a shadow root; no hover highlight; arrow keys still reach it): verified by the new tests and a local probe; "or the default rendering" can never apply (non-blocking). - Who: context, consistent with the code.
- Before (only dimmed, announced as ordinary, still picked): verified; the six new cases fail on the base branch (the previous review's local run on this head).
- After: verified, with the changeset's bound; same default-rendering note.
- Unchanged (arrow keys reach a disabled result, as DropdownMenu's disabled rows are reached and inert; results without
isDisabledas before;item.elementhas no disabled state; a custom or wrappedrenderItemis only dimmed; another component's option is only dimmed): verified from the code, the tests, the DropdownMenu record and a local probe. - BaseTypeahead marks the option in its row loop for a TypeaheadItem with
isDisabledand no truthyitem.element, with no Effect and no DOM query; keeps the options by row;handleSelect(item, index)reads the row at pick time with the shared disabled check, in a shadow root and with shared ids, through one path for Enter, click and tap; a press keeps focus in the input; a pointer move does not highlight it: verified (code, tests and a local probe). - TypeaheadItem is unchanged apart from its JSDoc, reads no context and sets no attribute, so a TypeaheadItem-only page loads nothing new: verified (diff; +0 B measured locally).
- Another component's option that renders TypeaheadItem gets no mark: verified (test).
- The quoted TypeaheadItem FR2 and BaseTypeahead FR19, their verification rows,
verified_by, AR1 and each listed record row saying the same: verified; every listed row states the mark, and two leave the Typeahead-result scope to FR2 (non-blocking). - The
isDisabledJSDoc and the docs (three variants) describe it the same way: verified; default-rendering note. - Red first (six cases fail on the base branch and pass here, plus one TypeaheadItem case): the six pass here and fail on the base branch (local runs); the sixth also failing on the previous head, and the last three on an earlier head: reported.
- Suite counts at this head (35 files, 1,178 tests), the Chat suite, earlier-head counts, the slow Tokenizer case, strict ESLint, core typecheck and the knowledge check: reported; locally 35 files and 1,179 tests pass and ESLint and the core build's typecheck are clean; CI has not run them on this head.
- Branded Chrome stills at this head (base and head, pointer and arrow keys on Ben): reported; the published stills and their report match the code and Chromium frames taken locally on this head.
- Size (Typeahead page +125 to +139 B gzip, TypeaheadItem-only page +0, other pages +0, module graph and chunks unchanged, within the 0.3 KB allowance): verified locally on this head (+139 B, +0, +0, unchanged); the minified figure is reported.
- Records (the disabled-control rules quoted; the mechanism chosen by the spec owners; within 0.3 KB): quotes verified; owner choice reported, with an owner's spec approval recorded for this head; size verified.
- Writing rubric results and the list of records touched: verified.
- Scope (JSDoc and docs, BaseTypeahead's row mark and pick path, two test files, two records, a changeset): verified, all eight files.
- No public API change: verified (API generator over the built packages, 0 rows).
- Public text contains no internal context: verified.
- Overlap with #11733 (a draft; a trial merge conflicts in three files:
BaseTypeahead.tsxin the Enter and option-click lines and the option row,BaseTypeahead.spec.md, and the option-actions record; its grid rows will need the same mark and row read): verified by a three-way merge; the work-lane attribution is unverified. - #11526 (controlled query API; no shared lines): verified, no line is changed by both; its import change still conflicts textually beside this pull request's new test import.
- #4329 (Tokenizer delimiter splitting; no shared lines): verified; its conflicts come from
main, not from this pull request's lines. - Land path: reported.
.changeset/typeahead-disabled-result.md: default-rendering note.docs/specs/components/Typeahead/BaseTypeahead.spec.md: clear; conflicts withmain.docs/specs/components/Typeahead/TypeaheadItem.spec.md: non-blocking row-wording note.packages/core/src/Typeahead/BaseTypeahead.test.tsx: clear; conflicts withmain.packages/core/src/Typeahead/BaseTypeahead.tsx: clear.packages/core/src/Typeahead/TypeaheadItem.doc.mjs: default-rendering note.packages/core/src/Typeahead/TypeaheadItem.test.tsx: clear.packages/core/src/Typeahead/TypeaheadItem.tsx: default-rendering note in the JSDoc.
…-result # Conflicts: # docs/specs/components/Typeahead/BaseTypeahead.spec.md # packages/core/src/Typeahead/BaseTypeahead.test.tsx
|
/approve-spec 9b4ef19 |
There was a problem hiding this comment.
Approved. A disabled TypeaheadItem that renderItem returns in its usual layout is now exposed as disabled, and click, tap and Enter on it pick nothing while the list stays open. Reproduced locally: the six new cases fail on the base and pass on this head, a Chromium check shows the click, Enter and hover change, and CI passes on this head. None of the notes below blocks.
- "or the default rendering" names a path that is never disabled: the default rendering never passes
isDisabled, so drop the parenthetical from the changeset, theisDisabledJSDoc, the three doc entries and the description's After line (which also drops "withisDisabled"), or say that a disabled result needsrenderItem. - The description's test count is stale: run locally, Typeahead, Tokenizer and PowerSearch have 35 files and 1,224 tests at this head, not 1,178.
- The row check splits a comment from its code: in
handleSelect, move the disabled-row check above the focus-list comment, beside the field'sisDisabledguard.
Claims and files checked
Review mode: full; reason: recipe-changed (many rules)
- Title: a disabled TypeaheadItem result in its usual layout is announced as disabled and never picked: verified (the row mark and the single pick path in
BaseTypeahead.tsx, the six new tests, a shadow-root case and a Chromium check, run locally). - Changeset: announced as disabled; Enter, click or tap picks nothing and the list stays open, also in a shadow root; no pointer highlight; arrow keys still reach it: verified. "Or the default rendering": true as worded but never reachable (note).
- Description, user impact: the old behavior (dimmed only, still picked): verified on the base locally. The new behavior and each unchanged case (
item.element, a wrapped or customrenderItem, another component's option, results withoutisDisabled, arrow keys): verified by the code and the tests. The After line drops "withisDisabled" (note). - Description, what changed: the row mark with no Effect or DOM query; the per-row read at pick time, in a shadow root and with shared ids; one path for Enter, click and tap; a press keeps focus; no hover highlight;
TypeaheadItem.tsxchanges only its JSDoc and marks no other host's option; the quoted record wording; the docs in all three forms; a fix changeset: verified. - Description, evidence: the six cases fail on the base and pass here: verified locally. Earlier-head runs, the Chat suite and the Chrome stills: reported, consistent with the local and CI results. 35 files and 1,178 tests: reported, stale (1,224 locally). Lint and type check: pass in CI; the knowledge check passes locally. Size +125 to +139 B: reported; +123 B measured locally, a TypeaheadItem-only page and the four reference pages +0. The disabled-control requirements cited: verified.
- Description, scope and rubric: eight files, no public API change (zero rows between the built base and head surfaces), no internal context, rubric results present: verified.
- Overlap: three conflicting files with the result-actions draft: verified by a trial merge. No shared lines with the controlled-query and delimiter pull requests: verified; an import beside one of this change's imports conflicts with no shared line.
- Files:
BaseTypeahead.tsxnote (guard placement);BaseTypeahead.test.tsxclear;TypeaheadItem.test.tsxclear;TypeaheadItem.tsxnote (default rendering);TypeaheadItem.doc.mjsnote (default rendering);.changeset/typeahead-disabled-result.mdnote (default rendering);TypeaheadItem.spec.mdclear;BaseTypeahead.spec.mdclear.
| const pickedIndex = displayedResults.findIndex( | ||
| other => other.id === item.id, | ||
| ); | ||
| const option = optionElementsRef.current[index]; |
There was a problem hiding this comment.
Miss (non-blocking): this check now sits between the focus-list comment and pickedIndex above and the keepsFocusList code that comment describes. Move these four lines up beside the isDisabled guard so the comment stays with its code.
User impact
TypeaheadItemandisDisabled.renderItemreturns it directly, or the default rendering; notitem.element) is announced as disabled. Enter, click or tap on it picks nothing, and the list stays open, also when the Typeahead renders inside a shadow root. The pointer gives it no hover highlight.spec:AST-085leaves arrow order to the composite (the same as DropdownMenu's "reached and inert"). Results withoutisDisabledbehave as before. An item that setsitem.elementrenders that element as is, in place of TypeaheadItem's layout, so it has no disabled state (not even dimming). The same is true of a customrenderItemthat does not use TypeaheadItem, or that wraps it in other markup: that result is only dimmed. Those apps keep their ownonChangeguard. TypeaheadItem inside another component's option, such as the chat composer's trigger menu, is only dimmed, as before.What changed
BaseTypeahead.tsx: in its row loop, each option whose content is aTypeaheadItemelement withisDisabled(and no truthyitem.element, the same test TypeaheadItem uses, soelement: falsestill counts) getsaria-disabled="true", read from the element BaseTypeahead renders, with no Effect and no DOM query. Each rendered option is kept by row in a ref.handleSelect(item, index)reads that row's disabled state with the sharedisDisabledControlwhen the pick happens, never a value cached at render, and returns. So the read works inside a shadow root, and when two results share an id. This covers Enter, click and tap through one path. A press on a disabled option keeps focus in the input, so the list stays open, and a pointer move over it does not move the highlight.TypeaheadItem.tsxis unchanged apart from itsisDisabledJSDoc. It reads no context and sets no attribute, so a page that renders TypeaheadItem without Typeahead loads nothing new (see Size). Another component that renders TypeaheadItem in its own option, such as the chat composer's trigger menu, gets no mark, because that host does not refuse the pick.component:TypeaheadItemFR2: "The root carries thetypeahead-itemtarget;isDisableddims it. When a Typeahead result renders as a disabled TypeaheadItem, withoutitem.element, BaseTypeahead marks that optionaria-disabledand the option is never picked. Elsewhere, including inside other markup thatrenderItemreturns, or withitem.element, nothing is marked." Its verification row andverified_byfollow. AR1 names the disabled mark as the one state a Typeahead result's option takes from the item. The Behavior, Compatibility and Review checks rows, the Availability concept row, the Disabled state row, the compatibility class and the PR1/AR1 verification row say the same.component:BaseTypeaheadFR19, which owns selection: "A pick (Enter, click or tap) does nothing on an option markedaria-disabledbecause its result renders as a disabled TypeaheadItem (component:TypeaheadItemFR2), and a pointer move over it does not move the highlight." Its verification row cites the BaseTypeahead cases.TypeaheadItem.tsxJSDoc andTypeaheadItem.doc.mjs(en, zh, dense) describeisDisabledthe same way.[fix]changeset.Evidence
Red first:
BaseTypeahead.test.tsx"a disabled TypeaheadItem result" has 6 cases, all failing onmainand passing here, plus one TypeaheadItem case. The sixth, "marks a result whose element is false, which TypeaheadItem lays out as usual", also fails on3cb4e1f2.isDisabledoff makes it pickable again.TypeaheadItem.test.tsx"marks no option outside a Typeahead result list": an option of another host is not marked.The last three also fail on this pull request's earlier head.
At this head, Typeahead, Tokenizer and PowerSearch pass, 35 files and 1,178 tests. All of
Chat, which includes ChatComposerInput, passes 27 files and 521 tests (Linux, fresh install).At an earlier head, Typeahead, Tokenizer and PowerSearch passed 1177 tests. Typeahead, ChatComposerInput and PowerSearch pass 990 at the latest head. One long Tokenizer sheet case takes 10 to 20 s on a loaded machine, on
maintoo. Strict eslint, coretscandcheck:knowledgeare clean.Branded Chrome stills at this head: Google Chrome 158.0.8127.37 on macOS, in a one-off public Actions run. It built Storybook at this head (
9b4ef198) and at its merge base withmain(0d0c1734), each with the same throwaway story: one Typeahead whose results are Ada, Ben (disabled), Cleo and Dan. The run typed into it and rested the pointer on Ben, then moved the pointer away and used the arrow keys. It used DPR 2 and reduced motion.0d0c1734)Size (
pnpm size:pages --base <merge base 5f9d5ee7> --page typeahead=Typeahead --page typeahead-item=Typeahead:TypeaheadItem --unused-on typeahead,typeahead-item, at3cb4e1f2): the Typeahead page grows +125 to +139 B gzip (+315 B min; two builds, the higher on a fresh Linux install), from the row's element check, under INV10's 307 B (PASS). The module graph and chunks are unchanged on every page. A page that renders TypeaheadItem alone is +0 B (PASS); an earlier head added 508 B there through an option context, which this head removes. The docs, form, menu and table pages are +0.Records:
spec:AST-085FR2 (a disabled control blocks every change) and FR5 (the disabled state is exposed on the element). The mechanism (BaseTypeahead marks the option of a result that renders as a disabled TypeaheadItem, with no new public API) was chosen by the specification owners, and kept within INV10's 0.3 KB at this head.Writing rubric results
Records touched:
component:TypeaheadItem(FR2, AR1, the Behavior, Compatibility and Review checks rows, the Availability concept row, the Disabled state row, the compatibility class, two verification rows,verified_by) andcomponent:BaseTypeahead(FR19 and its verification row).Scope
isDisabledJSDoc and docs, BaseTypeahead's row mark and pick path, two test files (BaseTypeahead.test.tsx,TypeaheadItem.test.tsx), two records (component:TypeaheadItem,component:BaseTypeahead), and a changeset.Overlap checked: #11733 (lane 1's Typeahead result actions, a draft; a trial merge conflicts in three files:
BaseTypeahead.tsx, where both rewrite the Enter and option-click lines and the option row,BaseTypeahead.spec.mdandspec:AST-058's record; whichever merges second resolves them, and #11733's grid rows then need the same disabled mark and row read)Also checked: #11526 (mvanhorn, a controlled query API in BaseTypeahead and its tests; no shared lines) and #4329 (Tokenizer delimiter splitting; no shared lines). Whichever merges second merges main.
Land path: CodeBunny approval of the exact head, Specs stamp, CI, then the merge queue.