Repository navigation
Description
Overview
A deep review of the Shell and Navigation component surface. Covers AppShell, Layout primitives, SideNav, TopNav, MobileNav, NavIcon, and Breadcrumbs.
Shell Lab
Interactive experimentation page for testing configurations: PR #571
Run sandbox and navigate to /pages/shell-lab/
Issues Found
Banner
- Banner slot needs an opaque background underneath (fixed by variant system in feat(AppShell): add variant prop for nav/content background styles #597)
Height / Scroll
- Height auto mode needs a min-height of the remaining viewport height (already had
minHeight: 100dvhon root) - In auto mode, sidenav needs to be sticky and span the remaining height only — body scrolls, sidenav stays fully visible (PR fix(AppShell): auto height mode sidenav and sticky backgrounds #615)
- Sticky elements (header, sidenav) need opaque backgrounds so content doesn't show through (PR fix(AppShell): auto height mode sidenav and sticky backgrounds #615)
TopNav
- App name text size should match between SideNav heading and TopNav heading. When super/sub headings are present in SideNav heading, the app name should scale down accordingly (PR fix(nav): consistent gap and heading text sizes #616)
- End-aligned nav items have a larger gap between items compared to center and start aligned (PR fix(nav): consistent gap and heading text sizes #616)
- Mega menu positioning fixed — anchors to , slot-aware alignment via TopNavSlotContext (PR fix(TopNavMegaMenu): positioning, keyboard, alignment, and responsive layout #622)
- Mega menu: click toggle, focus trapping (useXDSPopover), hover as progressive enhancement (PR fix(TopNavMegaMenu): positioning, keyboard, alignment, and responsive layout #622)
- Mega menu: responsive layout with XDSGrid, flex-wrap 2:1 ratio (PR fix(TopNavMegaMenu): positioning, keyboard, alignment, and responsive layout #622)
- Mega menu: removed isSingleColumn prop — responsive grid handles it (PR fix(TopNavMegaMenu): positioning, keyboard, alignment, and responsive layout #622)
- TopNavMenu: switched to useXDSPopover + useListFocus, matching mega menu interaction model (PR fix(TopNavMegaMenu): positioning, keyboard, alignment, and responsive layout #622)
- TopNavMenu: popover styling, chevron, slot-aware alignment (PR fix(TopNavMegaMenu): positioning, keyboard, alignment, and responsive layout #622)
- Mega menu API: refactored to slots API with
items/featuredReactNode props + real renderingXDSTopNavMegaMenuItem+XDSTopNavMegaMenuFeaturedCard(PR refactor(MegaMenu): composed children API + mobile drawer drill-down #659)
SideNav Collapse
- Collapsed mode — implemented via
collapsibleprop (PR feat(SideNav): collapsible sidebar with isCollapsible prop #641) - Collapse toggle auto-rendered in sidenav footer via XDSSideNavCollapseButton (PR feat(SideNav): collapsible sidebar with isCollapsible prop #641)
- Collapsed mode renders as 52px icon-only toolbar (PR feat(SideNav): collapsible sidebar with isCollapsible prop #641)
- Items with icons show icon-only in collapsed mode with tooltip (PR feat(SideNav): collapsible sidebar with isCollapsible prop #641)
- Items without icons hidden in collapsed mode (PR feat(SideNav): collapsible sidebar with isCollapsible prop #641)
- Sub nav items hidden in collapsed mode (PR feat(SideNav): collapsible sidebar with isCollapsible prop #641)
- Collapsed nav items with sub-items: parent icon opens popover with children on hover/click (PR feat(SideNav): popover for collapsed items with children #680)
- SideNav heading icon not interactive when collapsed
SideNav Spacing
- Extra spacing in the sidenav depending on what's visible (PR fix(SideNav): consistent spacing regardless of header/topContent visibility #601)
- Top spacing should always be 8px to the first item, but changes from 4px to 8px depending on whether topContent or heading exists (PR fix(SideNav): consistent spacing regardless of header/topContent visibility #601)
- Would likely need to decrease vertical spacing on the heading to accommodate (PR fix(SideNav): consistent spacing regardless of header/topContent visibility #601)
- When topContent is not visible, there's still lingering spacing (PR fix(SideNav): consistent spacing regardless of header/topContent visibility #601)
- Need 2px spacing between nav items (PR fix(SideNav): consistent spacing regardless of header/topContent visibility #601)
SideNav Heading
- Hardcoded ChevronDownIcon replaced with icon registry
getIcon('chevronDown')(PR fix(SideNav): consistent spacing regardless of header/topContent visibility #601) - Popover menu content padding added (4px, matches DropdownMenu) (PR fix(SideNav): consistent spacing regardless of header/topContent visibility #601)
- Chevron hit target enlarged from 16px to 28px (PR fix(SideNav): consistent spacing regardless of header/topContent visibility #601)
- Layout independent of interactivity — all heading forms (simple/link/menu/full) have same spacing (PR fix(SideNav): consistent spacing regardless of header/topContent visibility #601)
SideNav Footer
- Removed extra wrapper div — single
stickyBottomelement (PR fix(SideNav): consistent spacing regardless of header/topContent visibility #601) - Footer spacing mirrors header: 4px top, 8px sides/bottom (PR fix(SideNav): consistent spacing regardless of header/topContent visibility #601)
Accessibility
- Removed duplicate
role="navigation"from LayoutPanel — XDSSideNav already provides the landmark (PR fix(AppShell): auto height mode sidenav and sticky backgrounds #615)
MobileNav
-
When including mobile nav, need to include the mobile nav toggle (PR feat(AppShell): responsive mobile nav API (#565) #644 — auto toggle)
-
LLMs can miss this — solved by auto mobile nav behavior (PR feat(AppShell): responsive mobile nav API (#565) #644)
-
mobileNav prop: false | MobileNavConfig | ReactNode (PR feat(AppShell): responsive mobile nav API (#565) #644)
-
XDSMobileNavToggle — context-aware hamburger (PR feat(AppShell): responsive mobile nav API (#565) #644)
-
XDSAppShellMobileContext for shared mobile state (PR feat(AppShell): responsive mobile nav API (#565) #644)
-
SideNav render modes: default/topbar/drawer (PR feat(AppShell): responsive mobile nav API (#565) #644)
-
MobileNav header prop for custom drawer headers (PR feat(AppShell): responsive mobile nav API (#565) #644)
-
SideNav collapse button hidden in mobile mode (PR feat(AppShell): responsive mobile nav API (#565) #644)
-
TopNav items collapsing into mobile drawer (context-based rendering) (PR feat(TopNav): mobile responsive rendering (#565) #652)
-
TopNavMenu → collapsible section in mobile drawer (PR feat: shell hardening batch — entry animation, TopNavMenu mobile, collapsible items (#565) #657)
-
Entry animation for mobile drawer — @starting-style needs manual debugging (removed from feat: shell hardening batch — entry animation, TopNavMenu mobile, collapsible items (#565) #657, separate PR)
New Features
-
contentPaddingprop on AppShell for explicit content area padding control (PR feat(AppShell): add contentPadding prop #612) - Nav items with children are collapsible by default — pass
collapsible={false}to opt out (PR feat: shell hardening batch — entry animation, TopNavMenu mobile, collapsible items (#565) #657) - Lift mobile nav context to AppShell level — XDSAppShellMobileContext (PR feat(AppShell): responsive mobile nav API (#565) #644)
- Resizable sidenav via
resizableboolean-or-config prop with drag handle (PR feat(SideNav): resizable sidebar with drag handle #658)
Shell Lab Improvements
- SideNav heading style selector: none / simple / link / menu / full (PR fix(SideNav): consistent spacing regardless of header/topContent visibility #601)
- Footer toggle (PR fix(SideNav): consistent spacing regardless of header/topContent visibility #601)
- All four AppShell variant options (was missing section + elevated) (PR fix(SideNav): consistent spacing regardless of header/topContent visibility #601)
- Config panel position fix (PR fix(SideNav): consistent spacing regardless of header/topContent visibility #601)
Vibe Test: Content Padding
- Ad-hoc vibe test comparing padding mental models (see comment)
-
contentPaddingprop implemented based on results (PR feat(AppShell): add contentPadding prop #612)
Vibe Tests Needed
- Ensure only one product logo is visible between SideNav and TopNav (via guidance)
Common LLM Hallucinations
Observed during Shell Lab construction (without using CLI docs):
| Pattern | What happened | Root cause |
|---|---|---|
XDSSelector options as children |
Used <XDSSelectorOption> children pattern instead of options prop |
Common composition pattern in other systems (Radix, React Aria) |
XDSBadge content as label |
Used <XDSBadge label="3" /> instead of <XDSBadge>3</XDSBadge> |
Local contamination — other components in the file use label prop |
XDSSideNavItem in footer icons slot |
Used nav items instead of XDSButton variant="ghost" icon-only buttons |
Reached for the component already in scope |
XDSSwitch isSelected instead of value |
Used isSelected (React Aria convention) instead of value |
Prior knowledge of other switch APIs |
Recommendation: These need targeted vibe tests to analyze frequency and whether retrieval-led reasoning (CLI docs) prevents them. The local contamination pattern (Badge label) is especially interesting — proximity to other label props pulled the LLM away from the correct children API.
Related Issues
- feat(AppShell): add navBackground prop for nav/content color contrast #346 — feat(AppShell): add navBackground prop for nav/content color contrast (superseded by variant system feat(AppShell): add variant prop for nav/content background styles #597)
- feat: View Transitions for AppShell and collapsible side nav #334 — feat: View Transitions for AppShell and collapsible side nav
- Rework mega menu: remove XDSTopNavMegaMenu, compose with XDSPopover instead #414 — rework mega menu: remove XDSTopNavMegaMenu, compose with XDSPopover instead
Activity
ernestt commentedon Mar 11, 2026
E: I think a nav item should display a tooltip with the label name. A collapsible nav item, should display a popover menu with the items. Example of Task hacking in this capability and Manus doing similar things:
E: It should only expand on explicit button press.
Other notes:
feat(sandbox): add Shell Lab experimentation page
feat(sandbox): Shell Lab — interactive shell configuration playground (…
cixzhang commentedon Mar 12, 2026
Nav Background (merged from #346)
Add
navBackgroundprop to AppShell to control nav area color independently from content:backgroundnavBackgroundsurfacewashwashwashsurfacesurfacewashsurfaceDerived behaviors:
navBackgrounddiffers frombackground, suppress dividers (color contrast already separates)Ernest's feedback: Default should be grey/deemphasized nav. Most modern tools do this. Use theming to change to white.
cixzhang commentedon Mar 13, 2026
Analysis:
padding == nullchecks in Layout components (from PR #536)Reviewed the padding logic across all four layout components to assess whether
padding == nullmishandlespadding === 0.Context
PR #536 added
padding?: SpacingStepto layout components.SpacingStepis0 | 0.5 | 1 | ... | 10. The value0means "explicitly no padding." The checks usepadding == null(loose equality) to detect "no prop provided."Key JavaScript behavior
Loose
==withnullonly matchesnullandundefined. It does not match0. Sopadding == nullcorrectly distinguishes "not passed" from "explicitly zero."File-by-file analysis
XDSLayoutPanel.tsx
padding={0}shouldCollapseSpacing = !hasDivider && !isFullBleed && padding == nullfalse(collapse disabled)isStartPanel && !isFullBleed && padding == null && styles.startPanelpaddingStyles[0]handles all sides uniformlyisEndPanel && !isFullBleed && padding == null && styles.endPanel!hasHeader && !isFullBleed && padding == null && styles.noHeader!hasFooter && !isFullBleed && padding == null && styles.noFooterisFullBleed && padding == null && styles.fullBleedpaddingStyles[0]takes overpadding != null && paddingStyles[padding]paddingStyles[0]→ all sides0px)padding != null && containerPaddingInlineVarStyles[padding]Collapse styles (
collapseStart,collapseEnd) usecalc(-1 * var(--layout-padding-inner-x, 16px)). If these were applied with zero padding, the panel would have a -16px margin eating into adjacent content. Disabling collapse whenpadding={0}is correct.XDSLayoutContent.tsx
padding={0}!hasX && !isFullBleed && padding == null && styles.noXpaddingStyles[0]handles all sidesisFullBleed && padding == null && styles.fullBleedpadding != null && paddingStyles/containerPaddingInlineVarStylesNo collapse logic here — Content doesn't collapse.
XDSLayoutHeader.tsx & XDSLayoutFooter.tsx
Same pattern as Panel for collapse logic (line 135 in both).
shouldCollapseSpacingcorrectly evaluates tofalsewhenpadding={0}, preventing negative margin collapse (collapseBottom/collapseTop).Verdict: The
== nullchecks are correct ✅The loose equality
padding == nullis intentional and correct. It catchesnull/undefined(prop not provided → use CSS variable defaults) but not0(explicit zero → usepaddingStyles[0]).What IS worth fixing
1.
isFullBleed+paddinginteraction is unguardedNothing prevents
<XDSLayoutPanel isFullBleed padding={3} />. When both are set:styles.fullBleedis skipped (gated bypadding == null)paddingStyles[3]is appliedshouldCollapseSpacingsees!isFullBleed→false, so no collapseThe explicit
paddingwins, which is sensible, but theisFullBleedflag silently becomes a no-op. Consider a runtime dev warning or TypeScript overload to prevent this combination.2.
paddingStyles[0]vsstyles.fullBleed— semantic differenceBoth resolve to zero, but
styles.fullBleeduses a literal0whilepaddingStyles[0]goes through the spacing token. This is fine in practice but worth noting — if a theme ever defined--spacing-0as non-zero (unlikely but technically possible), the behavior would diverge.3. Consider explicit equality for readability
While
== nullis correct, it trips up reviewers who expect=== null. Consider:This is purely a readability improvement — the behavior is identical.
Analysis by Navi — reviewing PR #536 padding logic for the Shell & Navigation deep review
feat(AppShell): add variant prop for nav/content background styles (#565
feat(AppShell): add variant prop for nav/content background styles
fix(SideNav): consistent spacing regardless of header/topContent visi…
fix(SideNav): consistent spacing and footer layout
fix(AppShell): content min-height in auto mode
79 remaining items
feat(TopNav): mobile responsive rendering (#565) (#652)
feat: shell hardening batch — entry animation, TopNavMenu mobile, col…
fix(SideNav): make heading icon interactive when collapsed (#696)
feat(sandbox): Shell Lab — interactive shell configuration playground (…
feat(AppShell): add contentPadding prop (#612)
fix(SideNav): consistent spacing regardless of header/topContent visi…
fix(AppShell): auto height mode sidenav and sticky backgrounds (#615)
fix(nav): consistent gap and heading text sizes (#616)
fix(TopNav): mega menu and menu positioning, keyboard, alignment, and…
feat(SideNav): collapsible sidebar with isCollapsible prop (#641)
feat(AppShell): responsive mobile nav API (#565) (#644)
feat(TopNav): mobile responsive rendering (#565) (#652)
feat: shell hardening batch — entry animation, TopNavMenu mobile, col…
fix(SideNav): make heading icon interactive when collapsed (#696)