Repository navigation
feat(SideNav): collapsible sidebar with isCollapsible prop - #641
Merged
Merged
Conversation
Implement Approach D (hybrid) from the sidenav collapse vibe test:
- Add isCollapsible prop to XDSSideNav — enables collapse behavior
and provides SideNavCollapseContext to descendants
- Add XDSSideNavCollapseButton — composable toggle button that
reads collapse state from context (inside sidenav) or via ref
(outside sidenav, TODO)
- Supports controlled (isCollapsed + onCollapsedChange) and
uncontrolled (defaultIsCollapsed) modes on XDSSideNav
- Button accepts label/children for customization
- Uses getIcon('chevronLeft') from icon registry
- xdsClassName('side-nav-collapse-button') for theming
Vibe test results (7 prompts):
- D scored 98% avg confidence, 0 workarounds on 6/7 prompts
- Beats C (isCollapsible only) on external toggle placement
(no state management needed — use sideNavRef)
- Beats A (explicit wiring) on simple cases (one prop vs useState + 3 props)
Part of #565
Remove broken collapse props from AppShell: - isSideNavCollapsed - onSideNavCollapsedChange - defaultIsSideNavCollapsed - handleToggleCollapse Collapse is now entirely a SideNav concern: - SideNav provides SideNavCollapseContext when isCollapsible is true - XDSSideNavItem reads context: hides items without icons when collapsed, shows icon-only for items with icons (hides label, endContent, children) - XDSSideNavSection hides section headers when collapsed AppShell changes: - showSideNavInline no longer checks isCollapsed (sidenav always inline above breakpoint, handles its own collapsed visual) - Default mobile nav uses its own open/close state instead of collapse state - Responsive breakpoint tracking simplified (just tracks isBelowBreakpoint) Tests updated to remove collapse prop references. Part of #565
…er icons SideNav collapsed visual treatment: - Root narrows to 52px when collapsed - SideNavHeading: shows icon-only when collapsed, hides if no icon - Footer icons stack vertically when collapsed, border removed - Header area stays visible (heading handles its own collapsed visual) - topContent and footer content hide when collapsed - Footer always renders when collapsible (collapse button stays visible) Part of #565
- SideNav auto-renders XDSSideNavCollapseButton in footer when isCollapsible - Collapse button stays bottom-left: separate footerRow with justify-between - Collapsed heading: reduced padding (2px), centered icon - SideNav owns its own width (260px expanded, 52px collapsed) - AppShell no longer sets panel width — SideNav controls it - Shell lab: isCollapsible toggle, auto-placed collapse button Part of #565
…lapse props Config panel now organized into clear sections: - AppShell (variant, height, banner) - SideNav (show, heading, super/subheading, content, footer, collapsible, breakpoint) - TopNav (show, heading, alignment, style) - Mobile Nav (mode, side) Sections separated by XDSDivider for visual clarity. Removed old AppShell collapse props from config: - defaultCollapsed, controlledCollapse, isCollapsed - collapseProps wiring Collapse is now entirely controlled by isCollapsible on XDSSideNav.
Collapsed state visual treatment: - SideNavItem: icon-only when collapsed (hides label, endContent, children) - SideNavItem: centered icon with reduced padding in collapsed mode - SideNavItem: hidden (display:none) when no icon in collapsed mode - SideNavItem: tooltip with label on hover when collapsed (sibling mode via anchorRef) - SideNavSection: hides section headers when collapsed - SideNavHeading: shows icon-only when collapsed, hidden if no icon - SideNavCollapseButton: uses XDSButton variant=ghost (not raw button) - Footer: column-reverse when collapsed, collapse button at bottom Structural approach: - SideNav does NOT hide its layout zones (stickyTop, scrollable, stickyBottom) - Each child component reads collapse context and decides its own behavior - No hooks violations — all hooks called before early returns Shell lab: - Added icons to Dashboard, Messages, Settings, Projects, Documentation - API Reference and Support have no icons (hide when collapsed) - Config panel reorganized: AppShell, SideNav, TopNav, Mobile Nav sections - Removed old AppShell collapse props (defaultCollapsed, controlledCollapse, isCollapsed) Part of #565
Contributor
PR Analysis Report📚 Storybook PreviewView Storybook for this PR 🧪 Sandbox PreviewView Sandbox for this PR Modified ComponentsAppShell · View in Storybook
SideNav · View in Storybook · 🆕 XDSSideNavCollapseButton
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 |
- SideNavCollapseContext → XDSSideNavCollapseContext - useSideNavCollapse → useXDSSideNavCollapse - Renamed file SideNavCollapseContext.ts → XDSSideNavCollapseContext.ts Per API-Conventions wiki: public hooks use useXDS prefix.
…bject}
Replace 5 separate collapse props with a single `collapsible` prop:
Before (5 props):
<XDSSideNav isCollapsible isCollapsed={v} onCollapsedChange={set}
defaultIsCollapsed hasCollapseButton={false}>
After (1 prop):
<XDSSideNav collapsible>
<XDSSideNav collapsible={{ defaultIsCollapsed: true }}>
<XDSSideNav collapsible={{ isCollapsed: v, onCollapsedChange: set }}>
<XDSSideNav collapsible={{ hasButton: false, isCollapsed: v, onCollapsedChange: set }}>
Validated via vibe test (5 prompts × 4 API shapes):
- `collapsible={bool|obj}` won on simple case (reads like English)
- No naming stutter (vs isCollapsible={{ isCollapsed }})
- Co-located config (vs 5 scattered flat props)
Also adds v0.0.5 codemod:
- Migrates isCollapsible + related props → collapsible
- Removes deprecated AppShell props (isSideNavCollapsed, etc.)
- 7 tests covering all transform cases
Shell lab updated with external toggle demo (TopNav location).
Part of #565
52 of 55 tasks
josephfarina
added a commit
that referenced
this pull request
Mar 17, 2026
SideNav: Add collapsible prop, XDSSideNavCollapseButton component, and collapse-related features/notes to all three translations (docs, docsZh, docsDense). These were added in #641 without doc updates. AppShell: Add missing contentPadding to docsDense propDescriptions. Button: Add missing isDisabled to docsDense propDescriptions. Co-authored-by: Navi <[email protected]>
cixzhang
added a commit
that referenced
this pull request
Apr 26, 2026
* feat(SideNav): add isCollapsible prop and XDSSideNavCollapseButton
Implement Approach D (hybrid) from the sidenav collapse vibe test:
- Add isCollapsible prop to XDSSideNav — enables collapse behavior
and provides SideNavCollapseContext to descendants
- Add XDSSideNavCollapseButton — composable toggle button that
reads collapse state from context (inside sidenav) or via ref
(outside sidenav, TODO)
- Supports controlled (isCollapsed + onCollapsedChange) and
uncontrolled (defaultIsCollapsed) modes on XDSSideNav
- Button accepts label/children for customization
- Uses getIcon('chevronLeft') from icon registry
- xdsClassName('side-nav-collapse-button') for theming
Vibe test results (7 prompts):
- D scored 98% avg confidence, 0 workarounds on 6/7 prompts
- Beats C (isCollapsible only) on external toggle placement
(no state management needed — use sideNavRef)
- Beats A (explicit wiring) on simple cases (one prop vs useState + 3 props)
Part of #565
* refactor: move collapse from AppShell to SideNav, add collapsed visuals
Remove broken collapse props from AppShell:
- isSideNavCollapsed
- onSideNavCollapsedChange
- defaultIsSideNavCollapsed
- handleToggleCollapse
Collapse is now entirely a SideNav concern:
- SideNav provides SideNavCollapseContext when isCollapsible is true
- XDSSideNavItem reads context: hides items without icons when collapsed,
shows icon-only for items with icons (hides label, endContent, children)
- XDSSideNavSection hides section headers when collapsed
AppShell changes:
- showSideNavInline no longer checks isCollapsed (sidenav always inline
above breakpoint, handles its own collapsed visual)
- Default mobile nav uses its own open/close state instead of collapse state
- Responsive breakpoint tracking simplified (just tracks isBelowBreakpoint)
Tests updated to remove collapse prop references.
Part of #565
* feat: collapsed visual — 52px width, icon-only heading, vertical footer icons
SideNav collapsed visual treatment:
- Root narrows to 52px when collapsed
- SideNavHeading: shows icon-only when collapsed, hides if no icon
- Footer icons stack vertically when collapsed, border removed
- Header area stays visible (heading handles its own collapsed visual)
- topContent and footer content hide when collapsed
- Footer always renders when collapsible (collapse button stays visible)
Part of #565
* fix: auto-place collapse button, centered heading, SideNav owns width
- SideNav auto-renders XDSSideNavCollapseButton in footer when isCollapsible
- Collapse button stays bottom-left: separate footerRow with justify-between
- Collapsed heading: reduced padding (2px), centered icon
- SideNav owns its own width (260px expanded, 52px collapsed)
- AppShell no longer sets panel width — SideNav controls it
- Shell lab: isCollapsible toggle, auto-placed collapse button
Part of #565
* fix: remove extra quote in shell lab
* fix: actually render the collapse button in SideNav footer
* fix: footer layout — column-reverse for collapsed, simpler footerIcons rendering
* refactor(shell-lab): reorganize config panel, remove old AppShell collapse props
Config panel now organized into clear sections:
- AppShell (variant, height, banner)
- SideNav (show, heading, super/subheading, content, footer, collapsible, breakpoint)
- TopNav (show, heading, alignment, style)
- Mobile Nav (mode, side)
Sections separated by XDSDivider for visual clarity.
Removed old AppShell collapse props from config:
- defaultCollapsed, controlledCollapse, isCollapsed
- collapseProps wiring
Collapse is now entirely controlled by isCollapsible on XDSSideNav.
* feat(SideNav): collapsed visuals, tooltips, icons, config panel cleanup
Collapsed state visual treatment:
- SideNavItem: icon-only when collapsed (hides label, endContent, children)
- SideNavItem: centered icon with reduced padding in collapsed mode
- SideNavItem: hidden (display:none) when no icon in collapsed mode
- SideNavItem: tooltip with label on hover when collapsed (sibling mode via anchorRef)
- SideNavSection: hides section headers when collapsed
- SideNavHeading: shows icon-only when collapsed, hidden if no icon
- SideNavCollapseButton: uses XDSButton variant=ghost (not raw button)
- Footer: column-reverse when collapsed, collapse button at bottom
Structural approach:
- SideNav does NOT hide its layout zones (stickyTop, scrollable, stickyBottom)
- Each child component reads collapse context and decides its own behavior
- No hooks violations — all hooks called before early returns
Shell lab:
- Added icons to Dashboard, Messages, Settings, Projects, Documentation
- API Reference and Support have no icons (hide when collapsed)
- Config panel reorganized: AppShell, SideNav, TopNav, Mobile Nav sections
- Removed old AppShell collapse props (defaultCollapsed, controlledCollapse, isCollapsed)
Part of #565
* refactor: prefix context and hook with XDS per API conventions
- SideNavCollapseContext → XDSSideNavCollapseContext
- useSideNavCollapse → useXDSSideNavCollapse
- Renamed file SideNavCollapseContext.ts → XDSSideNavCollapseContext.ts
Per API-Conventions wiki: public hooks use useXDS prefix.
* refactor(SideNav): unify collapse props into collapsible={boolean | object}
Replace 5 separate collapse props with a single `collapsible` prop:
Before (5 props):
<XDSSideNav isCollapsible isCollapsed={v} onCollapsedChange={set}
defaultIsCollapsed hasCollapseButton={false}>
After (1 prop):
<XDSSideNav collapsible>
<XDSSideNav collapsible={{ defaultIsCollapsed: true }}>
<XDSSideNav collapsible={{ isCollapsed: v, onCollapsedChange: set }}>
<XDSSideNav collapsible={{ hasButton: false, isCollapsed: v, onCollapsedChange: set }}>
Validated via vibe test (5 prompts × 4 API shapes):
- `collapsible={bool|obj}` won on simple case (reads like English)
- No naming stutter (vs isCollapsible={{ isCollapsed }})
- Co-located config (vs 5 scattered flat props)
Also adds v0.0.5 codemod:
- Migrates isCollapsible + related props → collapsible
- Removes deprecated AppShell props (isSideNavCollapsed, etc.)
- 7 tests covering all transform cases
Shell lab updated with external toggle demo (TopNav location).
Part of #565
cixzhang
added a commit
that referenced
this pull request
Jun 21, 2026
* feat(SideNav): add isCollapsible prop and XDSSideNavCollapseButton
Implement Approach D (hybrid) from the sidenav collapse vibe test:
- Add isCollapsible prop to XDSSideNav — enables collapse behavior
and provides SideNavCollapseContext to descendants
- Add XDSSideNavCollapseButton — composable toggle button that
reads collapse state from context (inside sidenav) or via ref
(outside sidenav, TODO)
- Supports controlled (isCollapsed + onCollapsedChange) and
uncontrolled (defaultIsCollapsed) modes on XDSSideNav
- Button accepts label/children for customization
- Uses getIcon('chevronLeft') from icon registry
- xdsClassName('side-nav-collapse-button') for theming
Vibe test results (7 prompts):
- D scored 98% avg confidence, 0 workarounds on 6/7 prompts
- Beats C (isCollapsible only) on external toggle placement
(no state management needed — use sideNavRef)
- Beats A (explicit wiring) on simple cases (one prop vs useState + 3 props)
Part of #565
* refactor: move collapse from AppShell to SideNav, add collapsed visuals
Remove broken collapse props from AppShell:
- isSideNavCollapsed
- onSideNavCollapsedChange
- defaultIsSideNavCollapsed
- handleToggleCollapse
Collapse is now entirely a SideNav concern:
- SideNav provides SideNavCollapseContext when isCollapsible is true
- XDSSideNavItem reads context: hides items without icons when collapsed,
shows icon-only for items with icons (hides label, endContent, children)
- XDSSideNavSection hides section headers when collapsed
AppShell changes:
- showSideNavInline no longer checks isCollapsed (sidenav always inline
above breakpoint, handles its own collapsed visual)
- Default mobile nav uses its own open/close state instead of collapse state
- Responsive breakpoint tracking simplified (just tracks isBelowBreakpoint)
Tests updated to remove collapse prop references.
Part of #565
* feat: collapsed visual — 52px width, icon-only heading, vertical footer icons
SideNav collapsed visual treatment:
- Root narrows to 52px when collapsed
- SideNavHeading: shows icon-only when collapsed, hides if no icon
- Footer icons stack vertically when collapsed, border removed
- Header area stays visible (heading handles its own collapsed visual)
- topContent and footer content hide when collapsed
- Footer always renders when collapsible (collapse button stays visible)
Part of #565
* fix: auto-place collapse button, centered heading, SideNav owns width
- SideNav auto-renders XDSSideNavCollapseButton in footer when isCollapsible
- Collapse button stays bottom-left: separate footerRow with justify-between
- Collapsed heading: reduced padding (2px), centered icon
- SideNav owns its own width (260px expanded, 52px collapsed)
- AppShell no longer sets panel width — SideNav controls it
- Shell lab: isCollapsible toggle, auto-placed collapse button
Part of #565
* fix: remove extra quote in shell lab
* fix: actually render the collapse button in SideNav footer
* fix: footer layout — column-reverse for collapsed, simpler footerIcons rendering
* refactor(shell-lab): reorganize config panel, remove old AppShell collapse props
Config panel now organized into clear sections:
- AppShell (variant, height, banner)
- SideNav (show, heading, super/subheading, content, footer, collapsible, breakpoint)
- TopNav (show, heading, alignment, style)
- Mobile Nav (mode, side)
Sections separated by XDSDivider for visual clarity.
Removed old AppShell collapse props from config:
- defaultCollapsed, controlledCollapse, isCollapsed
- collapseProps wiring
Collapse is now entirely controlled by isCollapsible on XDSSideNav.
* feat(SideNav): collapsed visuals, tooltips, icons, config panel cleanup
Collapsed state visual treatment:
- SideNavItem: icon-only when collapsed (hides label, endContent, children)
- SideNavItem: centered icon with reduced padding in collapsed mode
- SideNavItem: hidden (display:none) when no icon in collapsed mode
- SideNavItem: tooltip with label on hover when collapsed (sibling mode via anchorRef)
- SideNavSection: hides section headers when collapsed
- SideNavHeading: shows icon-only when collapsed, hidden if no icon
- SideNavCollapseButton: uses XDSButton variant=ghost (not raw button)
- Footer: column-reverse when collapsed, collapse button at bottom
Structural approach:
- SideNav does NOT hide its layout zones (stickyTop, scrollable, stickyBottom)
- Each child component reads collapse context and decides its own behavior
- No hooks violations — all hooks called before early returns
Shell lab:
- Added icons to Dashboard, Messages, Settings, Projects, Documentation
- API Reference and Support have no icons (hide when collapsed)
- Config panel reorganized: AppShell, SideNav, TopNav, Mobile Nav sections
- Removed old AppShell collapse props (defaultCollapsed, controlledCollapse, isCollapsed)
Part of #565
* refactor: prefix context and hook with XDS per API conventions
- SideNavCollapseContext → XDSSideNavCollapseContext
- useSideNavCollapse → useXDSSideNavCollapse
- Renamed file SideNavCollapseContext.ts → XDSSideNavCollapseContext.ts
Per API-Conventions wiki: public hooks use useXDS prefix.
* refactor(SideNav): unify collapse props into collapsible={boolean | object}
Replace 5 separate collapse props with a single `collapsible` prop:
Before (5 props):
<XDSSideNav isCollapsible isCollapsed={v} onCollapsedChange={set}
defaultIsCollapsed hasCollapseButton={false}>
After (1 prop):
<XDSSideNav collapsible>
<XDSSideNav collapsible={{ defaultIsCollapsed: true }}>
<XDSSideNav collapsible={{ isCollapsed: v, onCollapsedChange: set }}>
<XDSSideNav collapsible={{ hasButton: false, isCollapsed: v, onCollapsedChange: set }}>
Validated via vibe test (5 prompts × 4 API shapes):
- `collapsible={bool|obj}` won on simple case (reads like English)
- No naming stutter (vs isCollapsible={{ isCollapsed }})
- Co-located config (vs 5 scattered flat props)
Also adds v0.0.5 codemod:
- Migrates isCollapsible + related props → collapsible
- Removes deprecated AppShell props (isSideNavCollapsed, etc.)
- 7 tests covering all transform cases
Shell lab updated with external toggle demo (TopNav location).
Part of #565
cixzhang
added a commit
that referenced
this pull request
Jun 21, 2026
* feat(SideNav): add isCollapsible prop and XDSSideNavCollapseButton
Implement Approach D (hybrid) from the sidenav collapse vibe test:
- Add isCollapsible prop to XDSSideNav — enables collapse behavior
and provides SideNavCollapseContext to descendants
- Add XDSSideNavCollapseButton — composable toggle button that
reads collapse state from context (inside sidenav) or via ref
(outside sidenav, TODO)
- Supports controlled (isCollapsed + onCollapsedChange) and
uncontrolled (defaultIsCollapsed) modes on XDSSideNav
- Button accepts label/children for customization
- Uses getIcon('chevronLeft') from icon registry
- xdsClassName('side-nav-collapse-button') for theming
Vibe test results (7 prompts):
- D scored 98% avg confidence, 0 workarounds on 6/7 prompts
- Beats C (isCollapsible only) on external toggle placement
(no state management needed — use sideNavRef)
- Beats A (explicit wiring) on simple cases (one prop vs useState + 3 props)
Part of #565
* refactor: move collapse from AppShell to SideNav, add collapsed visuals
Remove broken collapse props from AppShell:
- isSideNavCollapsed
- onSideNavCollapsedChange
- defaultIsSideNavCollapsed
- handleToggleCollapse
Collapse is now entirely a SideNav concern:
- SideNav provides SideNavCollapseContext when isCollapsible is true
- XDSSideNavItem reads context: hides items without icons when collapsed,
shows icon-only for items with icons (hides label, endContent, children)
- XDSSideNavSection hides section headers when collapsed
AppShell changes:
- showSideNavInline no longer checks isCollapsed (sidenav always inline
above breakpoint, handles its own collapsed visual)
- Default mobile nav uses its own open/close state instead of collapse state
- Responsive breakpoint tracking simplified (just tracks isBelowBreakpoint)
Tests updated to remove collapse prop references.
Part of #565
* feat: collapsed visual — 52px width, icon-only heading, vertical footer icons
SideNav collapsed visual treatment:
- Root narrows to 52px when collapsed
- SideNavHeading: shows icon-only when collapsed, hides if no icon
- Footer icons stack vertically when collapsed, border removed
- Header area stays visible (heading handles its own collapsed visual)
- topContent and footer content hide when collapsed
- Footer always renders when collapsible (collapse button stays visible)
Part of #565
* fix: auto-place collapse button, centered heading, SideNav owns width
- SideNav auto-renders XDSSideNavCollapseButton in footer when isCollapsible
- Collapse button stays bottom-left: separate footerRow with justify-between
- Collapsed heading: reduced padding (2px), centered icon
- SideNav owns its own width (260px expanded, 52px collapsed)
- AppShell no longer sets panel width — SideNav controls it
- Shell lab: isCollapsible toggle, auto-placed collapse button
Part of #565
* fix: remove extra quote in shell lab
* fix: actually render the collapse button in SideNav footer
* fix: footer layout — column-reverse for collapsed, simpler footerIcons rendering
* refactor(shell-lab): reorganize config panel, remove old AppShell collapse props
Config panel now organized into clear sections:
- AppShell (variant, height, banner)
- SideNav (show, heading, super/subheading, content, footer, collapsible, breakpoint)
- TopNav (show, heading, alignment, style)
- Mobile Nav (mode, side)
Sections separated by XDSDivider for visual clarity.
Removed old AppShell collapse props from config:
- defaultCollapsed, controlledCollapse, isCollapsed
- collapseProps wiring
Collapse is now entirely controlled by isCollapsible on XDSSideNav.
* feat(SideNav): collapsed visuals, tooltips, icons, config panel cleanup
Collapsed state visual treatment:
- SideNavItem: icon-only when collapsed (hides label, endContent, children)
- SideNavItem: centered icon with reduced padding in collapsed mode
- SideNavItem: hidden (display:none) when no icon in collapsed mode
- SideNavItem: tooltip with label on hover when collapsed (sibling mode via anchorRef)
- SideNavSection: hides section headers when collapsed
- SideNavHeading: shows icon-only when collapsed, hidden if no icon
- SideNavCollapseButton: uses XDSButton variant=ghost (not raw button)
- Footer: column-reverse when collapsed, collapse button at bottom
Structural approach:
- SideNav does NOT hide its layout zones (stickyTop, scrollable, stickyBottom)
- Each child component reads collapse context and decides its own behavior
- No hooks violations — all hooks called before early returns
Shell lab:
- Added icons to Dashboard, Messages, Settings, Projects, Documentation
- API Reference and Support have no icons (hide when collapsed)
- Config panel reorganized: AppShell, SideNav, TopNav, Mobile Nav sections
- Removed old AppShell collapse props (defaultCollapsed, controlledCollapse, isCollapsed)
Part of #565
* refactor: prefix context and hook with XDS per API conventions
- SideNavCollapseContext → XDSSideNavCollapseContext
- useSideNavCollapse → useXDSSideNavCollapse
- Renamed file SideNavCollapseContext.ts → XDSSideNavCollapseContext.ts
Per API-Conventions wiki: public hooks use useXDS prefix.
* refactor(SideNav): unify collapse props into collapsible={boolean | object}
Replace 5 separate collapse props with a single `collapsible` prop:
Before (5 props):
<XDSSideNav isCollapsible isCollapsed={v} onCollapsedChange={set}
defaultIsCollapsed hasCollapseButton={false}>
After (1 prop):
<XDSSideNav collapsible>
<XDSSideNav collapsible={{ defaultIsCollapsed: true }}>
<XDSSideNav collapsible={{ isCollapsed: v, onCollapsedChange: set }}>
<XDSSideNav collapsible={{ hasButton: false, isCollapsed: v, onCollapsedChange: set }}>
Validated via vibe test (5 prompts × 4 API shapes):
- `collapsible={bool|obj}` won on simple case (reads like English)
- No naming stutter (vs isCollapsible={{ isCollapsed }})
- Co-located config (vs 5 scattered flat props)
Also adds v0.0.5 codemod:
- Migrates isCollapsible + related props → collapsible
- Removes deprecated AppShell props (isSideNavCollapsed, etc.)
- 7 tests covering all transform cases
Shell lab updated with external toggle demo (TopNav location).
Part of #565
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
Adds collapsible sidebar support to XDSSideNav. Collapse is owned entirely by the SideNav — not the AppShell.
API
Architecture
{ isCollapsed, toggle, isCollapsible }to all descendants.XDSSideNavItem: icon-only when collapsed (hides label, endContent, children). Hidden when no icon. Tooltip with label on hover (sibling mode via anchorRef).XDSSideNavSection: hides section headers when collapsed.XDSSideNavHeading: shows icon-only when collapsed. Hidden if no icon.XDSSideNavCollapseButton: uses XDSButton variant=ghost. Auto-rendered in footer when isCollapsible.Breaking Changes
Removed non-functional AppShell collapse props:
isSideNavCollapsedonSideNavCollapsedChangedefaultIsSideNavCollapsedThese never worked properly. Collapse is now
isCollapsibleon XDSSideNav.Visual Treatment
Vibe Test
Compared 4 approaches across 7 prompts. Approach D (hybrid: isCollapsible + composable XDSSideNavCollapseButton) won with 98% avg confidence and 0 workarounds. See #565 comment for full results.
Shell Lab
Test plan
Part of #565