fix: improve LCP by SSR-ing welcome screen and preloading hero images#210
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR aims to improve LCP for first-time visitors by server-rendering the welcome screen based on a cookie, and by preloading/prioritizing hero SVGs so critical imagery is available earlier in the render path.
Changes:
- SSR-gate the welcome screen via
+layout.server.tsand unmount it via aclosecallback from+layout.svelte. - Migrate “welcome seen” state from
localStorageto a cookie (with a localStorage fallback for migration) and update checks accordingly. - Add
<link rel="preload">andfetchpriority="high"to key SVG assets on the home page and welcome screen.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
src/routes/WelcomeScreen.svelte |
Converts welcome rendering to be parent-controlled (SSR-visible), adds preload + fetchpriority, and introduces a close() prop for unmounting. |
src/routes/+page.svelte |
Preloads and prioritizes the home page hero SVGs for faster first paint/LCP. |
src/routes/+layout.svelte |
Conditionally mounts/unmounts WelcomeScreen based on SSR-provided data.showWelcome. |
src/routes/+layout.server.ts |
Reads the welcome cookie to decide whether the welcome screen should be SSR-rendered. |
src/lib/tour/onboarding-state.ts |
Switches welcome state to cookies (with migration fallback) and updates hasSeenWelcome()/markWelcomed(). |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
LucHeart
previously approved these changes
Jun 11, 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.
+layout.server.tsclosecallback once dismissed<link rel="preload">andfetchpriority="high"to hero SVGs on the home page and welcome screenhasSeenWelcome()to check cookies so the deferred tour prompt still works for new users