Repository navigation
Conversation
When the SideNav is collapsed to icon-only mode, items with sub-items (children) now show a popover on click. The popover: - Appears to the right of the icon-only trigger - Contains children rendered in expanded form (not collapsed) - Closes on click outside, escape, or clicking a child item - Shows the parent label as a header in the popover - Uses XDS design tokens for surface, border, elevation, and radius Implementation details: - Renamed XDSSideNavCollapseContext.ts → .tsx to support JSX - Added XDSSideNavCollapseProvider for wrapping popover children with isCollapsed: false so nested items render expanded - XDSSideNavItem uses useXDSPopover for positioning/dismiss - Items without icons return null when collapsed - All :hover styles use @media (hover: hover) guards - Added 9 new tests covering collapsed behavior Co-authored-by: Navi <[email protected]>
Contributor
PR Analysis Report📚 Storybook PreviewView Storybook for this PR 🧪 Sandbox PreviewView Sandbox for this PR Modified ComponentsSideNav · View in Storybook · 🆕 XDSSideNavCollapseProvider, XDSSideNavCollapseContext
Bundle Size Summary
Accessibility AuditStatus: 1 accessibility violation(s) found — 1 serious. XDSSideNav - 1 issue(s)
Generated by PR Enrichment workflow | Storybook | Sandbox | View full report |
Contributor
Author
|
Closing — this needs to be re-implemented on top of current main after the shell hardening batch (#657) refactored SideNavItem significantly. Will re-open as a new PR. |
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
When the SideNav is collapsed to an icon-only toolbar (52px), items that have sub-items (children) now show a popover when clicked. This lets users access nested navigation without expanding the sidebar.
How
Collapsed item with children → Popover trigger
aria-haspopup="dialog")placement: 'end')Context provider for expanded rendering
XDSSideNavCollapseProvidertoXDSSideNavCollapseContext.tsxisCollapsed: falseso nestedXDSSideNavItems render their full label text (not icon-only).ts→.tsxto support JSX in the provider componentCollapsed items without children
aria-labelreturn null)Files changed
XDSSideNavCollapseContext.ts → .tsxXDSSideNavCollapseProvider, converted to JSXXDSSideNavItem.tsxXDSSideNav.test.tsxindex.tsXDSSideNavCollapseProviderexportConventions
:hoverstyles use@media (hover: hover)guardsuseXDSPopoverwithelevation-menushadow,radius-elementborder radius,color-surfacebackgroundTests
Part of #565.