Repository navigation
Conversation
The new tab used to stay blank until the app bundle loaded and Vue rendered every card (~65-70 ms with warm data). Now: - the rendered page is saved to localStorage (src/snapshot.js) and painted by a small blocking script (public/snapshot.js) before the bundle loads; Vue replaces it on mount in the same task, so the swap is invisible. Cards show in ~17 ms. The clock in the snapshot is refreshed to the current time. - public/theme.js runs first in <head> and sets the page background to the theme color, so a dark-mode tab no longer flashes white. App.vue keeps it in step with the day/night toggle. - Font Awesome styles are bundled into the CSS instead of injected by JS, so icons in the snapshot never render unstyled at full size. - rows in cards use content-visibility: auto to skip layout off screen. Both scripts are files, not inline, because extension pages forbid inline scripts.
This branch has not been 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.
What
Opening a new tab now shows the cards almost immediately, with no white flash in dark mode.
Measured on the production build with cached data (median of 10 loads):
How
localStorage(src/snapshot.js, about 80 KB). On the next tab,public/snapshot.js, a small blocking script right after#app, paints it before the bundle loads and refreshes the clock. Vue clears the container on mount and renders the live page in the same task, so the swap is not visible. I compared the snapshot-only page with the mounted page: all elements have the same positions and sizes, and the text is identical. With no snapshot (first run), everything works as before.public/theme.jsruns first in<head>and sets the page background to the theme color: saved setting, then system preference.App.vuekeeps it in step with the day/night toggle.autoAddCss = false) instead of injected by JS. Otherwise the icons in the snapshot rendered unstyled at full size for a frame.content-visibility: autoon card rows, so off-screen rows skip layout.Both scripts are separate files, not inline, because extension pages (MV3 CSP) do not allow inline scripts.
Notes
tests/unit/*andvitest.config.jswere there before this change.