fix: NavigationBar no longer reserves space for absent start content#664
Merged
adrienzheng-cb merged 5 commits intomasterfrom May 6, 2026
Merged
fix: NavigationBar no longer reserves space for absent start content#664adrienzheng-cb merged 5 commits intomasterfrom
adrienzheng-cb merged 5 commits intomasterfrom
Conversation
Collaborator
✅ Heimdall Review Status
✅
|
| Code Owner | Status | Calculation | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|
| ui-systems-eng-team |
✅
1/1
|
Denominator calculation
|
hcopp
reviewed
May 5, 2026
| * | ||
| * @default 'visibility-hidden' | ||
| */ | ||
| collapsedStyle?: 'visibility-hidden' | 'display-none'; |
Contributor
There was a problem hiding this comment.
Do you think it is beneficial in some cases to still support visibility rather than display? I could see us using our new breaking change policy to go ahead and change to display none.
Contributor
Author
There was a problem hiding this comment.
good call. switched to always using display:none.
hcopp
reviewed
May 5, 2026
hcopp
approved these changes
May 6, 2026
Contributor
hcopp
left a comment
There was a problem hiding this comment.
Code changes look great, thank you. A lot of changes in visreg (> 10 for NavBar as expected + a few flaky ones), could in the future combine stories for NavBar so we have one screenshot.
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
Two related layout bugs in
NavigationBar:Phantom gap when no
startis provided. TheCollapsiblewrapping the start slot wasalways a flex child of the outer
HStack. CSSgapapplies to all flex items regardless ofsize — so even when the Collapsible was fully collapsed (zero width), it still contributed a
leading gap before the page title.
Start slot transition was jarring. The CSS
gapbetween the Collapsible and the title isstatic — it snapped to full size on expand and disappeared abruptly on collapse. This made the
transition feel sudden rather than smooth.
Changes
Collapsible— newcollapsedStylepropAdds
collapsedStyle?: 'visibility-hidden' | 'display-none'to control how the element is hiddenafter the collapse animation completes.
'visibility-hidden'(default) — existing behavior, element stays in the layout flow'display-none'— appliesdisplay: none, fully removing the element from layout (no flex gap,not in the accessibility tree, not focusable)
The hidden-state tracking is unified into a single
isHiddenboolean (replacing the previousvisibilitystring state), cleared immediately on expand and set inonAnimationCompleteaftercollapse.
NavigationBar— layout restructurecollapsedStyle="display-none"on the startCollapsible— when nostartis provided theelement has
display: nonefrom the start and contributes no gap.paddingEndrestored on the inner startHStack— spacing between the start content and thetitle now lives inside the Collapsible, so it animates smoothly from
0 → columnGapon expandand back on collapse. The outer
HStackgap is set to0to prevent double spacing.HStack— preservescolumnGapspacing between the titleand end content without relying on the outer
HStack's gap.Story
Adds
NavigationBarStartToggle— a story with a button that toggles thestartslot on and off,demonstrating both the gap fix and the smooth animated transition.
Consumer impact
Collapsible—collapsedStyledefaults to'visibility-hidden', so all existing usagesare unaffected.
NavigationBar— no API changes. Consumers rendering without astartprop will see thephantom gap disappear. Consumers using
startwill see the gap between start content and titleanimate smoothly (previously snapped).
UI changes
new nav bar story
Testing
How has it been tested?
Testing instructions
Illustrations/Icons Checklist
Required if this PR changes files under
packages/illustrations/**orpackages/icons/**Change management
type=routine
risk=low
impact=sev5
automerge=false