Skip to content

fix(ContextMenu): a node-label sub-menu level names the bottom sheet - #11936

Draft
cixzhang wants to merge 6 commits into
mainfrom
fix/contextmenu-sheet-node-label
Draft

cixzhang wants to merge 6 commits into
mainfrom
fix/contextmenu-sheet-node-label

Conversation

@cixzhang

@cixzhang cixzhang commented Nov 15, 2026 •

Copy link
Copy Markdown
Contributor

User impact

On a phone, when a ContextMenu bottom-sheet data sub-menu's label is not a plain string (for example emphasized text, or a translated message component), the sheet kept the menu's root label as its accessible name while that level showed. Focus already moves to the level's heading, which reads the level; the sheet's own name now matches it (the label's text) while the level shows, as DropdownMenu does, and Back returns the root name. A label with no readable text keeps the root name.

Cause

ContextMenu.tsx named the sheet with typeof currentTitle === 'string' ? currentTitle : label, so a node label fell back to the root label. DropdownMenu had the same defect, fixed in #11594: MenuBottomSheetActionList (which ContextMenu shares) now reads a node label's text when its row opens the level and passes it to onOpenSubmenu(item, title).

Fix

ContextMenu keeps a per-level title list fed by onOpenSubmenu(item, title), as DropdownMenu does, and names the sheet after the current level's title when its label is not a string. Back and close drop the titles with their levels. Only ContextMenu.tsx changes.

Expected behavior and authority

component:ContextMenu FR7: sub-menu rows follow component:DropdownMenu FR11, where the drilled level is named by the row's label, the sheet's name included (Specs: records-decided, defect repair, no card).

Evidence

  • Red first (0202469): a ContextMenu.test.tsx case with a bottom-sheet data menu and a node-label sub-menu expects the dialog to be named "Move to project" while that level shows, and "Row actions" after Back. It failed ("Unable to find ... dialog ... Move to project") and passes at this head.
  • ContextMenu and DropdownMenu suites: 472 tests pass (18 files); eslint and tsc clean.

Overlap checked

Overlap checked: #11569, #9816, #8693, #8403, #8201, #8133, #8125 (they share ContextMenu.tsx or its test file, but none changes the bottom sheet's name, the sub-menu path or onOpenSubmenu; #11569 and #8403 move the sheet's render block and keep label={sheetLabel}, so this is a separate defect)

#11827 changes MenuBottomSheetActionList row presses, not the onOpenSubmenu(item, title) contract this uses.

Scope

  • One defect is restored.
  • Separable contradictory or unsettled tagalongs were removed or split.
  • No new public API, visual representation, default, or interaction model is hidden under the bug-fix label.
  • Public text and artifacts contain no internal Meta context.

Owner and land path

Owner: fix lane 2. Land path: Specs stamp, CodeBunny review, ready when CodeBunny approves this head, required checks, then the merge queue.

ContextMenu named its bottom sheet only from a string sub-menu label, so a
level whose label is a node kept the root's name and a screen reader did
not announce the level. It now keeps a per-level title list fed by the
sheet's onOpenSubmenu(item, title), as DropdownMenu does, and names the
sheet after the current level's title. Back and close drop the titles
with their levels.
@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 Building Building Preview Nov 20, 2026 2:51am 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) Nov 20, 2026, 3:05 AM UTC

@cixzhang

Copy link
Copy Markdown
Contributor Author

/approve-spec 7ef0029

@github-actions

github-actions Bot commented Nov 15, 2026 •

Copy link
Copy Markdown
Contributor

PR Analysis Report

Current run: The current CI run concluded skipped. Current analysis is unavailable.


Generated by PR Enrichment workflow | View current CI run

@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 fix works, but the release note and the description claim more than the change does.

  • The release note says the new sheet name means "a screen reader announces the level" and the description says the level "was not announced" before, but the new test proves only the sheet's name and on main drilling in already moves focus to the level's heading, so please drop or reword both claims.

Suggested release note:

[fix] ContextMenu: in a bottom sheet, a data sub-menu whose label is not a plain string (for example emphasized text) now names the sheet after that label's text while its level shows, as DropdownMenu does. Back returns the root name.

The new test fails on main and passes here, and the ContextMenu suite passes. Optional: an empty text read leaves the sheet unnamed where main used the root label, and the new comment could be shorter and active.

Claims and files checked

Review mode: same-head; reason: none

  • Release note, a node-label sub-menu in a bottom sheet names the sheet after that label while its level shows: verified (the new test at ContextMenu.test.tsx:296 fails on main and passes here).
  • Release note, so a screen reader announces the level: false (the test proves the name only, and main already focuses the level's heading, ContextMenu.tsx:498-505, unchanged).
  • Release note, as DropdownMenu does, and Back returns the root name: verified (DropdownMenu.tsx:653-656; ContextMenu.tsx:899-902 and the test after Back).
  • Description, the sheet kept the root label at that level: verified (on main the level's dialog is named "Row actions").
  • Description, so the level was not announced: false (on main focus moves to the level's heading, which reads "Move to project").
  • Description, the visible heading was already correct: verified (the heading renders the level's label on both, ContextMenu.tsx:856-869, unchanged).
  • Description, the cause is the string-only sheet name, and the shared sheet list already passes the label's text: verified (main's string check; MenuBottomSheetActionList.tsx:109-120).
  • Description, a per-level title list that Back and close drop, with only ContextMenu.tsx changing in source: verified (ContextMenu.tsx:426-443, :899-915).
  • Description, the cited sub-menu clause covers the sheet's name: partly; it covers the pointer menu's drilled list, and the sheet's name rests on the engineering owner's approval for this head.
  • Description, the test fails first, the suites pass, and ESLint and the typecheck are clean: verified.
  • Description, no new public API, visual, default or interaction model, and no internal context: verified.
  • Description, overlapping pull requests leave the sheet's name alone: not checked; it does not bear on this change.
  • Files: .changeset/contextmenu-sheet-node-label.md (blocking: the speech claim); packages/core/src/ContextMenu/ContextMenu.test.tsx (clear); packages/core/src/ContextMenu/ContextMenu.tsx (non-blocking: empty-text fallback, comment wording).

Automated review (maintainer link)

@cixzhang

Copy link
Copy Markdown
Contributor Author

/approve-spec bd7b6d2

@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: CI has not run on this head yet.

The bottom sheet takes a node-label sub-menu's text as its dialog name while that level shows, Back returns the root name, and a label with no readable text keeps it; the release note and description describe exactly that. The new test, the ContextMenu and DropdownMenu suites and a Chromium name check on this head back it.

Claims and files checked

Review mode: same-head; reason: none

  • changed rules (0): none
  • Release note, a bottom-sheet data sub-menu with a non-string label names the sheet after that label's text while its level shows: verified (ContextMenu.tsx:434-437; the new test at ContextMenu.test.tsx:296 passes here, and on main the level's dialog stays "Row actions").
  • Release note, as DropdownMenu does: verified (DropdownMenu.tsx:653-656 names its sheet the same way).
  • Release note, Back returns the root name: verified (ContextMenu.tsx:899-902 and the test after Back).
  • Description, on main the sheet kept the root label as its accessible name at that level: verified (main's string-only check).
  • Description, focus already moves to the level's heading: verified (ContextMenu.tsx:498-505, unchanged).
  • Description, the sheet's name now matches the level while it shows, and Back returns the root name: verified (the test and a browser check).
  • Description, a label with no readable text keeps the root name: verified (ContextMenu.tsx:437).
  • Description, the cause is the string-only sheet name, and the shared sheet list already passes a node label's text since the DropdownMenu fix: verified (MenuBottomSheetActionList.tsx:109-120; that fix is merged).
  • Description, a per-level title list fed by the shared list, dropped on Back and close, with only ContextMenu.tsx changing in source: verified (ContextMenu.tsx:425-449, :899-915).
  • Description, the cited sub-menu clause covers the sheet's name: partly; it covers the pointer menu's drilled list, and the sheet's name rests on the engineering owner's approval for this head.
  • Description, the test failed first and passes here, 472 tests in 18 files pass, and ESLint and the typecheck are clean: verified.
  • Description, the listed overlapping pull requests leave the sheet's name, the sub-menu path and the drill-in callback alone: verified.
  • Description, no new public API, visual, default or interaction model, and no internal context: verified (no API rows; pixel-identical frames).
  • Files: .changeset/contextmenu-sheet-node-label.md (clear); packages/core/src/ContextMenu/ContextMenu.test.tsx (clear); packages/core/src/ContextMenu/ContextMenu.tsx (clear).

Automated review (maintainer link)

@cixzhang

Copy link
Copy Markdown
Contributor Author

/approve-spec c7ed385

@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: CI has not run on this head yet.

The bottom sheet takes a node-label sub-menu's text as its dialog name while that level shows, Back returns the root name, and a label with no readable text keeps it; the release note and description describe exactly that. The merge of main leaves that path intact: the new test (which fails without the fix), the ContextMenu and DropdownMenu suites and an accessible-name check in Chromium back it on this head.

Claims and files checked

Review mode: incremental; reason: none

  • changed rules (0): none
  • Release note, a bottom-sheet data sub-menu with a non-string label names the sheet after that label's text while its level shows: verified (ContextMenu.tsx:435-438; the new test at ContextMenu.test.tsx:296 passes here and fails on the base).
  • Release note, as DropdownMenu does: verified (DropdownMenu.tsx:653-657 names its sheet the same way).
  • Release note, Back returns the root name: verified (ContextMenu.tsx:900-903 and the test after Back).
  • Description, on main the sheet kept the root label as its accessible name at that level: verified (the string-only check on the base).
  • Description, focus already moves to the level's heading: verified (ContextMenu.tsx:499-506, unchanged).
  • Description, the sheet's name now matches the level while it shows, and Back returns the root name: verified (the test and the browser check).
  • Description, a label with no readable text keeps the root name: verified (ContextMenu.tsx:438).
  • Description, the cause is the string-only sheet name, and the shared sheet list already passes a node label's text since the DropdownMenu fix: verified (MenuBottomSheetActionList.tsx:109-120).
  • Description, a per-level title list fed by the shared list, dropped on Back and close, with only ContextMenu.tsx changing in source: verified (ContextMenu.tsx:427-450, :900-916).
  • Description, the cited sub-menu clause covers the sheet's name: partly; it covers the pointer menu's drilled list, and the sheet's name rests on the engineering owner's approval for this head.
  • Description, the test failed first and passes here, the suites pass, and ESLint and the typecheck are clean: verified (the suites now hold 480 tests in 21 files after the merge, all passing).
  • Description, the listed overlapping pull requests leave the sheet's name, the sub-menu path and the drill-in callback alone: verified.
  • Description, no new public API, visual, default or interaction model, and no internal context: verified (no API rows; pixel-identical frames).
  • Files: .changeset/contextmenu-sheet-node-label.md (clear); packages/core/src/ContextMenu/ContextMenu.test.tsx (clear); packages/core/src/ContextMenu/ContextMenu.tsx (clear).

Automated review (maintainer link)

@cixzhang

Copy link
Copy Markdown
Contributor Author

/approve-spec 5df1d1d

@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 needs a re-run before merge. Its one failing job, test-node (5/9), fails in packages/cli/test/swizzle-proof/samples.test.mjs on a Lab MediaPlayer sample that main lacked when CI ran and has since added; this pull request does not touch that test or component.

The bottom sheet takes a node-label sub-menu's text as its dialog name while that level shows, Back returns the root name, and a label with no readable text keeps it; the release note and description describe exactly that, and the new test (which fails without the fix) and the ContextMenu suites pass on this head.

Claims and files checked

Review mode: same-head; reason: none

  • changed rules (0): none
  • Title, a node-label sub-menu level names the bottom sheet: verified (ContextMenu.tsx:455-458).
  • Release note, a bottom-sheet data sub-menu with a non-string label names the sheet after that label's text while its level shows: verified (ContextMenu.tsx:455-458; the new test at ContextMenu.test.tsx:296 passes here and fails on the base).
  • Release note, as DropdownMenu does: verified (DropdownMenu.tsx:664-667 names its sheet the same way).
  • Release note, Back returns the root name: verified (ContextMenu.tsx:920-923 and the test after Back).
  • Description, on main the sheet kept the root label as its accessible name at that level: verified (the string-only check on the base).
  • Description, focus already moves to the level's heading: verified (ContextMenu.tsx:519-526, unchanged).
  • Description, the sheet's name now matches the level while it shows, and Back returns the root name: verified (the test and the browser check).
  • Description, a label with no readable text keeps the root name: verified (ContextMenu.tsx:458).
  • Description, the cause is the string-only sheet name, and the shared sheet list already passes a node label's text since the DropdownMenu fix: verified (MenuBottomSheetActionList.tsx:109-120).
  • Description, a per-level title list fed by the shared list, dropped on Back and close, with only ContextMenu.tsx changing in source: verified (ContextMenu.tsx:446-470, :920-923, :933-936).
  • Description, the cited sub-menu clause covers the sheet's name: partly; it covers the pointer menu's drilled list, and the sheet's name rests on the engineering owner's approval for this head.
  • Description, the test failed first and passes here, the suites pass, and ESLint and the typecheck are clean: verified (the suites now hold 480 tests in 21 files after the merges of main, all passing; CI's lint and typecheck pass).
  • Description, the listed overlapping pull requests leave the sheet's name, the sub-menu path and the drill-in callback alone: verified.
  • Description, no new public API, visual, default or interaction model, and no internal context: verified (no API rows; pixel-identical frames).
  • Files: .changeset/contextmenu-sheet-node-label.md (clear); packages/core/src/ContextMenu/ContextMenu.test.tsx (clear); packages/core/src/ContextMenu/ContextMenu.tsx (clear).

Automated review (maintainer link)

@cixzhang
cixzhang marked this pull request as ready for review November 20, 2026 02:18
@cixzhang
cixzhang marked this pull request as draft November 20, 2026 02:51
@cixzhang

Copy link
Copy Markdown
Contributor Author

/approve-spec 31e740f

@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: CI has not run on this head yet because the pull request is a draft, and it runs once the pull request is marked ready for review.

The bottom sheet takes a node-label sub-menu's text as its dialog name while that level shows, Back returns the root name, and a label with no readable text keeps it; the release note and description describe exactly that, and the new test fails without the fix. This update only merges main, which touches none of the changed files.

Claims and files checked

Review mode: carry-forward; reason: none

  • Title, a node-label sub-menu level names the bottom sheet: verified (ContextMenu.tsx:455-458).
  • Release note, a bottom-sheet data sub-menu with a non-string label names the sheet after that label's text while its level shows: verified (ContextMenu.tsx:455-458; the new test at ContextMenu.test.tsx:296 passes with this patch and fails on the base).
  • Release note, as DropdownMenu does: verified (DropdownMenu.tsx:664-667 names its sheet the same way).
  • Release note, Back returns the root name: verified (ContextMenu.tsx:920-923 and the test after Back).
  • Description, on main the sheet kept the root label as its accessible name at that level: verified (the string-only check on the base).
  • Description, focus already moves to the level's heading: verified (ContextMenu.tsx:519-526, unchanged).
  • Description, the sheet's name now matches the level while it shows, and Back returns the root name: verified (the test and the browser check).
  • Description, a label with no readable text keeps the root name: verified (ContextMenu.tsx:458).
  • Description, the cause is the string-only sheet name, and the shared sheet list already passes a node label's text since the DropdownMenu fix: verified (MenuBottomSheetActionList.tsx:109-120).
  • Description, a per-level title list fed by the shared list, dropped on Back and close, with only ContextMenu.tsx changing in source: verified (ContextMenu.tsx:446-470, :920-923, :933-936).
  • Description, the cited sub-menu clause covers the sheet's name: partly; it covers the pointer menu's drilled list, and the sheet's name rests on the engineering owner's approval for this head.
  • Description, the test failed first and passes, the suites pass, and ESLint and the typecheck are clean: verified on the same patch before this merge of main (480 tests in 21 files, all passing); CI checks this head once it runs.
  • Description, the listed overlapping pull requests leave the sheet's name, the sub-menu path and the drill-in callback alone: verified.
  • Description, no new public API, visual, default or interaction model, and no internal context: verified (no API rows; pixel-identical frames).
  • Files: .changeset/contextmenu-sheet-node-label.md (clear); packages/core/src/ContextMenu/ContextMenu.test.tsx (clear); packages/core/src/ContextMenu/ContextMenu.tsx (clear).

Automated review (maintainer link)

This branch was successfully deployed

1 active (outdated) deployment
Preview — 5df1d1d8 Deployed Nov 19, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Meta Open Source bot.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant