Skip to content

feat(Tokenizer): forward BaseTypeahead's menu, onOpenChange and open handle - #10624

Merged
cixzhang merged 2 commits into
mainfrom
feat/tokenizer-menu
Nov 10, 2026
Merged

cixzhang merged 2 commits into
mainfrom
feat/tokenizer-menu

Conversation

@cixzhang

@cixzhang cixzhang commented Nov 8, 2026 •

Copy link
Copy Markdown
Contributor

Stack: #10544 → #10624 → #10625 → #10847
This stack lands bottom-first as a chain: #10544 merged; #10624 next; then #10625 and #10847 rebased on each merge, each with a fresh spec stamp, CodeBunny review and CI.

Who this helps

People using Tokenizer fields (for example a filter bar whose tokens open an editor). Tokenizer can now use BaseTypeahead's menu (#10544): a token's own button can open a dialog-role menu on the field's anchored layer, and Escape returns focus to that token.

What changed

  • Forwarding: in its inline presentation, Tokenizer forwards menu and onOpenChange to BaseTypeahead; TokenizerHandle gains open() and close().
  • Token focus: Tokenizer keeps focus where a press on a token's own control, or the menu's focus return, put it, instead of redirecting it to the input, so Escape returns focus to the token whose button opened the dialog.
  • Sheet presentation: keeps its own sheet; menu and onOpenChange join its development warning, and the handle's open()/close() do nothing there.
  • Record: component:Tokenizer FR28 and its public-contract line; docs for the new props.

Changeset: [feat] patch for Core.

Verification

  • Tests: BaseTypeahead.menu.test.tsx "Tokenizer forwards the menu, the handle and onOpenChange" and "Escape returns focus to a Tokenizer token whose button opened the dialog" (mouse and keyboard; the second fails without the token-focus change). Tokenizer and PowerSearch suites pass (766).
  • Pointer focus outside tokens (red first): 5 new tests. At the previous head, 2 failed: a press on an endContent button released outside the field, and an endContent click that stops propagation, both left focus on the button instead of the input. The other 3 passed (a completed endContent click; a press on a custom token's own control released outside, or clicked with propagation stopped, keeps focus there). All 5 pass now; the 3 endContent tests also pass against main's Tokenizer. Tokenizer, Typeahead, BaseTypeahead and PowerSearch suites pass (994), and Core typecheck passes.
  • Other checks: knowledge, changesets, and the prepush typecheck.

Writing rubric results

Covers component:Tokenizer FR28 and the public-contract line.

R1 narration: none; FR28 states what Tokenizer does.
R2 research: none in the record.
R3 evidence: the verification cell names tests, not pull requests.
R4 rejected alternatives: none recorded.
R5 pull request or issue references: none added.
R6 open questions: none touched.

@vercel

vercel Bot commented Nov 8, 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 Nov 10, 2026 10:27am UTC

Request Review

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

astracat-bot Bot commented Nov 8, 2026 •

Copy link
Copy Markdown
Contributor

AI review status for this pull request.

Review status Updated
🟢 Reviewed (for maintainers only) Nov 10, 2026, 10:34 AM UTC

@cixzhang

cixzhang commented Nov 8, 2026

Copy link
Copy Markdown
Contributor Author

/approve-spec 91f2921

@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 menu and onOpenChange forwarding and the new open()/close() handle match component:Tokenizer FR28, but both new focus flags need rework before this lands.

  • A press that starts on a token's control and is released outside the field leaves isPressingRef set (Tokenizer.tsx:1541–1549 clears it only on a pointerup inside the field), so the next Tab into the field stops on the first token's Remove button instead of the input; read the shared interaction-modality tracker instead, or end the press wherever it is released, and drop the wrapper's own pointer handlers.
  • handleMenuOpenChange (Tokenizer.tsx:1186–1205) guesses the menu's focus return with document focusin/keydown/pointerdown listeners that outlive an unmount, while the shared focus trap's restoreFocusTo, which BaseTypeahead already uses, marks exactly that focus, so have BaseTypeahead report the return to Tokenizer through that hook and delete the listeners and the flag.

A TokenizerBottomSheet.test.tsx case for the sheet's menu/onOpenChange warning and its no-op open() would also close the test gap FR28 records.

[Automated review]

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

This review waits on an engineering owner's spec decision, and two focus fixes are needed.

component:Tokenizer FR28 is new, and the earlier /approve-spec named the previous commit, whose spec content the base merges have since changed, so it no longer covers this head. An engineering owner records the decision by commenting /approve-spec <full head SHA> on this pull request (the author may, as an engineering owner) or asks for changes to FR28 and its four API rows; FR28 also relies on component:BaseTypeahead FR13–FR16, which land with #10544.

Blocking, whatever the spec decision:

  • A press that starts on a token's control and is released outside the field leaves isPressingRef set (Tokenizer.tsx:1544–1552 clears it only on a pointerup inside the field), so the next Tab into the field stops on the first token's Remove button instead of the input; derive this from the shared useInteractionModalityTracking() or end the press wherever it is released, and drop the wrapper's pointer handlers.
  • handleMenuOpenChange (Tokenizer.tsx:1186–1205) guesses the menu's focus return by arming a flag on every close and clearing it from three document listeners that outlive an unmount; have BaseTypeahead report the return it already performs in restoreFocusTo through a package-internal option, and remove the listeners.

The fixed head needs its own /approve-spec.

[Automated review]

@cixzhang

cixzhang commented Nov 8, 2026

Copy link
Copy Markdown
Contributor Author

/approve-spec 863f6fa

@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: component:Tokenizer FR28 and its four API rows are approved for this head, so the forwarding, the handle and the token-focus direction are settled, but three focus defects in Tokenizer.tsx block.

  • A press on a token's control that is released outside the field leaves isPressingRef set (Tokenizer.tsx:930, :1544–1552), so the next Tab into the field stops on the first token's Remove button instead of the input; keep focus only when the shared modality tracker (useInteractionModalityTracking()) reads 'pointer', or at least clear the flag when focus leaves the field.
  • handleMenuOpenChange (Tokenizer.tsx:1186–1205) arms the focus-return flag on every menu close and clears it with three document listeners, so after a result-list close a focus that reaches a token with no key or press stays there and an unmount leaves the listeners registered until the next focus, key or press; have BaseTypeahead report its focus return (it already passes the focus trap's restoreFocusTo) through a package-internal option and drop the listeners.
  • Miss: in Safari a click does not focus the token's button, so open() never records the token as the opener and Escape returns focus to the input instead of the token that FR28 and the Changeset promise; record the pressed token control as the opener and add a test that clicks without focusing.

Non-blocking: FR28's sheet sentence (the warning for menu and onOpenChange, and open()/close() ignored) has no test.

A fixed head needs a fresh /approve-spec, and this pull request lands only together with #10544 and #10625.

[Automated review]

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

Approval waits on an engineering owner, and two fixes are needed whatever that decision is.

  • component:Tokenizer FR28, its public-contract line and its handle paragraph are new, and the earlier /approve-spec named the previous commit: an engineering owner records the decision by commenting /approve-spec <full head SHA> on this pull request (the author may do so as an engineering owner), or says what to change.
  • BaseTypeahead's new __menuFocusReturnRef is tagged internal but reachable through BaseTypeaheadProps, and no record decides it, so an owner needs to accept it on the public props or ask for it to move behind a non-exported boundary.

Blocking findings:

  • Miss: in Safari, where a click or tap does not focus the token's button, open() records the page or the input as the opener, so Escape returns focus to the input instead of the token that FR28 and the Changeset promise; record the pressed token control as the opener and add a test that clicks without focusing.
  • Miss: FR28, the Changeset and the comment at Tokenizer.tsx:928–929 say focus a press puts on a token's control stays there instead of moving to the input, but handleWrapperClick still moves it to the input when the click completes, so reword them to what holds (focus stays until the click runs, so open() returns focus to that token on Escape).

Fixed since the last review: Tab entry after a press released outside the field lands on the input again, and the menu's focus return now comes from BaseTypeahead instead of document listeners. Non-blocking: FR28's sheet sentence has no test. This pull request lands together with #10544 and #10625.

[Automated review]

Comment thread .changeset/tokenizer-menu.md Resolved
@cixzhang

cixzhang commented Nov 8, 2026

Copy link
Copy Markdown
Contributor Author

/approve-spec 944e86f

@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 spec is approved, and two focus fixes remain.

An engineering owner approved component:Tokenizer FR28 for this head, so the new menu, onOpenChange and handle open()/close() have their governing record, and BaseTypeahead's internal __menuFocusReturnRef was accepted with it.

Blocking findings:

  • Miss: in Safari, where a click or tap does not focus the token's button, open() records the page as the opener, so Escape returns focus to the search input instead of the token that FR28 and the Changeset promise; record the pressed token control as the opener and add a test that clicks without focusing.
  • Miss: FR28, the Changeset and the comment at Tokenizer.tsx:928–929 say focus a press puts on a token's control stays there instead of moving to the input, but handleWrapperClick still moves it to the input when the click completes; make the click handler leave focus on a token's own control, or reword those three to what holds (a reworded FR28 needs a new /approve-spec).

Non-blocking: FR28's sheet sentence has no test. This pull request lands together with #10544 and #10625.

[Automated review]

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

Approval waits on an engineering owner's spec decision, and two fixes are needed whatever that decision is.

component:Tokenizer FR28, its public-contract line and handle paragraph are unchanged, but the new commit ends the earlier approval, and BaseTypeahead's public props now also reach the internal __pressedOpenerRef, which no record decides. An engineering owner records the decision by commenting /approve-spec <full head SHA> on this pull request (the author may do so as an engineering owner), or says what to change.

Blocking findings:

  • In Safari, the blur that a press on a token's button causes clears the pressed control (Tokenizer.tsx:1254) before the click calls open(), so Escape still returns focus to the search input whenever focus was in the field, the usual state after typing or picking a value; keep the pressed control through that blur and add a test that focuses the input before the press.
  • findTokenControl re-declares a focusable selector (Tokenizer.tsx:954–956) instead of using the canonical FOCUSABLE_SELECTOR from hooks/focusableSelector.ts, and the two already differ (a contenteditable or summary control inside a token is missed); import it, or add the click-target variant beside it and import that.

The click fix from the last review holds: a click on a custom token's control now keeps focus there. Non-blocking: in Safari that click leaves focus on the page, and FR28's sheet sentence has no test. This pull request lands together with #10544 and #10625.

[Automated review]

@cixzhang

cixzhang commented Nov 8, 2026

Copy link
Copy Markdown
Contributor Author

/approve-spec 9716e63

@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: an engineering owner approved component:Tokenizer FR28 and BaseTypeahead's two internal props for this head, so the forwarding, the handle and the token-focus direction are settled, and two fixes remain.

  • In Safari, the blur that a press on a token's button causes clears the pressed control (Tokenizer.tsx:1254) before the click calls open(), so Escape returns focus to the search input instead of the token whenever focus was already in the field; keep the pressed control through that blur and add a test that focuses the input before the press.
  • findTokenControl re-declares a focusable selector (Tokenizer.tsx:954–956) instead of using the canonical FOCUSABLE_SELECTOR from hooks/focusableSelector.ts, and the copy already misses contenteditable and summary controls inside a token; import it, or add the click-target variant beside it and import that.

Non-blocking: in Safari a click on a token's control that opens nothing leaves focus on the page, and FR28's sheet sentence has no test. A new commit ends the current spec approval, so the fixed head needs its own /approve-spec. This pull request lands together with #10544 and #10625.

[Automated review]

@cixzhang cixzhang added the ci:run-a11y Run the accessibility suite on this PR; write access, next push (AST-030 FR12) label Nov 8, 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.

Approval waits on an engineering owner's spec decision, and one fix is needed whatever that decision is.

  • component:Tokenizer FR28 (its public-contract line, the handle paragraph and the four Tokenizer API rows) and BaseTypeahead's two internal props __menuFocusReturnRef and __pressedOpenerRef need an engineering owner's approval for this head, since a new commit ends the earlier one: an engineering owner records it by commenting /approve-spec <full head SHA>, and the author may do so as an engineering owner.
  • Regression: a press on a token's control that ends without a click (released outside the field, or a touch that turns into a scroll) leaves that control recorded (Tokenizer.tsx:1572–1574), so a dialog opened from a control outside the field returns focus to the token instead of its opener; record the control while the activating click passes through the field (for example onClickCapture, which handleWrapperClick already clears) and add a test for a press released outside.

The Safari Escape return and the shared focusable selector from the last review are fixed. Non-blocking: in Safari a click on a token's control that opens nothing leaves focus on the page, and FR28's sheet sentence has no test. This pull request lands together with #10544 and #10625.

[Automated review]

@cixzhang

cixzhang commented Nov 8, 2026

Copy link
Copy Markdown
Contributor Author

/approve-spec 8135090

@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 spec is approved for this head, and one focus fix remains.

  • Regression: a press on a token's control that ends without a click (released outside the field, or a touch that turns into a scroll) leaves that control recorded (Tokenizer.tsx:1572–1574), so a dialog later opened from a control outside the field returns focus to that token instead of the control that opened it, against component:Tokenizer FR6; record the control while the activating click passes through the field (for example onClickCapture, which handleWrapperClick already clears) and add a test for a press released outside.

The Chrome-style press broke with the latest commit; the Safari-style and touch forms were already present before it and were missed in the earlier review. An engineering owner approved component:Tokenizer FR28 and BaseTypeahead's two internal props for this head, so a new commit needs a new /approve-spec, and the pull request still lands together with #10544 and #10625. Non-blocking: in Safari a click on a token's control that opens nothing leaves focus on the page, and FR28's sheet sentence has no test.

[Automated review]

@cixzhang

cixzhang commented Nov 9, 2026

Copy link
Copy Markdown
Contributor Author

/approve-spec f74d44d

@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 spec is approved for this head, and one focus fix remains.

  • Miss: a click on a custom token's control whose handler stops propagation (as Core's Token Remove and PowerSearch's filter token do) never bubbles back to handleWrapperClick, so the control recorded at Tokenizer.tsx:1574–1576 survives, and a dialog later opened through the handle from a control outside the field returns focus to that token on Escape, against component:Tokenizer FR6; end the record with the click's task (for example a zero-delay timer set in onClickCapture that clears it if it still holds that control) and add a test with a token control that stops propagation.

A new commit needs a new /approve-spec from an engineering owner, and this pull request lands together with #10544 and #10625. Non-blocking: when a click does not focus the token's button, as in Safari, a click on a control that opens nothing now leaves focus on the page instead of the input; FR28's sheet sentence has no test; and the comment at Tokenizer.tsx:1571–1573 says the record clears when the click bubbles back, which a stopped click never does.

[Automated review]

@cixzhang

cixzhang commented Nov 9, 2026

Copy link
Copy Markdown
Contributor Author

/approve-spec 29b4b0d

@github-actions

github-actions Bot commented Nov 9, 2026 •

Copy link
Copy Markdown
Contributor

PR Analysis Report

🔎 Preview · d64b8f9

Storybook · Sandbox · built from this PR's head

Modified components

Component Size LoC Visual · A11y · RTL
PowerSearch 290.7 kB (+380 B) · 24.2 kB CSS (0) — — · — · —
Tokenizer · Storybook 93.0 kB (+314 B) · 18.8 kB CSS (0) 2,340 (+101) ✓ · ✓ · ✓
Typeahead 81.1 kB (+80 B) · 12.4 kB CSS (0) — ✓ · ✓ · ✓
2 more components
Component Size LoC Visual · A11y · RTL
BaseTypeahead 72.4 kB (+51 B) · 10.9 kB CSS (0) — ✓ · ✓ · ✓
TypeaheadItem 6.4 kB (0) · 3.6 kB CSS (0) — ✓ · ✓ · ✓

Package size: @astryxdesign/core 7.25 MB packed (+3.8 kB); no new dependencies.

API changes: core +4 · ~0 · −0

Committed API report behind this build: cli 29 rows, core 36 rows; run pnpm api:report.

4 API changes (advisory)
Package Where Signature Usage
+ core . · Components · component Tokenizer prop menu?: BaseTypeaheadMenu <Tokenizer menu={…} />
+ core . · Components · component Tokenizer prop onOpenChange?: (isOpen: boolean) => void <Tokenizer onOpenChange />
+ core . · Types · interface TokenizerHandle close: () => void import type {TokenizerHandle} from '@astryxdesign/core'; const x: TokenizerHandle = {close: …}
+ core . · Types · interface TokenizerHandle open: () => void import type {TokenizerHandle} from '@astryxdesign/core'; const x: TokenizerHandle = {open: …}

Touched components checked; add ci:run-visual or ci:run-rtl to run the full suites.

Accessibility: 1 violation(s)

Accessibility Audit

Status: 1 accessibility violation(s) found — 1 serious.

Tokenizer - 1 issue(s)
  • 🟠 serious: Ensure the contrast between foreground and background colors meets WCAG 2 AA minimum contrast ratio thresholds
    • Rule: color-contrast · Affects 2/31 stories · Learn more
    • WCAG: 1.4.3 (Level AA)

Generated by PR Enrichment workflow | View full report

@cixzhang

cixzhang commented Nov 9, 2026

Copy link
Copy Markdown
Contributor Author

/approve-spec ff4d67a

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

This pull request is reviewed as part of its stack; see the review on #10625.

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

This pull request is reviewed as part of its stack; see the review on #10625.

@cixzhang

cixzhang commented Nov 9, 2026

Copy link
Copy Markdown
Contributor Author

/approve-spec 8aa37d5

@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: one scope fix, then nothing else blocks.

  • Regression: this head no longer contains #10544's head, because #10544 merged main after this push, so the declared stack #10544 → #10624 → #10625 does not hold and this pull request's 2,829 authored lines against main are over the 2,000-line limit; merge #10544's current head into this branch, then this branch into #10625, so the stack holds again and the size becomes a non-blocking note.

An engineering owner approved the record changes for this head, and the forwarded menu, the open handle and the token focus return behave as component:Tokenizer FR28 and component:BaseTypeahead FR13–FR16 describe, in the tests and in Chromium. Optional, if you touch the branch: the comment at Tokenizer.tsx:1579-1582 and the 16-line header of BaseTypeaheadFocusContext.ts could be shorter, and FR28's sheet sentence has no test.

[Automated review]

@cixzhang

cixzhang commented Nov 9, 2026

Copy link
Copy Markdown
Contributor Author

/approve-spec 9f908c0

@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 stack has to hold again before this pull request can be judged on its Tokenizer increment.

  • The pull request is 2,829 authored lines against main because #10625 does not yet contain this head, so the declared stack #10544 → #10624 → #10625 does not hold and its size exemption does not apply; merge feat/tokenizer-menu into #10625's branch.
  • Newly live check: BaseTypeaheadProps.handleRef and BaseTypeaheadProps.menu are outside this pull request's scope (Tokenizer): name them in the scope and get an owner decision, or split them into their own pull request.
  • Newly live check: BaseTypeaheadMenu is outside this pull request's scope (Tokenizer): name it in the scope and get an owner decision, or split it into its own pull request.
  • Newly live check: BaseTypeaheadHandle is outside this pull request's scope (Tokenizer): name it in the scope and get an owner decision, or split it into its own pull request.
  • Newly live check: BaseTypeaheadListboxMenuInfo is outside this pull request's scope (Tokenizer): name it in the scope and get an owner decision, or split it into its own pull request.
  • Newly live check: BaseTypeaheadDialogMenuInfo is outside this pull request's scope (Tokenizer): name it in the scope and get an owner decision, or split it into its own pull request.
  • Newly live check: TypeaheadProps.handleRef and TypeaheadProps.menu are outside this pull request's scope (Tokenizer): name them in the scope and get an owner decision, or split them into their own pull request.

These rows are #10544's, so the same merge fixes them: once the stack holds, this pull request's own increment changes only Tokenizer rows. The record changes are owner-approved for this head, and the forwarded menu, the open handle and the token focus return behave as component:Tokenizer FR28 and component:BaseTypeahead FR13–FR16 describe. Optional, if you touch the branch: the comment at Tokenizer.tsx:1579-1582 and the header of BaseTypeaheadFocusContext.ts could be shorter, and FR28's sheet sentence has no test.

[Automated review]

Comment thread packages/core/api-report.md Resolved

@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 passes on this head.

#10625 now contains this head, so the declared stack #10544 → #10624 → #10625 holds again and this pull request is judged on its own Tokenizer increment; the size and the BaseTypeahead and Typeahead API rows behind the earlier request for changes belong to #10544. An engineering owner approved component:Tokenizer FR28 for this head, and the forwarded menu and onOpenChange, the handle's open()/close() and the focus return to a token behave as it describes, by mouse, by keyboard and with a click that does not focus the button, as in Safari. This pull request lands only together with #10544 and #10625, once #10544 is approved too.

  • Optional, if you touch the branch: an active-voice comment at Tokenizer.tsx:1579-1582, a shorter BaseTypeaheadFocusContext.ts header, and a test for FR28's sheet sentence.

[Automated review]

@cixzhang

cixzhang commented Nov 9, 2026

Copy link
Copy Markdown
Contributor Author

/approve-spec 9f908c0

@cixzhang

cixzhang commented Nov 9, 2026

Copy link
Copy Markdown
Contributor Author

/approve-spec 9f908c0

@cixzhang

Copy link
Copy Markdown
Contributor Author

/approve-spec b756cab

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

This pull request is reviewed as part of its stack; see the review on #10847.

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

Approval waits on an engineering owner's decision about one focus behavior; nothing else blocks.

  • Miss: Tokenizer.tsx:1245–1251 keeps every pointer focus that enters the field, not only focus on a token's own control as component:Tokenizer FR28 says, so a mouse press on an endContent control (such as an Apply button) leaves focus there instead of the input, even after a press released outside or a click that stops propagation; an engineering owner either accepts this by amending FR28 and commenting /approve-spec <full head SHA> (the author may, as an engineering owner) or asks for the rule to be limited to tokens' own controls.

The forwarding of menu, onOpenChange and open()/close() and the Escape return to the token match FR28, which is owner-approved for this head, and the Tokenizer, Typeahead and PowerSearch suites pass. Non-blocking: add a test for the sheet's development warning on menu/onOpenChange, and see the inline notes on two comments. Reviewed on its own: #10544 has merged and #10625 does not yet contain this head, so the declared stack no longer holds.

[Automated review]

@cixzhang

Copy link
Copy Markdown
Contributor Author

/approve-spec d99dab3

@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, and CI passes on this head: forwarding menu, onOpenChange and open()/close(), keeping focus on a token's own control and returning focus to the token on Escape match component:Tokenizer FR28, which an engineering owner approved for this head, together with the broader pointer-focus rule (an endContent control keeps pointer focus) that the last review asked about.

Non-blocking: a test that menu and onOpenChange draw the sheet presentation's development warning would cover FR28's last sentence, and the two earlier inline notes on comment style in Tokenizer.tsx and BaseTypeaheadFocusContext.ts still apply.

This pull request was reviewed on its own, because #10544 has merged and #10625 does not yet contain this head, so the declared stack no longer holds.

[Automated review]

@cixzhang

Copy link
Copy Markdown
Contributor Author

/approve-spec d64b8f9

@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 heavy test jobs are deferred on this head and run before merge.

Forwarding menu, onOpenChange and open()/close(), keeping focus on a custom token's own control and returning focus to the token on Escape match component:Tokenizer FR28, which an engineering owner approved for this head; a press on an endContent control again ends in the input, as on main. Non-blocking: a test that menu and onOpenChange draw the sheet presentation's development warning would cover FR28's last sentence, and the two earlier inline notes on comment style in Tokenizer.tsx and BaseTypeaheadFocusContext.ts still apply. This pull request was reviewed on its own, because #10544 has merged and #10625 does not yet contain this head, so the declared stack no longer holds.

[Automated review]

@cixzhang
cixzhang merged commit 42e482c into main Nov 10, 2026
117 of 120 checks passed
@github-actions
github-actions Bot deleted the feat/tokenizer-menu branch November 11, 2026 06:05

This branch was successfully deployed

1 active deployment
Preview — d64b8f94 Deployed Nov 10, 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. needs:design-review Affects visuals — Design should review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant