Repository navigation
feat: shell hardening batch — entry animation, TopNavMenu mobile, collapsible items (#565) - #657
Merged
Merged
Conversation
Contributor
PR Analysis Report📚 Storybook PreviewView Storybook for this PR 🧪 Sandbox PreviewView Sandbox for this PR New ComponentsNavItem
Modified ComponentsAppShell · View in Storybook
MobileNav · View in Storybook
SideNav · View in Storybook
Tooltip · View in Storybook
TopNav · 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/feat/shell-hardening-batch
branch
from
March 17, 2026 19:36
252376b to
594ac19
Compare
added 3 commits
March 18, 2026 04:47
MobileNav entry animation: - @starting-style on backdrop (opacity 0→1) - @starting-style on drawer transforms (slide in from off-screen) - Close animation unchanged (delayed dialog.close) TopNavMenu drawer mode: - Returns null in mobile-bar mode (hidden from simplified top bar) - Renders as collapsible section in drawer mode: - Tappable header with chevron that rotates on expand - Items shown as vertical list with icon + title + description - Smooth expand/collapse via grid-template-rows transition - Default desktop popover unchanged Co-authored-by: Navi <[email protected]>
Items with children are now collapsible:
- Click toggles expand/collapse (items with children become toggle-only)
- Chevron icon rotates to indicate state (via getIcon('chevronDown'))
- Smooth animation via grid-template-rows transition
- defaultIsExpanded (default: true) for uncontrolled mode
- isExpanded + onExpandedChange for controlled mode
- Skipped when sidebar is collapsed (children already hidden)
Co-authored-by: Navi <[email protected]>
Items with children can now be made collapsible via the collapsible prop,
matching the same pattern used on XDSSideNav:
<XDSSideNavItem label="Nav" icon={icon} collapsible>
<XDSSideNavItem label="Sub 1" />
</XDSSideNavItem>
// Or controlled:
<XDSSideNavItem collapsible={{ isCollapsed, onCollapsedChange }}>
- collapsible?: boolean | { defaultIsCollapsed?, isCollapsed?, onCollapsedChange? }
- Click toggles collapse (items with children become toggle-only)
- Chevron icon rotates to indicate state
- Smooth animation via grid-template-rows transition
- Skipped when sidebar is collapsed (children already hidden)
Co-authored-by: Navi <[email protected]>
Contributor
Author
|
cixzhang
force-pushed
the
navi/feat/shell-hardening-batch
branch
from
March 18, 2026 05:05
594ac19 to
c339772
Compare
… divider - Remove @starting-style entry animations from MobileNav (move to separate PR) - TopNavItem drawer mode now matches XDSSideNavItem styles exactly (spacing-2 gap/padding, font-weight-normal, color-text-primary) - TopNavMenu drawer header/items also updated to match SideNavItem - Add XDSDivider between TopNav items and SideNav items in combined drawer Co-authored-by: Navi <[email protected]>
Co-authored-by: Navi <[email protected]>
…on, scroll lock, backdrop blur - Add :active (pressed) states to SideNavItem, TopNavItem drawer mode, and TopNavMenu drawer header/items — essential for mobile tap feedback - Tooltip: suppress on touch devices (hover: none) to prevent eating taps - Tooltip: only show on focusin when :focus-visible matches (keyboard only), prevents tooltip flash on dialog auto-focus - MobileNav: add backdropFilter: blur(2px) to match Dialog overlay style - MobileNav: lock body scroll on open (position: fixed technique) to prevent iOS pull-to-refresh and background content scrolling - MobileNav: touch-action: none on dialog root, pan-y on content area - MobileNav: overscrollBehavior: contain on dialog root - MobileNav: restore scroll position on close/unmount Co-authored-by: Navi <[email protected]>
- SideNavItem: toggle button gets aria-expanded and aria-controls pointing to the children group container - TopNavMenu drawer: toggle button gets aria-controls pointing to the expandable items container - Screen readers now properly announce expand/collapse state and the relationship between toggle and controlled content Co-authored-by: Navi <[email protected]>
…roll lock Replace the classic body position: fixed + scroll save/restore hack with a single overflow: clip on <html>. clip doesn't create a scroll container so there's no bounce, no scrollbar shift, and no need to save/restore scroll position. Co-authored-by: Navi <[email protected]>
Create NavItem/navItemStyles.stylex.ts with the shared base item, selected, and disabled styles used across all nav item components. Eliminates the triple-duplication that required updating 3 files for every style change. - navItemStyles.item — base layout, typography, hover/active states - navItemStyles.selected — deemphasized background, medium weight - navItemStyles.disabled — muted color, no interaction Updated consumers: - SideNavItem: uses navItemStyles.item/selected/disabled, keeps local collapsed/children/label styles - TopNavItem: uses navItemStyles for drawer mode + disabled, keeps local desktop base/selected and focus outline styles - TopNavMenu: composes navItemStyles.item with local header (space-between) and item (indentation) overrides Exported publicly via @xds/core/NavItem for consumers building custom nav items that need to match the system appearance. Co-authored-by: Navi <[email protected]>
:focus-visible is supported in all browsers since 2022. Co-authored-by: Navi <[email protected]>
cixzhang
marked this pull request as ready for review
March 18, 2026 11:03
…ix drawer focus
- SideNavItem: items with children are now collapsible by default.
Pass collapsible={false} to opt out. Previously required explicit
collapsible={true}.
- reset.css: suppress :focus-visible outlines on touch-only devices
via @media (hover: none) and (pointer: coarse). Focus rings serve
keyboard users — on touch devices they're noise that flashes on
tap, dialog auto-focus, and programmatic focus.
- MobileNav: remove tooltip from close button (redundant with
aria-label, caused tooltip flash on dialog open). Add tabIndex={-1}
on drawer panel so showModal() focuses the drawer container (which
has outline: none) instead of the close button.
Co-authored-by: Navi <[email protected]>
- MobileNav: content padding is now 8px all around (was 4px block) - SideNav drawer/drawer-content: render footerIcons (was missing) - SideNav drawer footer: pushed to bottom with marginBlockStart: auto, separated by a divider line - TopNav drawer: 8px block margin around the divider between TopNav items and SideNav items, removed extra margin on SideNav content Co-authored-by: Navi <[email protected]>
Collapsed chevron now rotates 180° (up) instead of -90° (right), matching the TopNavMenu drawer toggle behavior. Co-authored-by: Navi <[email protected]>
…v is in drawer When both topNav and sideNav are provided with the elevated variant, the content area was getting a transparent background on all screen sizes. On mobile the sidenav is in the drawer (not inline), so the wash background showed through making it appear fully gray. Now checks isBelowBreakpoint — on mobile, elevated behaves like top-nav-only and uses the surface content background. Co-authored-by: Navi <[email protected]>
- Auto mobile top bar (sidenav-only layouts) now gets sticky positioning and opaque background in auto height mode, matching TopNav behavior - Elevated variant: use surface bg on mobile when sidenav is in drawer (was showing transparent/gray wash background) Co-authored-by: Navi <[email protected]>
…spacing SideNav topbar mode had its own paddingInline: 8px on top of the auto mobile top bar's 8px, making the heading 24px from edge vs TopNav mobile bar's 16px. Remove the topbar padding so the chain is: auto mobile top bar (8px) + heading (8px) = 16px. Co-authored-by: Navi <[email protected]>
This was referenced Mar 18, 2026
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.
Shell Hardening Batch — #565
Addresses remaining items from the shell & navigation deep review, plus mobile interaction hardening discovered during review.
Features
Collapsible SideNavItem — items with children are now collapsible by default:
collapsibleprop needed — items with children automatically get expand/collapsecollapsible={false}to opt outaria-expanded+aria-controlslinking toggle to children groupTopNavMenu mobile drawer mode — menus render as collapsible sections in the mobile drawer:
aria-expanded+aria-controlsfor accessibilityMobileNav
breakpointconfig — movedsideNavBreakpointandsideNavWidthfrom AppShell props into themobileNavconfig object:mobileNav={{ breakpoint: 'lg' }}instead ofsideNavBreakpoint="lg"sideNavWidthprop (SideNav owns its own width)Shared navItemStyles — extracted common nav item styles into
NavItem/navItemStyles.stylex.ts:navItemStyles.item/.selected/.disabled— single source of truth@xds/core/NavItemfor custom nav itemsMobile Interaction Hardening
Pressed states — added
:activeto all interactive nav items via sharednavItemStylesTooltip touch suppression:
mouseenter: guarded with(hover: none)media queryfocusin: only shows when:focus-visiblematches (keyboard only)MobileNav scroll lock + overlay:
overflow: clipon<html>when open — no scroll bounce, no save/restore neededtouch-action: noneon dialog,pan-yon content areaoverscrollBehavior: containon dialog rootbackdropFilter: blur(2px)matching Dialog overlay styleFocus ring suppression on touch:
reset.css:@media (hover: none) and (pointer: coarse)suppresses:focus-visibleoutlinestabIndex={-1}soshowModal()focuses the drawer (outline: none), not the close buttonDrawer Spacing & Content
marginBlockStart: auto+ dividerStyle Consistency
TopNav items in mobile drawer now match SideNavItem via shared
navItemStyles:spacing-2gap/padding,font-weight-normal,color-text-primaryXDSDividerwith 8px margin between TopNav and SideNav sectionsRemoved (separate PR)
@starting-styleentry animations — needs manual debugging