OXY-152: Add dropdown menu support to TopBar - #299
Open
Kalin-Rudnicki wants to merge 2 commits into
Open
Conversation
Add a first-class action/nav popup menu: - New component/DropdownMenu.scala: click-to-open menu of typed items (label, icon, disabled, separator; onClickPush / onSelectAction / onSelect), self-contained open state via a per-instance PageLocalState keyed by a stable id, fixed transparent scrim for outside-click, Escape/Tab/select close, arrow-key roving, Home/End, Enter/Space activate, focus-first-on-open + focus-restore. - A11y: role=button/menu/menuitem, aria-haspopup/expanded/disabled, roving tabindex. - Stylesheet O.DropdownMenu (Trigger/Caret/Scrim/Panel[+align]/Item[+disabled]/Separator/Open), theme tokens only, via existing OxygenStyleSheet.compiled (coreOxygenStyleSheets). - ZIndices.dropdownMenuScrim/Panel (below modals, above content). - TopBar.Item.dropdown / dropdownWithIcon delegate to DropdownMenu (trigger reuses bar chrome), TopBar.menuItem / menuSeparator helpers, right-section menus auto-align end. Flat items unchanged. - Removed DropdownMenu from the component package TODO. - Showcase DropdownMenuPage (TopBar left + user menu, disabled item, separator, standalone) + nav/registration. - Docs: agent-guide component table row. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Adds first-class dropdown / popup-menu support so apps can declare nav/action menus without hand-rolling overlay + click-outside + keyboard + focus logic.
component/DropdownMenu(fills the reserved package TODO): click-to-open menu of typed items (label,icon,disabled,separator;onClickPush/onSelectAction/onSelect). Self-contained open/closed state via a per-instancePageLocalState[Boolean]keyed by a caller-supplied stableid(no page-state threading). Fixed transparent scrim for outside-click; closes on Escape/Tab/select.role=button/menu/menuitem,aria-haspopup/aria-expanded/aria-disabled; Enter/Space/↓ open, ↑/↓ roving (wrap), Home/End, Enter/Space activate, Esc closes + restores focus, focus-first-on-open.O.DropdownMenu(theme tokens) registered via the existingcoreOxygenStyleSheets; newZIndices.dropdownMenuScrim/Panel(below modals, above content).TopBar.item.dropdown(id, label)(...)/dropdownWithIcon, plusTopBar.menuItem/TopBar.menuSeparator; trigger reuses bar chrome + caret; right-section menus auto-align end. Existing flat call sites unchanged.DropdownMenuPage(TopBar left menu + right user menu with disabled item + separator, and a standalone reusable menu) + nav/registration; docs table row.Decisions (open questions resolved — see
report/OXY-152.md)Reusable component (not TopBar-private); typed item model; click trigger (not hover); one flat level (no nested submenus v1);
absolutepanel + scrim; fullrole=menua11y; component-local state via id-keyedPageLocalState.Verification
oxygen-ui-web/compile✅,example-ui-web/compile✅,oxygen-ui-web/test✅ (45 passed). Not browser-tested.Confidence: 7/10
Compiles across lib + example, tests green, no flat-TopBar regression, typed a11y/keyboard wired. Unverified: live browser behaviour (focus/roving rely on rAF + DOM queries);
absolutepanel could be clipped by an ancestoroverflow:hidden(portal variant deferred); id-based state is a new caller contract.Full notes + confidence in
report/OXY-152.md.🤖 Generated with Claude Code