Skip to content

fix(SideNav): consistent spacing regardless of header/topContent visibility - #601

Merged
cixzhang merged 4 commits into
mainfrom
navi/fix/sidenav-spacing
Mar 14, 2026
Merged

cixzhang merged 4 commits into
mainfrom
navi/fix/sidenav-spacing

Conversation

@cixzhang

@cixzhang cixzhang commented Mar 13, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Fixes spacing inconsistencies in SideNav and updates the Shell Lab sandbox page for better experimentation. Addresses the sidenav spacing items from #565.

SideNav Spacing Changes

Header area (stickyTop container)

  • Container now owns all spacing: 8px padding top/sides, 4px bottom, 8px gap between children
  • Heading and topContent no longer manage their own margins — the container gap handles vertical rhythm
  • Consistent layout regardless of heading interactivity (simple, link, menu, full)

Scrollable body

  • 8px top/bottom padding when no adjacent sticky area (it's the edge)
  • 4px top/bottom padding when adjacent to sticky header/footer (4px + 4px from sticky = 8px total)

Footer area

  • Mirrors header: 4px top padding, 8px sides/bottom, 8px gap
  • Removed extra wrapper div — stickyBottom now has all styles directly
  • Border-top divider between body and footer

Heading (XDSSideNavHeading)

  • Removed all margins from heading — container handles spacing
  • Layout is now independent of interactivity (simple/link/menu/full all have the same position)
  • interactive style only adds visual behavior (hover, cursor, border-radius), no layout changes
  • Removed interactiveInset style entirely

Spacing Matrix

Configuration Top of body Bottom of body
No header, no footer 8px 8px
Header only 4px (+ 4px from header bottom = 8px gap) 8px
Footer only 8px 4px (+ 4px from footer top = 8px gap)
Header + Footer 4px 4px

Shell Lab Changes

New options

  • SideNav Heading Style selector: none / simple / link / menu / full (replaces boolean toggle)
    • Simple: icon + heading text only
    • Link: icon + heading with href
    • Menu: icon + heading + popover menu with chevron
    • Full: superheading + heading + subheading + menu
  • Footer toggle: shows sample footer content (account section) above footer icons
  • All four AppShell variants: section, wash, surface, elevated (was missing section + elevated)

Fixes

  • Config panel and toggle button use inline styles for position (StyleX wasn't compiling fixed position properties)
  • Config panel z-index bumped to 10000/10001 to sit above all shell layers

Test plan

  • Tested all heading style variants in Shell Lab
  • Tested with/without header, footer, topContent, footerIcons in all combinations
  • Verified spacing is consistent regardless of which zones are visible

Fixes parts of #565 (sidenav spacing)

@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Meta Open Source bot. label Mar 13, 2026
@github-actions

github-actions Bot commented Mar 13, 2026 •

Copy link
Copy Markdown
Contributor

PR Analysis Report

📚 Storybook Preview

View Storybook for this PR
GitHub Pages may take up to a minute to hydrate after deploy.

🧪 Sandbox Preview

View Sandbox for this PR
GitHub Pages may take up to a minute to hydrate after deploy.

Modified Components

SideNav · View in Storybook
Metric Before After Delta
Bundle Size (ESM) N/A 711B N/A
Lines of Code N/A 822 -
Complexity N/A Very High (71) -

Bundle Size Summary

Package Size (ESM) Size (CJS) Gzipped
@xds/core 9.3KB 15.0KB 2.4KB

Accessibility Audit

Status: 1 accessibility violation(s) found — 1 serious.

XDSSideNav - 1 issue(s)
  • 🟠 serious: Ensure links have discernible text
    • Rule: link-name · Affects 1/8 stories · Learn more
    • WCAG: 2.4.4, 4.1.2 (Level A)

Generated by PR Enrichment workflow | Storybook | Sandbox | View full report

@cixzhang
cixzhang force-pushed the navi/fix/sidenav-spacing branch from 9f7c3b5 to 58dc43b Compare March 13, 2026 09:43
@cixzhang
cixzhang marked this pull request as draft March 13, 2026 11:04
@cixzhang
cixzhang force-pushed the navi/fix/sidenav-spacing branch from 58dc43b to daedc45 Compare March 13, 2026 18:06
- topContent: paddingBlockStart 8px (was paddingBlock 4px)
- SideNavHeading: paddingBlock 8px (was 12px)
- SideNavSection items: 2px gap between nav items
- Footer: single inner wrapper with 8px gap between footer and footerIcons,
  paddingBlockEnd 8px, border on the wrapper instead of footerIcons

Part of #565
@cixzhang
cixzhang force-pushed the navi/fix/sidenav-spacing branch from daedc45 to f32f093 Compare March 13, 2026 22:29
Navi and others added 2 commits March 13, 2026 22:29
Replace the showSideNavHeading toggle with a selector offering
five heading variants:
- none: no heading
- simple: icon + heading text only
- link: icon + heading with headingHref
- menu: icon + heading + popover menu (shows chevron)
- full: superheading + heading + subheading + menu

Also fixes z-index on config overlay (16px string values for
position properties).
- Move margin from heading to stickyTop container (8px padding all
  around, 4px bottom). Heading layout is now independent of interactivity.
- Mirror footer: 4px top, 8px sides/bottom. Remove extra wrapper div.
- Scrollable body: 8px top/bottom when no adjacent sticky area,
  4px when adjacent (4px + 4px from sticky = 8px total gap).
- Remove heading marginInline (container handles it).
- Shell lab: add Footer toggle, SideNav heading style selector,
  all four AppShell variant options, fix config panel z-index.

Ref #565
@cixzhang
cixzhang marked this pull request as ready for review March 13, 2026 23:44
…hevron hit target

- Replace hardcoded ChevronDownIcon SVG with getIcon('chevronDown')
  from the global icon registry (themeable)
- Add 4px padding to popover content (matches DropdownMenu)
- Increase chevron hit target from 16px to 28px (min-width/min-height)

Ref #565
@cixzhang
cixzhang merged commit 38311d3 into main Mar 14, 2026
13 checks passed
This was referenced Mar 14, 2026
@cixzhang
cixzhang deleted the navi/fix/sidenav-spacing branch March 20, 2026 16:59
cixzhang added a commit that referenced this pull request Apr 26, 2026
…bility (#601)

* fix(SideNav): consistent spacing and footer layout

- topContent: paddingBlockStart 8px (was paddingBlock 4px)
- SideNavHeading: paddingBlock 8px (was 12px)
- SideNavSection items: 2px gap between nav items
- Footer: single inner wrapper with 8px gap between footer and footerIcons,
  paddingBlockEnd 8px, border on the wrapper instead of footerIcons

Part of #565

* feat(shell-lab): add SideNav heading style selector

Replace the showSideNavHeading toggle with a selector offering
five heading variants:
- none: no heading
- simple: icon + heading text only
- link: icon + heading with headingHref
- menu: icon + heading + popover menu (shows chevron)
- full: superheading + heading + subheading + menu

Also fixes z-index on config overlay (16px string values for
position properties).

* fix(SideNav): consistent spacing across header, body, and footer zones

- Move margin from heading to stickyTop container (8px padding all
  around, 4px bottom). Heading layout is now independent of interactivity.
- Mirror footer: 4px top, 8px sides/bottom. Remove extra wrapper div.
- Scrollable body: 8px top/bottom when no adjacent sticky area,
  4px when adjacent (4px + 4px from sticky = 8px total gap).
- Remove heading marginInline (container handles it).
- Shell lab: add Footer toggle, SideNav heading style selector,
  all four AppShell variant options, fix config panel z-index.

Ref #565

* fix(SideNavHeading): use icon registry, add popover padding, bigger chevron hit target

- Replace hardcoded ChevronDownIcon SVG with getIcon('chevronDown')
  from the global icon registry (themeable)
- Add 4px padding to popover content (matches DropdownMenu)
- Increase chevron hit target from 16px to 28px (min-width/min-height)

Ref #565

---------

Co-authored-by: Navi <[email protected]>
cixzhang added a commit that referenced this pull request Jun 21, 2026
…bility (#601)

* fix(SideNav): consistent spacing and footer layout

- topContent: paddingBlockStart 8px (was paddingBlock 4px)
- SideNavHeading: paddingBlock 8px (was 12px)
- SideNavSection items: 2px gap between nav items
- Footer: single inner wrapper with 8px gap between footer and footerIcons,
  paddingBlockEnd 8px, border on the wrapper instead of footerIcons

Part of #565

* feat(shell-lab): add SideNav heading style selector

Replace the showSideNavHeading toggle with a selector offering
five heading variants:
- none: no heading
- simple: icon + heading text only
- link: icon + heading with headingHref
- menu: icon + heading + popover menu (shows chevron)
- full: superheading + heading + subheading + menu

Also fixes z-index on config overlay (16px string values for
position properties).

* fix(SideNav): consistent spacing across header, body, and footer zones

- Move margin from heading to stickyTop container (8px padding all
  around, 4px bottom). Heading layout is now independent of interactivity.
- Mirror footer: 4px top, 8px sides/bottom. Remove extra wrapper div.
- Scrollable body: 8px top/bottom when no adjacent sticky area,
  4px when adjacent (4px + 4px from sticky = 8px total gap).
- Remove heading marginInline (container handles it).
- Shell lab: add Footer toggle, SideNav heading style selector,
  all four AppShell variant options, fix config panel z-index.

Ref #565

* fix(SideNavHeading): use icon registry, add popover padding, bigger chevron hit target

- Replace hardcoded ChevronDownIcon SVG with getIcon('chevronDown')
  from the global icon registry (themeable)
- Add 4px padding to popover content (matches DropdownMenu)
- Increase chevron hit target from 16px to 28px (min-width/min-height)

Ref #565

---------

Co-authored-by: Navi <[email protected]>
cixzhang added a commit that referenced this pull request Jun 21, 2026
…bility (#601)

* fix(SideNav): consistent spacing and footer layout

- topContent: paddingBlockStart 8px (was paddingBlock 4px)
- SideNavHeading: paddingBlock 8px (was 12px)
- SideNavSection items: 2px gap between nav items
- Footer: single inner wrapper with 8px gap between footer and footerIcons,
  paddingBlockEnd 8px, border on the wrapper instead of footerIcons

Part of #565

* feat(shell-lab): add SideNav heading style selector

Replace the showSideNavHeading toggle with a selector offering
five heading variants:
- none: no heading
- simple: icon + heading text only
- link: icon + heading with headingHref
- menu: icon + heading + popover menu (shows chevron)
- full: superheading + heading + subheading + menu

Also fixes z-index on config overlay (16px string values for
position properties).

* fix(SideNav): consistent spacing across header, body, and footer zones

- Move margin from heading to stickyTop container (8px padding all
  around, 4px bottom). Heading layout is now independent of interactivity.
- Mirror footer: 4px top, 8px sides/bottom. Remove extra wrapper div.
- Scrollable body: 8px top/bottom when no adjacent sticky area,
  4px when adjacent (4px + 4px from sticky = 8px total gap).
- Remove heading marginInline (container handles it).
- Shell lab: add Footer toggle, SideNav heading style selector,
  all four AppShell variant options, fix config panel z-index.

Ref #565

* fix(SideNavHeading): use icon registry, add popover padding, bigger chevron hit target

- Replace hardcoded ChevronDownIcon SVG with getIcon('chevronDown')
  from the global icon registry (themeable)
- Add 4px padding to popover content (matches DropdownMenu)
- Increase chevron hit target from 16px to 28px (min-width/min-height)

Ref #565

---------
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Meta Open Source bot.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant