Repository navigation
fix(SideNav): make heading icon interactive when collapsed - #696
Merged
Merged
Conversation
Contributor
PR Analysis Report📚 Storybook PreviewView Storybook for this PR 🧪 Sandbox PreviewView Sandbox for this PR Modified ComponentsSideNav · View in Storybook
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 |
cixzhang
force-pushed
the
navi/fix/sidenav-heading-collapsed-icon
branch
3 times, most recently
from
March 19, 2026 16:50
a328146 to
1f1eda1
Compare
When the SideNav is collapsed, XDSSideNavHeading now renders an interactive element instead of a plain div: - headingHref → renders as <a> link so clicking navigates - menu (no href) → renders as <button> that triggers the popover - headingHref + menu → prefers link (href takes priority in icon-only mode) - Neither → renders as static div (no change from before) All collapsed variants include: - aria-label from the heading text for accessibility - XDSTooltip showing the heading name on hover (matches XDSSideNavItem) - navItemStyles.item for consistent appearance with other nav items - Popover placement: 'end' for collapsed menu (opens to the side) Fixes #565 Co-authored-by: Navi <[email protected]>
- Add popoverCollapsed style with marginInlineStart (not marginBlockStart) and minWidth: 180px for end placement - Use popoverCollapsed xstyle for the collapsed menu popover render Co-authored-by: Navi <[email protected]>
Collapsed heading now only supports link navigation (href) or static icon. Menu popover in collapsed mode was not positioning correctly — removed for now. Can revisit later. Co-authored-by: Navi <[email protected]>
Added popoverCollapsed style for collapsed mode popover positioning. The style was referenced but never defined, causing a TypeScript error. Co-authored-by: Navi <[email protected]>
cixzhang
force-pushed
the
navi/fix/sidenav-heading-collapsed-icon
branch
from
March 24, 2026 22:27
1f1eda1 to
3711373
Compare
The collapsed popover menu is not working yet. Simplify the collapsed heading to two modes: link (headingHref) or static icon (div). Menu-only headings fall back to static icon in collapsed state. Co-authored-by: Navi <[email protected]>
cixzhang
marked this pull request as ready for review
March 31, 2026 22:06
cixzhang
added a commit
that referenced
this pull request
Apr 26, 2026
* fix(SideNav): make heading icon interactive when collapsed When the SideNav is collapsed, XDSSideNavHeading now renders an interactive element instead of a plain div: - headingHref → renders as <a> link so clicking navigates - menu (no href) → renders as <button> that triggers the popover - headingHref + menu → prefers link (href takes priority in icon-only mode) - Neither → renders as static div (no change from before) All collapsed variants include: - aria-label from the heading text for accessibility - XDSTooltip showing the heading name on hover (matches XDSSideNavItem) - navItemStyles.item for consistent appearance with other nav items - Popover placement: 'end' for collapsed menu (opens to the side) Fixes #565 Co-authored-by: Navi <[email protected]> * fix: collapsed heading popover positioning and sizing - Add popoverCollapsed style with marginInlineStart (not marginBlockStart) and minWidth: 180px for end placement - Use popoverCollapsed xstyle for the collapsed menu popover render Co-authored-by: Navi <[email protected]> * fix: remove menu interaction in collapsed mode, keep link only Collapsed heading now only supports link navigation (href) or static icon. Menu popover in collapsed mode was not positioning correctly — removed for now. Can revisit later. Co-authored-by: Navi <[email protected]> * fix: add missing popoverCollapsed style definition Added popoverCollapsed style for collapsed mode popover positioning. The style was referenced but never defined, causing a TypeScript error. Co-authored-by: Navi <[email protected]> * fix: remove popover menu in collapsed state The collapsed popover menu is not working yet. Simplify the collapsed heading to two modes: link (headingHref) or static icon (div). Menu-only headings fall back to static icon in collapsed state. Co-authored-by: Navi <[email protected]> --------- Co-authored-by: Navi <[email protected]>
cixzhang
added a commit
that referenced
this pull request
Jun 21, 2026
* fix(SideNav): make heading icon interactive when collapsed When the SideNav is collapsed, XDSSideNavHeading now renders an interactive element instead of a plain div: - headingHref → renders as <a> link so clicking navigates - menu (no href) → renders as <button> that triggers the popover - headingHref + menu → prefers link (href takes priority in icon-only mode) - Neither → renders as static div (no change from before) All collapsed variants include: - aria-label from the heading text for accessibility - XDSTooltip showing the heading name on hover (matches XDSSideNavItem) - navItemStyles.item for consistent appearance with other nav items - Popover placement: 'end' for collapsed menu (opens to the side) Fixes #565 Co-authored-by: Navi <[email protected]> * fix: collapsed heading popover positioning and sizing - Add popoverCollapsed style with marginInlineStart (not marginBlockStart) and minWidth: 180px for end placement - Use popoverCollapsed xstyle for the collapsed menu popover render Co-authored-by: Navi <[email protected]> * fix: remove menu interaction in collapsed mode, keep link only Collapsed heading now only supports link navigation (href) or static icon. Menu popover in collapsed mode was not positioning correctly — removed for now. Can revisit later. Co-authored-by: Navi <[email protected]> * fix: add missing popoverCollapsed style definition Added popoverCollapsed style for collapsed mode popover positioning. The style was referenced but never defined, causing a TypeScript error. Co-authored-by: Navi <[email protected]> * fix: remove popover menu in collapsed state The collapsed popover menu is not working yet. Simplify the collapsed heading to two modes: link (headingHref) or static icon (div). Menu-only headings fall back to static icon in collapsed state. Co-authored-by: Navi <[email protected]> --------- Co-authored-by: Navi <[email protected]>
cixzhang
added a commit
that referenced
this pull request
Jun 21, 2026
* fix(SideNav): make heading icon interactive when collapsed When the SideNav is collapsed, XDSSideNavHeading now renders an interactive element instead of a plain div: - headingHref → renders as <a> link so clicking navigates - menu (no href) → renders as <button> that triggers the popover - headingHref + menu → prefers link (href takes priority in icon-only mode) - Neither → renders as static div (no change from before) All collapsed variants include: - aria-label from the heading text for accessibility - XDSTooltip showing the heading name on hover (matches XDSSideNavItem) - navItemStyles.item for consistent appearance with other nav items - Popover placement: 'end' for collapsed menu (opens to the side) Fixes #565 * fix: collapsed heading popover positioning and sizing - Add popoverCollapsed style with marginInlineStart (not marginBlockStart) and minWidth: 180px for end placement - Use popoverCollapsed xstyle for the collapsed menu popover render * fix: remove menu interaction in collapsed mode, keep link only Collapsed heading now only supports link navigation (href) or static icon. Menu popover in collapsed mode was not positioning correctly — removed for now. Can revisit later. * fix: add missing popoverCollapsed style definition Added popoverCollapsed style for collapsed mode popover positioning. The style was referenced but never defined, causing a TypeScript error. * fix: remove popover menu in collapsed state The collapsed popover menu is not working yet. Simplify the collapsed heading to two modes: link (headingHref) or static icon (div). Menu-only headings fall back to static icon in collapsed state. ---------
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.
Summary
When the SideNav is collapsed to its 52px icon-only toolbar,
XDSSideNavHeadingpreviously rendered the icon inside a plain<div>+<span>— making it completely non-interactive. Users couldn't click the heading icon to navigate or open menus.This PR makes the collapsed heading icon properly interactive:
Behavior by prop combination
headingHref<a>linkmenu(no href)<button>headingHref+menu<a>link<div>(static)All collapsed variants include:
aria-labelfrom the heading text for screen reader accessibilityXDSTooltipshowing the heading name on hover (matchesXDSSideNavItempattern)navItemStyles.itemfor consistent appearance with other nav itemsplacement: 'end'for collapsed menu (opens to the side rather than below)Tests
Added 9 new tests covering all collapsed heading interaction modes.
Fixes #565