Repository navigation
perf(navigator): SSR the chrome to kill the mount flash on /tutorial-navigator - #1974
Merged
Merged
Conversation
…unt shift The /tutorial-navigator page SSR'd only the 24-card grid; TutorialNavigator.vue rendered the full chrome (hero + search + open filter panel + toolbar) ABOVE it on mount, shoving the first card down 672px (desktop) / 1434px (mobile) — the visible flash Tom reported. #1850 (sync mount) and #1688 (UI5 cloak) never covered this; the SSR preview only mirrored the grid, not the chrome. Fix (option 1a): SSR the same chrome in list.html (mirroring the Vue markup + class names) so the grid sits at its final offset from first paint. The chrome's layout CSS lived in the component's <style scoped> block (injected only when the island JS runs, after first paint), so it is relocated to the render-blocking @navigator-chrome region in home.css — loaded on this page and kept loaded post-mount, so the mounted Vue tree (same classes) lands identically. Empty SSR Topic/Product lists reserve the runtime lists' capped height via min-height. Verified on a local Hugo build: SSR first-card top now 792px (desktop) / 1554px (mobile), matching the DEV mounted offsets exactly (was 120px both). Adds a post-deploy e2e (navigator-no-mount-shift) asserting SSR==mounted first-card top at both widths; it fails on DEV today (delta 672/1434 vs 8px tolerance). Note: scoped chrome rules kept as a byte-identical duplicate for now (mounted render unchanged, zero risk); removing them is a mechanical cleanup to land with a mounted DEV check.
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
On
/tutorial-navigator, only the 24-card grid was server-rendered.TutorialNavigator.vuerenders the full chrome — hero + search + open filter panel + toolbar — above the grid on mount, shoving the first card down 672px (desktop) / 1434px (mobile). That jump is the flash Tom reported.#1850(synchronous mount) and#1688(UI5 chrome cloak) are both live and don't cover this — the SSR preview only mirrored the grid, never the chrome. Verified on DEV: SSR first-card top 120px → mounted 792px (desktop) / 1554px (mobile).Fix (option 1a)
list.htmlSSRs the same chrome (mirroring the Vue markup + class names) so the grid sits at its final offset from first paint. Toolbar counts computed frombrowse.json(real totals for crawlers); Topic/Product facet lists render empty (populated at runtime from/build/navigator), Experience/Type are static real values.<style scoped>block (injected only when the island JS runs, after first paint), so it's added to a render-blocking@navigator-chromeregion inhome.css— loaded on this page and kept loaded post-mount, so the mounted Vue tree (same classes) lands identically. Prefixed under.tutorial-navigatorso nothing leaks onto the homepage (which also loadshome.css). Empty SSR facet lists reserve the runtime lists' capped height viamin-height.Verification
test/e2e/navigator-no-mount-shift.test.jsfails on DEV today — SSR-vs-mounted first-card delta 672px/1434px (tolerance 8px).Caveats / follow-ups (why draft)
TutorialNavigator.vuerather than deleted. Removing it (the true "relocate", single source of truth) changes the mounted view's CSS source, which can't be verified without a mounted build — should land together with the mounted DEV check. As-is, mounted rendering is unchanged (zero risk).🤖 Generated with Claude Code