fix(docsite): show DropdownMenuRadioGroup in properties preview - #5976
fix(docsite): show DropdownMenuRadioGroup in properties preview#5976Kyujenius wants to merge 6 commits into
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
cixzhang
left a comment
There was a problem hiding this comment.
Thanks for putting this under a real DropdownMenu; that preserves the menu semantics and keyboard owner. One thing still blocks this from closing #5888: the PR explicitly starts with the trigger closed, while the issue requires at least two radio choices on first load. Please keep the menu scaffold, make those choices available immediately, and cover that rendered first-load state; selecting one should still move the checked state without errors.
If you'd rather talk it through with someone, we're in Discord.
[Reviewed by Robohands]
|
Correcting my note above: However, I'd rather not add Is that in scope for #5888, or would you prefer this PR stay minimal with a separate issue for the bridge? |
PR Analysis Report📚 Storybook PreviewView Storybook for this PR 🧪 Sandbox PreviewView Sandbox for this PR Modified ComponentsDropdownMenu (@astryxdesign/core) · View in Storybook
Bundle Size Summary
Accessibility AuditStatus: No accessibility violations detected. Visual RegressionStatus: No visual change across 2 compared shot(s). Generated by PR Enrichment workflow | Storybook | Sandbox | View full report |
cixzhang
left a comment
There was a problem hiding this comment.
Thanks for making the choices immediately available and keeping them inside a real menu. One accessibility issue still blocks this: at first load, Chromium moves focus from the page directly into Newest because the wrapper is mounted controlled-open. That drops keyboard users into the middle of the preview before they choose to interact with it. Please keep both radio choices visible on first load without stealing focus, and add browser-level coverage for the initial focus state; selection, checked-state movement, close, and reopen otherwise work.
If you'd rather talk it through, we're in Discord.
[Reviewed by Robohands]
|
@cixzhang Fixed in core: a controlled Covered by three jsdom tests, a new |
cixzhang
left a comment
There was a problem hiding this comment.
Thanks for fixing the first-load visibility and focus theft. One keyboard path still blocks this: in Chromium, after focus reaches the already-open Sort trigger, ArrowDown leaves focus on the trigger, while Enter closes the menu. Both radio items remain outside the tab order, so keyboard users must close and reopen the preview before they can choose either option.
Please keep initial focus where it is while letting the focused trigger move into an already-open menu, and cover that path in real-browser testing. The menu roles, names, selection, checked-state movement, close, and reopen otherwise work.
If you'd rather talk it through, we're in Discord.
[Reviewed by Robohands]
LayoutFooter renders an empty landmark bar on its own, so the docsite properties-tab preview showed an empty stage on first load. Seed representative footer content and wrap it in a Layout parent via playground defaults, mirroring the sibling LayoutHeader fixture, plus docsite tests covering the non-empty preview state and registry shape. Scoped to LayoutFooter only; the DropdownMenuRadioGroup half is dropped here so the radio-item accessibility fix can converge in facebook#5976 (per maintainer review on facebook#5975). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: 1f322fc5-62a9-4f66-ad77-ef2b16a940ff
|
@cixzhang Thanks for the clear repro — that path was a gap I'd missed. With the menu open and focus on the trigger, ArrowDown now moves into the first item (handleButtonKeyDown); Enter/Space still toggle. Covered by a jsdom test and verified in headless Chromium on both the docsite page and the MountedOpen story: a trusted ArrowDown on the Sort button lands focus on Newest without closing and reopening. |
cixzhang
left a comment
There was a problem hiding this comment.
Thanks, this now fixes the full path for me: initial focus stays put, ArrowDown enters cleanly, selection moves, and close/reopen preserves it.
[Reviewed by Robohands]
Summary
DropdownMenuwith aSorttrigger, mounted open) and twoDropdownMenuRadioItemchildren, so the Properties preview shows both choices on first load instead of an empty container.onOpenChangeback into preview state so selecting still closes the menu and the trigger reopens it.DropdownMenufrom moving focus into a controlled menu that mounts already open, so the preview (or any page that renders a menu open on load) does not drop keyboard users into it.Fixes #5888
Notes
Sortafter selection by design. DropdownMenu reads onlybutton.label, and the selected state is shown by the radio mark inside the menu, matching the existing storybook story.DropdownMenu's compound path treated a controlledisMenuOpenthat is true at mount like a programmatic open and focused the first item. A mount is not an open anyone asked for, so it now leaves focus alone; the exemption ends with the first close, and every later open follows the modality rules from fix(dropdown-menu): follow input modality for initial focus so pointer opens don't highlight the first item #4594 (keyboard/programmatic → first item, pointer → menu container). Items-array mode was unaffected and is unchanged.@astryxdesign/corepatches: the.doc.mjsplayground change and theDropdownMenufocus change.AST-009 classification. No real-AT trigger. The change moves only the initial focus destination when a controlled menu mounts already open (FR2: focus destination is not a trigger by itself); roles, names, and announcements are unchanged, and no announcement claim is made. Evidence: Unit (jsdom, rAF-driven focus assertions) and Real browser (headless Chromium:
document.activeElementon load and after a post-mount open).Verification
/components/DropdownMenuRadioGroup?tab=properties:Newest(checked) andOldestrendered without a click.Oldestmoves the check, closes the menu, and updates thevalueknob; the trigger reopens it.core-dropdownmenu--mounted-openstory:document.activeElementis<body>on load.Newest(#4594 unchanged).pnpm exec vitest run packages/core— 9127 passed; the one failure (TabListroving tab stop) is the pre-existing rAF race noted in fix(dropdown-menu): follow input modality for initial focus so pointer opens don't highlight the first item #4594 and passes in isolationpnpm -F @astryxdesign/docsite generate && pnpm -F @astryxdesign/docsite test— 484 passedpnpm -F @astryxdesign/core typecheck,typecheck:docs,pnpm -F storybook typecheck,pnpm check:changesetsScreenshot
TO-BE (video: open Sort, select Oldest)
2026-09-05.mov
2026-09-06-final.mov