Skip to content

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

Open
cixzhang wants to merge 11 commits into
mainfrom
l0/typeahead-disabled-result

Conversation

@cixzhang

@cixzhang cixzhang commented Nov 15, 2026 •

Copy link
Copy Markdown
Contributor

User impact

  • Who: people picking from a Typeahead whose app shows some results as unavailable, for example people who already have access in a share dialog, rendered with TypeaheadItem and isDisabled.
  • Before: a disabled result was only dimmed. A screen reader didn't say it was unavailable, and Enter, click or tap still picked it, so apps refused the pick in their own code.
  • After: a result that renders as a TypeaheadItem in its usual layout (renderItem returns it directly, or the default rendering; not item.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.
  • Unchanged: arrow keys still reach a disabled result and it can still take the keyboard highlight, as spec:AST-085 leaves arrow order to the composite (the same as DropdownMenu's "reached and inert"). Results without isDisabled behave as before. An item that sets item.element renders 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 custom renderItem that does not use TypeaheadItem, or that wraps it in other markup: that result is only dimmed. Those apps keep their own onChange guard. 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 a TypeaheadItem element with isDisabled (and no truthy item.element, the same test TypeaheadItem uses, so element: false still counts) gets aria-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 shared isDisabledControl when 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.tsx is unchanged apart from its isDisabled JSDoc. 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:TypeaheadItem FR2: "The root carries the typeahead-item target; isDisabled dims it. When a Typeahead result renders as a disabled TypeaheadItem, without item.element, BaseTypeahead marks that option aria-disabled and the option is never picked. Elsewhere, including inside other markup that renderItem returns, or with item.element, nothing is marked." Its verification row and verified_by follow. 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:BaseTypeahead FR19, which owns selection: "A pick (Enter, click or tap) does nothing on an option marked aria-disabled because its result renders as a disabled TypeaheadItem (component:TypeaheadItem FR2), and a pointer move over it does not move the highlight." Its verification row cites the BaseTypeahead cases.
  • TypeaheadItem.tsx JSDoc and TypeaheadItem.doc.mjs (en, zh, dense) describe isDisabled the same way.
  • [fix] changeset.

Evidence

  • Red first: BaseTypeahead.test.tsx "a disabled TypeaheadItem result" has 6 cases, all failing on main and passing here, plus one TypeaheadItem case. The sixth, "marks a result whose element is false, which TypeaheadItem lays out as usual", also fails on 3cb4e1f2.

    • The result is announced disabled; click, tap and Enter pick nothing; the list stays open; arrow keys reach it; the next result is still picked.
    • Turning isDisabled off makes it pickable again.
    • It takes no hover highlight.
    • When two results share an id, the pick reads the mark from the row it acts on.
    • Inside a shadow root, a click on it picks nothing.
    • 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 main too. Strict eslint, core tsc and check:knowledge are 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 with main (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.

    Main (0d0c1734) This head
    Pointer resting on Ben (disabled) Ben takes the hover highlight and is the active result Ben takes no hover highlight; Ada stays active
    Arrow keys on Ben the arrow keys still reach Ben, the same as on main
  • Size (pnpm size:pages --base <merge base 5f9d5ee7> --page typeahead=Typeahead --page typeahead-item=Typeahead:TypeaheadItem --unused-on typeahead,typeahead-item, at 3cb4e1f2): 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-085 FR2 (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) and component:BaseTypeahead (FR19 and its verification row).

  • R1 narration: none. TypeaheadItem FR2 and AR1, and BaseTypeahead FR19, state what a disabled item does and its limit, in the present tense.
  • R2 research: none.
  • R3 evidence: the verification row names the test cases.
  • R4 rejected alternatives: none added.
  • R5 change references: none.
  • R6 open questions: none touched.
  • R7 project status: none.

Scope

  • TypeaheadItem's isDisabled JSDoc 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.
  • No public API change.
  • Public text contains no internal context.

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.md and spec: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.

…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.
@vercel

vercel Bot commented Nov 15, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
astryx Ready Ready Preview Dec 2, 2026 10:59pm UTC

Request Review

@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Meta Open Source bot. label Nov 15, 2026
@astracat-bot

astracat-bot Bot commented Nov 15, 2026 •

Copy link
Copy Markdown
Contributor

AI review status for this pull request.

Review status Updated
🟢 Reviewed (for maintainers only) Dec 3, 2026, 6:20 AM UTC

@github-actions github-actions Bot added the needs:spec-owner-review Current knowledge records await owner approval label Nov 15, 2026
@cixzhang

Copy link
Copy Markdown
Contributor Author

/approve-spec 6c2436b

@github-actions

github-actions Bot commented Nov 15, 2026 •

Copy link
Copy Markdown
Contributor

PR Analysis Report

🔎 Preview · 9b4ef19

Storybook · Sandbox · built from this PR's head

Modified components

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

@github-actions github-actions Bot removed the needs:spec-owner-review Current knowledge records await owner approval label Nov 15, 2026

@astracat-bot astracat-bot Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 handleSelect looks the option up with the owner document's getElementById (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), which spec:AST-085 FR6 rules out for a disabled control; skip it for a marked option and keep arrow-key reach.
  • isOptionDisabled (BaseTypeahead.tsx:588) duplicates the shared isDisabledControl in utils/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 isDisabled behave 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).
  • handleSelect reads 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-expanded assertions).
  • The record's FR2, its verification row and verified_by change, 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 and item.element (first finding).
  • docs/specs/components/Typeahead/TypeaheadItem.spec.md: AR1 and two rows contradict FR2 (blocking); item.element limit (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.element limit (non-blocking).

Automated review (maintainer link)

@cixzhang cixzhang added the lane:0 routing lane 0 label Nov 21, 2026
…-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
@github-actions github-actions Bot added the needs:spec-owner-review Current knowledge records await owner approval label Dec 1, 2026
@cixzhang

cixzhang commented Dec 1, 2026

Copy link
Copy Markdown
Contributor Author

🤖 (Posted by Cindy's agent.)

Thanks. At 14e0f24c, main is merged in, and the four points are addressed:

  • Shadow root and shared ids: the option elements are kept by row in a ref. handleSelect(item, index) reads the row it acts on, with no getElementById.
  • Hover: a pointer move over a disabled option does not move the highlight.
  • isDisabledControl: the shared helper replaces the local copy.
  • The record: AR1 now names the disabled mark. The Behavior, Compatibility and Review checks rows, and the PR1/AR1 verification row, match.

Three new cases cover the first two points. They fail on the earlier head and pass here.

@cixzhang cixzhang added the ci:run-a11y Run the accessibility suite on this PR; write access, next push (AST-030 FR12) label Dec 1, 2026
@cixzhang

cixzhang commented Dec 1, 2026

Copy link
Copy Markdown
Contributor Author

/approve-spec 14e0f24

@github-actions github-actions Bot removed the needs:spec-owner-review Current knowledge records await owner approval label Dec 1, 2026

@astracat-bot astracat-bot Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.element is never marked and is still picked, because TypeaheadItem returns that element before the root that carries the marking ref (TypeaheadItem.tsx:173-176), so name that limit in the changeset, the isDisabled JSDoc 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 the aria-disabled mark 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 reading TypeaheadItem.tsx:151-164 and BaseTypeahead.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 reading BaseTypeahead.tsx:1705-1708, :2085 and :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 isDisabled behave 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 (handleSelect has two callers, Enter at :2085 and option click at :2358, and the only two onChange(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_by change: 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 for item.element (first finding).
  • docs/specs/components/Typeahead/TypeaheadItem.spec.md: FR2 lacks the item.element limit (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 an item.element result.
  • packages/core/src/Typeahead/TypeaheadItem.tsx: the isDisabled JSDoc overclaims for item.element (first finding).

Automated review (maintainer link)

… the record's compatibility, concept and state rows say what a disabled item does
@cixzhang

cixzhang commented Dec 1, 2026

Copy link
Copy Markdown
Contributor Author

🤖 (Posted by Cindy's agent.)

Thanks. At 7270ae23, an item.element result is described as having no disabled state, the same as a custom renderItem without TypeaheadItem. That element renders in place of TypeaheadItem's layout, so there is no node to mark the option from. This change is in the isDisabled JSDoc, the docs (en, zh, dense), FR2 and the changeset. The record's compatibility class, the Availability concept row and the Disabled state row now say what a disabled item does. There is no code change.

@github-actions github-actions Bot added the needs:spec-owner-review Current knowledge records await owner approval label Dec 1, 2026
@cixzhang

cixzhang commented Dec 1, 2026

Copy link
Copy Markdown
Contributor Author

/approve-spec 7270ae2

@github-actions github-actions Bot removed the needs:spec-owner-review Current knowledge records await owner approval label Dec 1, 2026

@astracat-bot astracat-bot Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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: TypeaheadItem marks whichever role="option" holds it (TypeaheadItem.tsx:157-161), so a ChatComposerInput trigger row rendered with TypeaheadItem isDisabled is now announced as disabled while a press, Enter or Tab still inserts it (Chat/useTriggerMenu.tsx:851-861, :957-960), against spec:AST-085 FR2 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.element limit 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 isDisabled in 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 reading BaseTypeahead.tsx:1705-1708, :2085, :2348-2370 and TypeaheadItem.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.element result (second finding); otherwise as for the changeset.
  • Unchanged, arrow keys still reach a disabled result and it can take the keyboard highlight, results without isDisabled behave as before, and item.element or a custom renderItem without 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 (handleSelect has two callers, Enter at :2085 and option click at :2358, and the only two onChange(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.element as 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 isDisabled JSDoc 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).

Automated review (maintainer link)

…mark, so another host's option is never announced disabled while it still picks
@cixzhang cixzhang changed the title fix(Typeahead): a disabled TypeaheadItem result is announced as disabled and never picked fix(Typeahead): a disabled TypeaheadItem result is announced as disabled and never picked; another host's option is not marked Dec 1, 2026
@cixzhang

cixzhang commented Dec 1, 2026

Copy link
Copy Markdown
Contributor Author

🤖 (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 item.element. Its Scope line counts two test files and two records. The head is the same (d0cbf925): only the description changed. On the considerations: TypeaheadItem.tsx already starts with 'use client'. BaseTypeahead refuses any option marked aria-disabled because a disabled option must not be picked, whoever marks it.

@astracat-bot astracat-bot Bot left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 isDisabled is announced as disabled and never picked: verified (reproduced locally in Chromium and in the head's tests; an item.element result 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 main in 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 isDisabled behave as before: verified (unmarked options take the same press, click and hover paths).
  • Description, an item.element item and a custom renderItem without 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 is BaseTypeahead.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 isDisabled the same way: verified.
  • Description, a fix changeset: verified.
  • Description, five new BaseTypeahead cases fail on main and pass here, plus one TypeaheadItem case: verified (run locally: 5 fail on main, 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.

Automated review (maintainer link)

@cixzhang
cixzhang marked this pull request as ready for review December 1, 2026 06:11

@astracat-bot astracat-bot Bot left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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-29 and :155-170) adds 508 B gzip of first-load JavaScript to a page that renders TypeaheadItem without isDisabled, over the 0.3 KB that architecture:component-import-boundaries INV10 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, custom renderItem, 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 custom renderItem without 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 isDisabled JSDoc 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.

Automated review (maintainer link)

…s option, so TypeaheadItem loads no option context
@cixzhang

cixzhang commented Dec 2, 2026

Copy link
Copy Markdown
Contributor Author

🤖 (Posted by Cindy's agent.)

Thanks. At 3cb4e1f2, BaseTypeahead marks the option itself in its row loop: an option whose content is a TypeaheadItem element with isDisabled (and no item.element) gets aria-disabled. TypeaheadItem is unchanged apart from its JSDoc, and the option context is gone.

pnpm size:pages against the merge base 5f9d5ee7:

  • a page that renders TypeaheadItem alone is +0 B;
  • the Typeahead page is +125 B gzip.

Both pass INV10's 307 B. The records, docs and changeset now say that a renderItem which wraps TypeaheadItem in other markup gets dimming only. Typeahead, Tokenizer and PowerSearch pass, 35 files and 1,178 tests.

@cixzhang

cixzhang commented Dec 2, 2026

Copy link
Copy Markdown
Contributor Author

/approve-spec 3cb4e1f

@astracat-bot astracat-bot Bot left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 element is falsy (false, which element: cond && <X /> gives, '' or 0) still draws TypeaheadItem's dimmed layout, but isDisabledTypeaheadItem treats only null and undefined as "no element" (BaseTypeahead.tsx:626, against if (item.element) at TypeaheadItem.tsx:160), so that option is not marked and a click picks it; use the same !item.element test (ideally one shared helper) and add an element: false case.
  • The title says "a Typeahead result drawn by TypeaheadItem with isDisabled is announced as disabled and never picked", but a renderItem that wraps TypeaheadItem (for example in a Tooltip that 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.
  • isDisabledTypeaheadItem and its JSDoc sit between BaseTypeahead's JSDoc and export const BaseTypeahead, so the published BaseTypeahead declaration 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 renderItem and for a falsy item.element (local probe).
  • Changeset (a result that renderItem returns 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 falsy item.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 wrapped renderItem and 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 isDisabled JSDoc and docs (three variants) describe the behavior the same way: consistent, but false for a falsy item.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 falsy item.element (first finding).
  • docs/specs/components/Typeahead/BaseTypeahead.spec.md: clear; conflicts with main.
  • docs/specs/components/Typeahead/TypeaheadItem.spec.md: FR2 and AR1 false for a falsy item.element until the code changes; non-blocking wording note.
  • packages/core/src/Typeahead/BaseTypeahead.test.tsx: clear; add the element: false case with the fix; conflicts with main.
  • packages/core/src/Typeahead/BaseTypeahead.tsx: first and fourth findings; non-blocking comment note.
  • packages/core/src/Typeahead/TypeaheadItem.doc.mjs: false for a falsy item.element (first finding).
  • packages/core/src/Typeahead/TypeaheadItem.test.tsx: clear.
  • packages/core/src/Typeahead/TypeaheadItem.tsx: JSDoc false for a falsy item.element (first finding).

Automated review (maintainer link)

| -------------- | ------------------------------ | --------------------------------------------------- | -------------- | -------------- | --------- | --------- | ---------------------- |
| 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. |

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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
@cixzhang cixzhang changed the title fix(Typeahead): a Typeahead result drawn by TypeaheadItem with isDisabled is announced as disabled and never picked fix(Typeahead): a Typeahead result that renderItem returns as a TypeaheadItem with isDisabled is announced as disabled and never picked Dec 2, 2026
@cixzhang

cixzhang commented Dec 2, 2026

Copy link
Copy Markdown
Contributor Author

/approve-spec 3c16d0b

@cixzhang

cixzhang commented Dec 2, 2026

Copy link
Copy Markdown
Contributor Author

🤖 (Posted by Cindy's agent.)

Thanks. At 3c16d0ba:

  • The element check: isDisabledTypeaheadItem uses TypeaheadItem's own !item.element test, so element: false or '' is marked. A new case, "marks a result whose element is false…", fails on 3cb4e1f2.
  • The helper now sits above BaseTypeahead's JSDoc.
  • Title and description: the title is narrowed to a result that renderItem returns as a TypeaheadItem, and the Scope and Records lines describe BaseTypeahead's mark.
  • Branded Chrome stills at this head are in the description.

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…").

@astracat-bot astracat-bot Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 renderItem returns as a TypeaheadItem with isDisabled "is announced as disabled and never picked", but when that item sets a truthy item.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, its onMouseMove and 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 renderItem returns directly, in its usual layout, not item.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 isDisabled as before; item.element has no disabled state; a custom or wrapped renderItem is 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 isDisabled and no truthy item.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 isDisabled JSDoc 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 with main.
  • docs/specs/components/Typeahead/TypeaheadItem.spec.md: non-blocking row-wording note.
  • packages/core/src/Typeahead/BaseTypeahead.test.tsx: clear; conflicts with main.
  • 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.

Automated review (maintainer link)

* 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

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@cixzhang cixzhang changed the title fix(Typeahead): a Typeahead result that renderItem returns as a TypeaheadItem with isDisabled is announced as disabled and never picked fix(Typeahead): a Typeahead result that renderItem returns as a TypeaheadItem with isDisabled, in its usual layout, is announced as disabled and never picked Dec 2, 2026

@astracat-bot astracat-bot Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 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", which FR2 states.
  • The suite count at this head is 1,179 tests, not 1,178 (the element: false case 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 element is marked and never picked (new tests; local probe in a shadow root and a grouped list), and a truthy element, drawn as that element, is outside the usual-layout bound.
  • Changeset (a result renderItem returns directly, in its usual layout, not item.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 isDisabled as before; item.element has no disabled state; a custom or wrapped renderItem is 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 isDisabled and no truthy item.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 isDisabled JSDoc 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.tsx in 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 with main.
  • docs/specs/components/Typeahead/TypeaheadItem.spec.md: non-blocking row-wording note.
  • packages/core/src/Typeahead/BaseTypeahead.test.tsx: clear; conflicts with main.
  • 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.

Automated review (maintainer link)

…-result

# Conflicts:
#	docs/specs/components/Typeahead/BaseTypeahead.spec.md
#	packages/core/src/Typeahead/BaseTypeahead.test.tsx
@cixzhang

cixzhang commented Dec 2, 2026

Copy link
Copy Markdown
Contributor Author

/approve-spec 9b4ef19

@astracat-bot astracat-bot Bot left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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, the isDisabled JSDoc, the three doc entries and the description's After line (which also drops "with isDisabled"), or say that a disabled result needs renderItem.
  • 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's isDisabled guard.
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 custom renderItem, another component's option, results without isDisabled, arrow keys): verified by the code and the tests. The After line drops "with isDisabled" (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.tsx changes 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.tsx note (guard placement); BaseTypeahead.test.tsx clear; TypeaheadItem.test.tsx clear; TypeaheadItem.tsx note (default rendering); TypeaheadItem.doc.mjs note (default rendering); .changeset/typeahead-disabled-result.md note (default rendering); TypeaheadItem.spec.md clear; BaseTypeahead.spec.md clear.

Automated review (maintainer link)

const pickedIndex = displayedResults.findIndex(
other => other.id === item.id,
);
const option = optionElementsRef.current[index];

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@cixzhang cixzhang closed this Dec 3, 2026
@cixzhang cixzhang reopened this Dec 3, 2026

This branch was successfully deployed

1 active deployment
Preview — 9b4ef198 Deployed Dec 2, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci:run-a11y Run the accessibility suite on this PR; write access, next push (AST-030 FR12) CLA Signed This label is managed by the Meta Open Source bot. lane:0 routing lane 0 needs:design-review Affects visuals — Design should review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant