Repository navigation
fix: Reserve navigation space in app layout skeleton when trigger is hidden - #5155
Merged
amanabiy merged 2 commits intoOct 23, 2026
Merged
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #5155 +/- ##
==========================================
- Coverage 97.72% 93.88% -3.85%
==========================================
Files 995 994 -1
Lines 32129 27830 -4299
Branches 11851 10001 -1850
==========================================
- Hits 31399 26128 -5271
+ Misses 684 609 -75
- Partials 46 1093 +1047 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
amanabiy
approved these changes
Oct 23, 2026
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
The localized fix preserves trigger behavior and includes focused regression coverage, with no unresolved findings.
No open issues 🎉
What changed in this PR
Fixes navigation-related layout shifts while the app layout widget loads by reserving skeleton space when the navigation trigger is hidden or the layout is secondary.
Changes:
- Uses layout navigation props as a fallback for skeleton visibility and open state.
- Preserves toolbar trigger visibility behavior.
- Adds regression tests for hidden-trigger and secondary-layout scenarios.
| File | Description |
|---|---|
src/app-layout/visual-refresh-toolbar/skeleton/skeleton-parts.tsx |
Adds navigation-state fallbacks while preserving toolbar trigger logic. |
src/app-layout/__tests__/skeleton.test.tsx |
Tests navigation space reservation in both reported scenarios. |
Review effort: Balanced
amanabiy
approved these changes
Oct 23, 2026
SpyZzey
requested review from
a team,
georgylobko and
taheramr
and removed request for
a team and
taheramr
October 23, 2026 09:45
georgylobko
approved these changes
Oct 23, 2026
This branch was previously deployed
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.
Description
When the app layout widget loads asynchronously,
BeforeMainSlotSkeletondecides whether to render the navigation column fromtoolbarProps.hasNavigation. That flag means "the toolbar shows a navigation trigger", so the skeleton reserves no navigation space in two cases where the loaded layout does show the navigation:navigationTriggerHideis set (getPropsToMergereportsnavigation: false).toolbarPropsis null and the navigation getspanel-hidden.In both cases, all content shifts right by the navigation width when the widget loads. This has a significant impact on Lighthouse performance scores, which penalize sites for content layout shift (CLS)—and rightly so, since it's jarring for users and forces the browser to recompute the site's layout.
This PR bases the skeleton's navigation column on the layout's own
navigation,navigationHide, andnavigationOpenprops, falling back fromtoolbarProps. The toolbar trigger still usestoolbarProps.hasNavigation.Related links, issue #, if available: V2414734554
How has this been tested?
skeleton.test.tsxcover both cases. They fail without the fix.#/light/app-layout-toolbar/with-content-layout?visualRefresh=true&appLayoutWidget=true&appLayoutDelayedWidget=true&navigationTriggerHide=true(production build, 1350 px wide). The screenshots below show the skeleton, captured while the widget is loading, and the layout after the widget loads.With a
PerformanceObserverforlayout-shifton a similar page, the shift at widget load went from 0.18 to 0 fornavigationTriggerHide, and from 0.19 to 0 for a secondary layout.Review checklist
The following items are to be evaluated by the author(s) and the reviewer(s).
Correctness
CONTRIBUTING.md.CONTRIBUTING.md.Security
checkSafeUrlfunction.Testing
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.