fix(SideNav): center footer content in the collapsed rail - #4819
Open
AKnassa wants to merge 1 commit into
Open
Conversation
The collapsed variant of the sticky-bottom slot was missing the alignItems: 'center' that the children slot's collapsed variant already applies, so footer content stretched to the full rail width instead of centering. Fixes facebook#4807
|
@AKnassa is attempting to deploy a commit to the Meta Open Source Team on Vercel. A member of the Team first needs to authorize it. |
AKnassa
marked this pull request as ready for review
August 8, 2026 03:47
Contributor
PR Analysis Report📚 Storybook PreviewView Storybook for this PR 🧪 Sandbox PreviewView Sandbox for this PR Modified ComponentsSideNav (@astryxdesign/core) · View in Storybook
Bundle Size Summary
Accessibility AuditStatus: No accessibility violations detected. Generated by PR Enrichment workflow | Storybook | Sandbox | View full report |
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.
Problem
When a
SideNavis collapsed to its narrow rail, content passed through thechildrenslot is centered — but content passed through thefooterslot is not. It stretches to the rail's full width instead.The two slots are structural twins: each has a "collapsed" style variant, but only the children one (
scrollableCollapsed) setsalignItems: 'center'. The footer one (stickyBottomCollapsed) only zeroes padding, so its flex children fall back to the defaultstretch.Fix
One line:
stickyBottomCollapsednow sets the samealignItems: 'center'as its sibling, so footer content centers in the collapsed rail exactly like children content.The footer row beneath it (collapse button + footer icons) already centered its own content, so nothing else moves — the only visible change is footer content narrower than the rail, which now centers instead of stretching.
Verification
Measured in a real browser (storybook
CollapsibleSidebarstory, collapsed rail 48px wide → 32px content box, footer probe = auto-widthBadge):align-itemsnormal(stretch)centerOne note for reviewers: the issue's exact repro (a
width="100%"icon-only Button) renders identically before and after at rest, becausewidth: 100%resolves to the same 32px content box under bothstretchandcenter. The difference shows for any footer content that doesn't span the full width, and during transient width states (e.g. a resize drag).align-items: centeron both slots — the children slot acts as the control, and the footer assertion fails without the fix.packages/coresuite: 5994/5994 pass; core typecheck, eslint, prettier clean.@astryxdesign/corepatch).Fixes #4807