Skip to content

feat(DropdownMenuRadioGroup): title — a radio set with its own heading is one named group - #7541

Closed
vjeux wants to merge 7 commits into
meta:mainfrom
vjeux:menu-radio-group-title
Closed

vjeux wants to merge 7 commits into
meta:mainfrom
vjeux:menu-radio-group-title

Conversation

@vjeux

@vjeux vjeux commented Oct 14, 2026 •

Copy link
Copy Markdown
Contributor

Review only this PR's change: the branch sits on main, so this diff is already its own.

User need

What led to it: this comes from moving every menu and picker in our app onto Astryx, which began with a press, slide and lift bug in its phone menus. Some of our menus title a section that holds a single radio set, such as "Sort by: Newest / Oldest".

Why: today the heading comes from wrapping the set in a DropdownMenuGroup, and DropdownMenuRadioGroup needs its own label, so a screen reader meets two nested groups with the same name, and no public API avoids it.

Problem and solution fit

DropdownMenuRadioGroup takes DropdownMenuGroup's title: the same section heading, as its first child, naming the radio group. One group, one name, no wrapper.

<DropdownMenuRadioGroup value={hidden} onChange={setHidden} title="Hidden files">
  <DropdownMenuRadioItem value="hide" label="Hide hidden files" />
  <DropdownMenuRadioItem value="show" label="Show hidden files" />
</DropdownMenuRadioGroup>

Current specification

component:DropdownMenuRadioGroup (draft): this PR proposes a Title concept, FR7–FR9 and DEC-1, pending owner review. The heading reuses component:DropdownMenu FR14 and DEC-6.

Public delta and caller burden

  • New title on DropdownMenuRadioGroup (also exported as ContextMenuRadioGroup); label becomes optional when a title is given.
  • With a title, the title names the group: a caller's aria-labelledby is read after it, and label or aria-label is ignored, with a development warning when they differ.
  • Without title, nothing changes. Callers who wrapped a single set in a DropdownMenuGroup can drop the wrapper.

Design and alternatives

  • Let DropdownMenuGroup stop naming itself when its only child is a named set. No new prop, but the group would have to inspect its children.
  • Hide the heading from assistive technology and keep label. Small, but the visible text and the spoken name can drift apart.
  • Reuse title on the radio group (chosen). The sibling already ships it, and the visible heading is the name. The cost: title and label now interact, which the warning covers.

Evidence

New cases in DropdownMenuSelectable.test.tsx fail on main; RadioGroupTitle.a11y.chromium.spec.ts checks in Chromium that the set is one group named by its heading.

Writing rubric results

R1 narration: none.
R2 research: none.
R3 evidence: none.
R4 rejected alternatives: none.
R5 change references: none.
R6 open questions: none.

Evidence

See Testing: red on main, green here.

Scope

  • One capability is added.
  • Unrelated fixes, cleanup, and policy changes were removed or split.
  • Consumer docs, focused tests, migration evidence, a story, a radio-group binding state, the shipped block and changesets ship with the feature.
  • Public text and artifacts contain no internal Meta context.

Testing

In Storybook, open Core/DropdownMenu → Radio group with a title and open "Filter".

  1. "Hidden files" heads its two choices.
  2. With a screen reader or the accessibility tree, the choices sit in one group named "Hidden files", not two.
  3. Arrow keys skip the heading and move between the choices.

@vercel

vercel Bot commented Oct 14, 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 Oct 28, 2026 6:45am UTC

Request Review

@astracat-bot

astracat-bot Bot commented Oct 14, 2026 •

Copy link
Copy Markdown
Contributor

AI review status for this pull request.

Review status Updated
❓ Needs maintainer input (for maintainers only) Oct 28, 2026, 7:09 AM UTC

@github-actions github-actions Bot added the needs:design-review Affects visuals — Design should review label Oct 14, 2026
@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Meta Open Source bot. label Oct 14, 2026
@github-actions

github-actions Bot commented Oct 14, 2026 •

Copy link
Copy Markdown
Contributor

PR Analysis Report

📚 Storybook Preview

View Storybook for this PR

🧪 Sandbox Preview

View Sandbox for this PR

Component Size

Component Import before Import after Delta CSS before CSS after Delta
core/ContextMenuItem 53.5KB 53.5KB 0B 9.8KB 9.8KB 0B
core/DropdownMenu 73.4KB 73.4KB 0B 15.0KB 15.0KB 0B
core/DropdownMenuCheckboxItem 16.4KB 16.4KB 0B 5.7KB 5.7KB 0B
core/DropdownMenuDivider 6.6KB 6.6KB 0B 3.6KB 3.6KB 0B
core/DropdownMenuGroup 6.1KB 6.1KB 0B 3.3KB 3.3KB 0B
core/DropdownMenuItem 15.6KB 15.6KB 0B 5.3KB 5.3KB 0B
core/DropdownMenuRadioGroup 6.0KB 7.0KB +1021B 3.2KB 3.3KB +126B
core/DropdownMenuRadioItem 16.4KB 16.4KB 0B 5.7KB 5.7KB 0B
core/DropdownMenuSubMenu 58.7KB 58.7KB 0B 9.7KB 9.7KB 0B
core/RadioList 46.2KB 46.2KB 0B 8.2KB 8.2KB 0B
core/RadioListItem 52.8KB 52.8KB 0B 9.8KB 9.8KB 0B

Sizes are gzip. Import counts the JavaScript the import loads eagerly; CSS counts the package stylesheet rules referenced by the modules it can load from its own package, lazily loaded ones included.

Bundle Size Summary

Gzip figures measure each package's entry file, not the code an import pulls in.

Package Entry (ESM) Entry gzip before Entry gzip after Delta
@astryxdesign/core 4.9KB 1.2KB 1.2KB 0B
Package stylesheet Gzip before Gzip after Delta
@astryxdesign/core 35.1KB 35.1KB 0B

Accessibility Audit

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

Radio group pattern - 1 issue(s)
  • 🟠 serious: Ensure the contrast between foreground and background colors meets WCAG 2 AA minimum contrast ratio thresholds
    • Rule: color-contrast · Affects 3/18 stories · Learn more
    • WCAG: 1.4.3 (Level AA)
RadioList - 1 issue(s)
  • 🟠 serious: Ensure the contrast between foreground and background colors meets WCAG 2 AA minimum contrast ratio thresholds
    • Rule: color-contrast · Affects 3/14 stories · Learn more
    • WCAG: 1.4.3 (Level AA)

Visual Regression

57 of 506 shot(s) changed.

A change here is a question, not a failure: check whether the after is the
picture you intended. Record that review on the PR. Baseline maintenance is an
explicit dispatch of CI; this report never rewrites the baseline or adds a release gate.

component story theme mode pixels
Selector Indicator Space Bottom Sheet Narrow End RTL neutral light 753,933
Selector Indicator Space Bottom Sheet Wide Start neutral light 740,072
RichTextEditor Markdown parity: side by side probe dark 558,840
RichTextEditor Markdown parity: side by side probe light 540,756
Chat Full AI Chat probe light 230,823
Chat Full AI Chat probe dark 229,805
AppShell With Mobile Nav probe light 217,010
AppShell With Mobile Nav probe dark 216,960
Collapsible Dividers probe dark 66,445
Collapsible Dividers probe light 66,445
AppShell Playground neutral dark 65,198
AppShell Playground neutral light 63,788
Chat Default neutral dark 36,304
Chat Default neutral light 35,767
Chat Empty State probe light 23,531
Chat Empty State probe dark 22,622
ChatAutoScroll Scroll Behavior Comparison neutral dark 15,378
ChatAutoScroll Scroll Behavior Comparison neutral light 14,107
Chat With Attachments probe light 13,406
Chat With Attachments probe dark 11,232

and 37 more.


Generated by PR Enrichment workflow | Storybook | Sandbox | View full report

@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 is on hold for a maintainer decision: the new title prop and the FR18 and DEC-13 rules it adds to the draft component:DropdownMenu record are not yet approved spec, so the DropdownMenu owner needs to approve or reject that contract, including label taking precedence over a visible title and single radio sets no longer using a DropdownMenuGroup wrapper. Whatever that decision, three fixes are needed, and the branch needs a rebase because main now conflicts in DropdownMenu.spec.md and DropdownMenuSelectable.test.tsx:

  • Pass a caller's aria-label through when label is omitted (DropdownMenuRadioGroup.tsx line 151 replaces it with undefined), and count it in the warning condition.
  • Describe the result in the changeset and the story comment as one group named by its heading, or name the NVDA + Chrome and VoiceOver + Safari check and the release block an announcement claim needs.
  • Add a titled DropdownMenuRadioGroup state to the shared radio-group binding inventory (RadioGroup.a11y.states.ts).

[Automated review]

{...rest}
role="group"
aria-label={label}
aria-label={hasLabel ? label : undefined}

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.

With label now optional, <DropdownMenuRadioGroup aria-label="Sort by" …> type-checks, because BaseProps accepts aria-*. However, this line overwrites the spread aria-label with undefined, so the group is unnamed and the dev warning asks for a label or title. Suggest aria-label={hasLabel ? label : rest['aria-label']}, and counting rest['aria-label'] as a name in the warning condition above.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Fixed in 6f2f825: label wins, otherwise a caller's aria-label names the group (over the title too), and either one counts as a name for the warning. New case "names the group by a caller's aria-label when label is omitted, title or not" fails at the previous head.

'@astryxdesign/core': patch
---

[feat] `DropdownMenuRadioGroup` (also exported as `ContextMenuRadioGroup`) takes a `title`: a visible heading above its radios, drawn like a `DropdownMenuGroup` heading, that names the group. With a title, `label` is optional. Give a menu section that holds one radio set this title instead of wrapping the set in a `DropdownMenuGroup`, so a screen reader announces one group with one name rather than two nested groups with the same name. Without `title` nothing changes.

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 promises what a screen reader announces, but the tests prove the accessibility tree (one group named by its heading). Either phrase it as that exposure, or back the announcement with NVDA + Chrome and VoiceOver + Safari checks. The story comment above RadioGroupWithTitle makes the same promise.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Reworded in 6f2f825, here and in the story comment: the menu exposes one group named by its heading. The PR description now says the same.

@vjeux
vjeux force-pushed the menu-radio-group-title branch from 0b10c07 to 6f2f825 Compare October 20, 2026 14:16
@vjeux

vjeux commented Oct 20, 2026

Copy link
Copy Markdown
Contributor Author

Rebased onto main (22c592a) as one commit. The decision is now proposed DEC-11, since main took DEC-10; the rule stays FR18. The three review points:

  • A caller's aria-label names the group when label is omitted, and counts for the warning.
  • The changeset and story comment describe the exposed result (one group named by its heading), not an announcement.
  • The shared radio-group inventory gains menu-group-titled (a menu-radio group named by its visible title) with its story. RadioGroup.a11y.chromium.spec.ts fails it against a main build and passes here.

@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 is on hold for a maintainer decision: the new title prop and the FR18 and DEC-11 rules it adds to the draft component:DropdownMenu record are not yet approved spec, so a maintainer (the DropdownMenu owner) needs to approve or reject that contract as the governing spec, including whether label or a caller's aria-label may override a visible title (with label="Ordering" and title="Sort by", the group is named "Ordering" under the heading "Sort by"). Whatever the decision, CI's test-node job fails because label is now optional: delete the DropdownMenuRadioGroup.label required_mismatch line (line 26) from packages/cli/test/core-prop-docs.known-drift.json. Once the owner rules on that precedence, add the matching state to the radio-group binding inventory (RadioGroup.a11y.states.ts), or record why it is omitted. The aria-label, wording and titled-state fixes from the last round are in.

[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 is on hold for a maintainer decision: the new title prop and the FR18 and DEC-11 rules it adds to the draft component:DropdownMenu record are not yet approved spec, so the DropdownMenu owner needs to approve or reject that contract, including whether label or a caller's aria-label may override a visible title (with label="Ordering" and title="Sort by", the group is named "Ordering" under the heading "Sort by"). The drift-list fix from the last round is in, and CI is green. Whatever the owner decides, the shared radio-group binding inventory (RadioGroup.a11y.states.ts) still needs the naming state the ruling keeps, either bound or recorded with its reason in RADIO_GROUP_EXCLUSIONS.

[Automated review]

vjeux added a commit to vjeux/astryx that referenced this pull request Oct 21, 2026
Five open pull requests propose rules in this record: meta#7319 (FR18, DEC-11), meta#7352 (FR19, DEC-12), meta#7530 (FR20, AR7, DEC-13), meta#7532 (FR21, DEC-14) and meta#7541 (FR22, DEC-15). Each takes its own number, so none changes when another merges first. Record wording only.
vjeux added a commit to vjeux/astryx that referenced this pull request Oct 21, 2026
Five open pull requests propose rules in this record: meta#7319 (FR18, DEC-11), meta#7352 (FR19, DEC-12), meta#7530 (FR20, AR7, DEC-13), meta#7532 (FR21, DEC-14) and meta#7541 (FR22, DEC-15). Each takes its own number, so none changes when another merges first. Record wording only.
vjeux added a commit to vjeux/astryx that referenced this pull request Oct 21, 2026
Five open pull requests propose rules in this record: meta#7319 (FR18, DEC-11), meta#7352 (FR19, DEC-12), meta#7530 (FR20, AR7, DEC-13), meta#7532 (FR21, DEC-14) and meta#7541 (FR22, DEC-15). Each takes its own number, so none changes when another merges first. Record wording only.
vjeux added a commit to vjeux/astryx that referenced this pull request Oct 21, 2026
Five open pull requests propose rules in this record: meta#7319 (FR18, DEC-11), meta#7352 (FR19, DEC-12), meta#7530 (FR20, AR7, DEC-13), meta#7532 (FR21, DEC-14) and meta#7541 (FR22, DEC-15). Each takes its own number, so none changes when another merges first. Record wording only.
@vjeux
vjeux force-pushed the menu-radio-group-title branch from 7a054e2 to 0c600e5 Compare October 21, 2026 15:59

@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 is on hold for a maintainer decision: the new title prop and the FR7–FR9 and DEC-1 rules this pull request adds to the draft component:DropdownMenuRadioGroup record are not yet approved spec, so the record's owner, or another engineering owner on this exact head, needs to approve or change that contract as the governing spec. That decision includes the rules that a title rendering no text counts as no title (which also hides a title that is only an icon) and that a label beside a visible title is ignored. Nothing else blocks: the shipped block now titles its radio set, and the focusable-title case is in. Optionally, have FR1 say again that a caller's aria-label names an untitled group when label is omitted, and update the radio group's SYNC note, which still describes that block as wrapping its radio set.

[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 is on hold for a maintainer decision: the new title prop and the FR7–FR9 and DEC-1 rules this pull request adds to the draft component:DropdownMenuRadioGroup record are not yet approved spec, so the record's owner, or another engineering owner on this exact head, needs to approve or change that contract as the governing spec. That decision includes the rules that a title rendering no text counts as no title (which also hides a title that is only an icon) and that a label beside a visible title is ignored. The FR1 and SYNC-note follow-ups from the last round are in, and nothing else blocks. Optionally, carry DropdownMenuGroup's "keep the title non-interactive" sentence into the title docs, since the arrow keys cannot reach a control placed in the heading.

[Automated review]

name: 'title',
type: 'ReactNode',
description:
'A visible heading above the radios, with the same treatment as a DropdownMenuGroup heading, that names the group through aria-labelledby; an aria-labelledby passed through base props is read after it. With a title, label is optional. A title that renders no text (true, an empty fragment, a component that returns null) counts as no title: no heading shows and the group is named as without one. Give a menu section that holds one radio set this title instead of wrapping the set in a DropdownMenuGroup, so the set is one group with one name rather than two nested groups with the same name.',

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.

Not blocking: DropdownMenuGroup.doc.mjs tells builders "Keep title content non-interactive and place controls in DropdownMenu header or footer", because a control in the heading is outside the arrow-key order, and proposed FR7 and DEC-1 say the same holds here. Adding that sentence to this description (and to the Chinese, dense and JSDoc copies) keeps builders from putting a control keyboard users cannot reach into a radio set's title.

@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 is on hold for an engineering owner's decision: the new title prop and the FR7–FR9 and DEC-1 rules this pull request adds to the draft component:DropdownMenuRadioGroup record are not yet approved spec, including the rules that a title rendering no text counts as no title (which also hides an icon-only title) and that a label beside a visible title is ignored. Any engineering owner, the author included, can record that decision by commenting /approve-spec 3a05bf914a03e1c7305eb638eacb67e265e08509 on this pull request, or ask for changes to those rules. Independently of that decision, two fixes are needed:

  • Regenerate packages/cli/test/__golden__/no-icon-set/search-icon-set.json with vitest run packages/cli/test/experimental-isolation.test.mjs --update, since the block's new "radio set" wording adds one astryx search "icon set" match and CI's test-node (1/4) fails on the old count.
  • Rewrite the best practice in DropdownMenuRadioGroup.doc.mjs (line 24) that still says label "remains required", and add the title to that doc's usage text and anatomy.

[Automated review]

displayName: 'DropdownMenuGroup — Selectable rows',
description:
'Titled groups around a radio group and checkbox rows — the rows the data API cannot express, which is why the heading lives in compound mode.',
'A radio set titled by its own title and a titled group of checkbox rows — the rows the data API cannot express, which is why the headings live in compound mode. A section holding one radio set titles the set itself rather than a group around it, so it is one group with one name.',

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 wording ("radio set", twice) makes astryx search "icon set" match this template too: 367 matches instead of 366, with this template the only new result. packages/cli/test/__golden__/no-icon-set/search-icon-set.json still records 366, so experimental-isolation.test.mjs fails its two "search icon set" cases (CI test-node (1/4)). Running vitest run packages/cli/test/experimental-isolation.test.mjs --update on the branch and committing the golden, after checking its diff changes only the count, fixes it.

description:
'Accessible name for the group, applied as aria-label so screen readers announce the radios as a named set, e.g. "Sort by". Required even when aria-labelledby (via base props) points to visible text; that visible reference becomes the computed name while label remains the fallback.',
required: true,
'Accessible name for the group, applied as aria-label so screen readers announce the radios as a named set, e.g. "Sort by". Required unless title is given. An aria-labelledby passed through base props that points at visible text becomes the computed name, while label remains the fallback. With a title, the title names the group instead, so the name holds the visible heading; label (or an aria-label passed through base props) is then ignored, with a development warning when it differs from the text of the title. Without a title, an aria-label passed through base props names the group when label is omitted.',

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 description now makes label required only without a title, but the best practice at line 24 of this file still tells builders "label remains required and supplies the aria-label fallback", and the usage text (line 14) and anatomy (lines 42–55) leave the title out. Rewriting line 24 to the title-or-label rule and adding a Title anatomy part, as DropdownMenuGroup.doc.mjs has, keeps astryx docs consistent with the component.

@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 is on hold for an engineering owner's decision: the new title prop and the FR7–FR9 and DEC-1 rules this pull request adds to the draft component:DropdownMenuRadioGroup record are not yet approved spec, including the rules that a title rendering no text counts as no title (which also hides an icon-only title), that a label beside a visible title is ignored, and that label becomes optional for every caller. Any engineering owner, the author included, can record that decision by commenting /approve-spec c103ebd418b76e0fef303627a7a64209b21ba292 on this pull request, or ask for changes to those rules. Independently of that decision, the best practice at line 24 of DropdownMenuRadioGroup.doc.mjs still tells builders that label "remains required"; rewrite it to the title-or-label rule and add the title to that doc's usage text and anatomy.

[Automated review]

@cixzhang

Copy link
Copy Markdown
Contributor

Posted by Cindy's agent on her behalf.

Parts of this PR re-implement behavior that already exists, or is being specified, as a shared part of core. Converging keeps one implementation per behavior:

This is about where the behavior lives, not about the PR's intent.

@vjeux

vjeux commented Oct 24, 2026

Copy link
Copy Markdown
Contributor Author

Agreed: one implementation.

Observers. Now on utils/sharedMutationObserver.ts (observeContent, the content-change counterpart of sharedResizeObserver.ts; the group had no ResizeObserver) in 8097845; the group's own MutationObserver is gone, and a test checks two titled groups share one observer.

@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 is on hold for an engineering owner's decision: the new title prop and the FR7–FR9 and DEC-1 rules this pull request adds to the draft component:DropdownMenuRadioGroup record are not yet approved spec, including the rules that a title rendering no text counts as no title (which also hides an icon-only title), that a label beside a visible title is ignored, and that label becomes optional for every caller. Any engineering owner, the author included, can record that decision by commenting /approve-spec 8097845634c46af339fae05ab7b41d044b7831c5 on this pull request, or ask for changes to those rules. Independently of that decision, the best practice at line 24 of DropdownMenuRadioGroup.doc.mjs still tells builders that label "remains required"; rewrite it to the title-or-label rule and add the title to that doc's usage text and anatomy.

[Automated review]

description:
'Accessible name for the group, applied as aria-label so screen readers announce the radios as a named set, e.g. "Sort by". Required even when aria-labelledby (via base props) points to visible text; that visible reference becomes the computed name while label remains the fallback.',
required: true,
'Accessible name for the group, applied as aria-label so screen readers announce the radios as a named set, e.g. "Sort by". Required unless title is given. An aria-labelledby passed through base props that points at visible text becomes the computed name, while label remains the fallback. With a title, the title names the group instead, so the name holds the visible heading; label (or an aria-label passed through base props) is then ignored, with a development warning when it differs from the text of the title. Without a title, an aria-label passed through base props names the group when label is omitted.',

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 now says label is required only without a title, but the best practice at line 24 still reads "label remains required and supplies the aria-label fallback", and beside a title the component drops label from the markup. Please rewrite that best practice to the title-or-label rule, mention title in the usage text (line 14), and add a Title part to the anatomy (lines 42–55).

Comment on lines +152 to +157
- **PR1 — Context, and the title's text.** The group memoizes a small context
value. Only while a `title` is given, it reads its heading's text after each
commit, before paint, and again through one `MutationObserver` on the heading,
disconnected on cleanup, so a title that changes its own text is read again
(proposed FR9). It owns no other Effect, listener, timer, request, or resource
lifecycle.

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.

PR1 still describes a per-group MutationObserver "disconnected on cleanup". The group now subscribes the heading to the shared content observer, and cleanup removes only that subscription (sharedMutationObserver.ts lines 41–44). The three useDevWarning calls also each add an Effect, so "owns no other Effect" is not true either.

vjeux added 5 commits October 26, 2026 08:42
…g is one named group

DropdownMenuRadioGroup takes the title a DropdownMenuGroup takes: a visible heading, drawn and targeted like a group heading, that names the group. A visible title always names the group (a caller's aria-labelledby is read after it; label and aria-label are ignored, with a development warning when they differ from its text), so the name holds the text a speech-input user reads; a title that renders no text counts as no title. The shipped selectable-rows block titles its radio set itself.
…ropdownMenuRadioGroup

Main now has the component's own record, component:DropdownMenuRadioGroup (draft). The title rules this change proposed as component:DropdownMenu FR22 and DEC-15, and its Radio set heading concept, move there as proposed FR7-FR9, DEC-1 and a Title concept, and the record's statements this change alters follow: FR1 and the Accessible name concept (a visible title names the group first; label becomes optional beside one), the ownership and compatibility notes, AR1 and AR3, a titled representative state, the title heading in the design relationships, a verification row, and PR1, which now names the title-text read (a layout read after each commit and one MutationObserver on the heading, only while a title is given). component:DropdownMenu is back to main's text.
…the SYNC note says the block titles its set

FR1 had dropped what the code, the docs and the untitled aria-label case do: without a title, a caller's aria-label names the group when label is omitted. It says so again (the cell stays within its column). The header's SYNC note still described the shipped selectable-rows block as wrapping its radio set in a DropdownMenuGroup; this change makes the block title the set itself, and the note now says so. Record and comment only.
This pull request's docs say "radio set" (the block's description, and the group's label and title props), so the CLI search for "icon set" in experimental-isolation.test.mjs matches 367 entries instead of 366; the first 20 results are unchanged. The two goldens record the new count. Tests only.
…the shared content observer

Each titled radio group created its own MutationObserver to re-read a title whose text changes without the group rendering. It now registers with observeContent from utils/sharedMutationObserver.ts, the content-change counterpart of sharedResizeObserver.ts: one observer for every observed element (architecture:react-component-runtime INV7). The group never had a ResizeObserver. New case: two titled groups' headings are observed by the same observer instance; it fails on the previous head, where each group had its own. The case that re-reads a title changing through its own state still passes.

@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 is on hold for an engineering owner's decision: the new title prop and the FR7–FR9 and DEC-1 rules this pull request adds to the draft component:DropdownMenuRadioGroup record are not yet approved spec, including the rules that a title rendering no text counts as no title (which also hides an icon-only title), that a label beside a visible title is ignored, and that label becomes optional for every caller. Any engineering owner, the author included, can record that decision by commenting /approve-spec 43989aa79c2fda3e4eb9df19232ad02a59a8e7cb on this pull request, or ask for changes to those rules. Independently of that decision, two fixes are needed:

  • Rewrite the best practice at line 24 of DropdownMenuRadioGroup.doc.mjs, which still says label "remains required", to the title-or-label rule, and add the title to that doc's usage text and anatomy.
  • Reword proposed PR1 in DropdownMenuRadioGroup.spec.md, which still describes a per-group MutationObserver and no other Effect, to the shared content observer subscription and the three development-warning Effects.

[Automated review]

description:
'Accessible name for the group, applied as aria-label so screen readers announce the radios as a named set, e.g. "Sort by". Required even when aria-labelledby (via base props) points to visible text; that visible reference becomes the computed name while label remains the fallback.',
required: true,
'Accessible name for the group, applied as aria-label so screen readers announce the radios as a named set, e.g. "Sort by". Required unless title is given. An aria-labelledby passed through base props that points at visible text becomes the computed name, while label remains the fallback. With a title, the title names the group instead, so the name holds the visible heading; label (or an aria-label passed through base props) is then ignored, with a development warning when it differs from the text of the title. Without a title, an aria-label passed through base props names the group when label is omitted.',

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 makes label required only without a title, but the best practice at line 24 of this file still tells builders "label remains required and supplies the aria-label fallback", and the usage text (line 14) and anatomy (lines 42–55) leave the title out. Please rewrite line 24 to the title-or-label rule, mention title in the usage text, and add a Title anatomy part, as DropdownMenuGroup.doc.mjs has for its heading.

Comment on lines +152 to +157
- **PR1 — Context, and the title's text.** The group memoizes a small context
value. Only while a `title` is given, it reads its heading's text after each
commit, before paint, and again through one `MutationObserver` on the heading,
disconnected on cleanup, so a title that changes its own text is read again
(proposed FR9). It owns no other Effect, listener, timer, request, or resource
lifecycle.

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.

PR1 still describes "one MutationObserver on the heading, disconnected on cleanup" and says the group "owns no other Effect". The group now subscribes to the shared content observer (observeContent), whose cleanup removes only this registration (sharedMutationObserver.ts lines 41–44), and the three useDevWarning calls each add an Effect (useDevWarning.ts line 48). Please reword PR1 to match the code before an owner approves it.

Main's Icon changes (meta#8753, meta#8759) moved the CLI's "icon set" search golden to 369 matches; this branch's "radio set" docs add one, so the regenerated golden records 370 (experimental-isolation.test.mjs --update on the merged tree; only the count changes).

@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 is on hold for an engineering owner's decision: the new title prop and the FR7–FR9 and DEC-1 rules this pull request adds to the draft component:DropdownMenuRadioGroup record are not yet approved spec, including the rules that a title rendering no text counts as no title (which also hides an icon-only title), that a label beside a visible title is ignored, and that label becomes optional for every caller. Any engineering owner, the author included, can record that decision by commenting /approve-spec 8e83453e490b04068a25aa4e125478d0b567a313 on this pull request, or ask for changes to those rules. Independently of that decision, two fixes are needed:

  • Rewrite the best practice at line 24 of DropdownMenuRadioGroup.doc.mjs, which still says label "remains required", to the title-or-label rule, and add the title to that doc's usage text and anatomy.
  • Reword proposed PR1 in DropdownMenuRadioGroup.spec.md, which still describes a per-group MutationObserver and no other Effect, to the shared content observer subscription and the three development-warning Effects.

[Automated review]

description:
'Accessible name for the group, applied as aria-label so screen readers announce the radios as a named set, e.g. "Sort by". Required even when aria-labelledby (via base props) points to visible text; that visible reference becomes the computed name while label remains the fallback.',
required: true,
'Accessible name for the group, applied as aria-label so screen readers announce the radios as a named set, e.g. "Sort by". Required unless title is given. An aria-labelledby passed through base props that points at visible text becomes the computed name, while label remains the fallback. With a title, the title names the group instead, so the name holds the visible heading; label (or an aria-label passed through base props) is then ignored, with a development warning when it differs from the text of the title. Without a title, an aria-label passed through base props names the group when label is omitted.',

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 now says label is required only without a title and is ignored beside one, but the best practice at line 24 of this file still says "label remains required and supplies the aria-label fallback". Please rewrite line 24 to the title-or-label rule, mention title in the usage text (line 14), and add a Title part to the anatomy.

Comment on lines +152 to +157
- **PR1 — Context, and the title's text.** The group memoizes a small context
value. Only while a `title` is given, it reads its heading's text after each
commit, before paint, and again through one `MutationObserver` on the heading,
disconnected on cleanup, so a title that changes its own text is read again
(proposed FR9). It owns no other Effect, listener, timer, request, or resource
lifecycle.

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.

PR1 describes "one MutationObserver on the heading, disconnected on cleanup" and "no other Effect", but the group subscribes to the shared content observer (observeContent), whose cleanup removes only this registration, and its three useDevWarning calls each add an Effect. Please reword PR1 to match the code before it is approved.

Main and this branch each raised the CLI's "icon set" search golden from 369 to 370, so git merges them cleanly, but the merged docs match 371 entries (main's new match plus this branch's "radio set"). The golden is regenerated with experimental-isolation.test.mjs --update on the merged tree; only the count changes.

@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 is on hold for an engineering owner's decision: the new title prop and the FR7–FR9 and DEC-1 rules this pull request adds to the draft component:DropdownMenuRadioGroup record are not yet approved spec, including the rules that a title rendering no text counts as no title (which also hides an icon-only title), that a label beside a visible title is ignored, and that label becomes optional for every caller. Any engineering owner, the author included, can record that decision by commenting /approve-spec 7fb6b844ecbd1c063bbcbfcbc23077bb136356a4 on this pull request, or ask for changes to those rules. Independently of that decision, two fixes are needed:

  • Rewrite the best practice at line 24 of DropdownMenuRadioGroup.doc.mjs, which still says label "remains required", to the title-or-label rule, and add the title to that doc's usage text and anatomy.
  • Reword proposed PR1 in DropdownMenuRadioGroup.spec.md, which still describes a per-group MutationObserver and no other Effect, to the shared content observer subscription and the three development-warning Effects.

[Automated review]

Comment on lines +152 to +157
- **PR1 — Context, and the title's text.** The group memoizes a small context
value. Only while a `title` is given, it reads its heading's text after each
commit, before paint, and again through one `MutationObserver` on the heading,
disconnected on cleanup, so a title that changes its own text is read again
(proposed FR9). It owns no other Effect, listener, timer, request, or resource
lifecycle.

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.

Proposed PR1 does not match the code: the group subscribes to the shared content observer (observeContent in utils/sharedMutationObserver.ts), whose cleanup removes only this subscription, and the three useDevWarning calls each add an Effect. Reword it to the shared-observer subscription and the warning Effects before an owner approves it.

description:
'Accessible name for the group, applied as aria-label so screen readers announce the radios as a named set, e.g. "Sort by". Required even when aria-labelledby (via base props) points to visible text; that visible reference becomes the computed name while label remains the fallback.',
required: true,
'Accessible name for the group, applied as aria-label so screen readers announce the radios as a named set, e.g. "Sort by". Required unless title is given. An aria-labelledby passed through base props that points at visible text becomes the computed name, while label remains the fallback. With a title, the title names the group instead, so the name holds the visible heading; label (or an aria-label passed through base props) is then ignored, with a development warning when it differs from the text of the title. Without a title, an aria-label passed through base props names the group when label is omitted.',

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 now says label is required only without a title, but the best practice at line 24 of this file still says "label remains required", the usage text (line 14) asks for a label, and the anatomy (lines 42–55) has no title part. Update those three so astryx docs gives one rule.

@vjeux

vjeux commented Oct 30, 2026

Copy link
Copy Markdown
Contributor Author

I'm pausing this work for now to reduce contention on the repo. Thank you for the reviews and the spec guidance.

@vjeux vjeux closed this Oct 30, 2026

This branch was successfully deployed

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants