Repository navigation
Conversation
The first paint now needs only the HTML and the stylesheet. index.html holds a logged-out frame (background and logo) and a signed-in frame (sidebar and bottom nav). public/startup-v1.js sets the theme and picks the frame. React removes the frame on its first commit, in the same task, so no blank page shows. On a production build with slow 4G and 4x CPU at 360 px, FCP goes from 4436 ms to 1572 ms. CLS stays at 0.002.
📊 Build Bundle StatsThe latest build generated the following assets: |
|
✅ No security or compliance issues detected. Reviewed everything up to 7d3ab15. Security OverviewDetected Code Changes
|
Contributor
There was a problem hiding this comment.
🟢 Approved
There are no active review issues for the static startup frame change.
No open issues 🎉
What changed in this PR
Adds a static startup frame so the governance app can display its background and navigation before the main JavaScript bundle loads, then hand over to React.
Changes:
- Adds logged-out and signed-in frames with responsive navigation.
- Selects the initial theme and frame from stored preferences and session expiry.
- Removes the static frame when React first adds an element, with tests for the removal behavior.
| File | Description |
|---|---|
src/governance-app-frontend/src/main.tsx |
Registers frame removal before rendering React. |
src/governance-app-frontend/src/common/utils/startupFrame.ts |
Observes the root and removes the static frame on its first element insertion. |
src/governance-app-frontend/src/common/utils/startupFrame.test.ts |
Tests frame retention, removal, and missing-frame handling. |
src/governance-app-frontend/public/startup-v1.js |
Initializes theme, session-based frame selection, and navigation state. |
src/governance-app-frontend/index.html |
Adds startup markup, styles, icons, and the initialization script. |
Review effort: Balanced
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.
Motivation
A visitor sees an empty page until the JavaScript (470 to 560 KB gzip) arrives. Now the first paint needs only the HTML and the stylesheet, so the frame of the app shows about 2.9 s sooner.
Production build, local HTTP/2, slow 4G, 4x CPU, no cache, median of 5 runs at 360 px: FCP 4436 ms to 1572 ms, CLS 0.002 to 0.002. At 1280 px (3 runs): FCP 4424 ms to 1580 ms, CLS 0 to 0. LCP does not change (about 5.9 s), because the hero still needs the JavaScript.
Changes
index.html: background and logo when logged out, sidebar and bottom nav when signed in.public/startup-v1.js, which sets the theme and picks the frame fromnns-theme,ic-session-state, andnns-advanced-features.removeStartupFrameOnFirstCommit, which removes the frame in the same task as the first React commit.Screenshots
Each screenshot shows the page before the JavaScript arrives.