fix: stale Astro cache deploys old CSS; TV intro overlay flash#55
Conversation
Agent-Logs-Url: https://github.com/jaypatrick/jk.com/sessions/b5644dae-50d4-4993-a920-43138aea8316 Co-authored-by: jaypatrick <1800595+jaypatrick@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
This PR addresses two production issues in JK.com: preventing stale CSS from being deployed due to partial Astro cache restores in GitHub Actions, and reducing/avoiding a brief “TV intro” flash where page chrome becomes visible before the intro overlay takes effect.
Changes:
- Updates the deploy workflow to only restore the Astro build cache on exact key matches (no restore-key fallbacks).
- Adds a synchronous inline script + CSS gating to apply an early
tv-intro-activestate while the TV intro should run. - Ensures
TVIntroclears thetv-intro-activestate both on normal completion and on the immediate-skip path.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 5 comments.
| File | Description |
|---|---|
.github/workflows/deploy.yml |
Removes restore-keys to avoid restoring stale .astro/ output from partial cache hits. |
src/layouts/BaseLayout.astro |
Adds an inline script (body) to stamp html.tv-intro-active before the TVIntro island hydrates. |
src/styles/global.css |
Adds tv-intro-active CSS to force black background + scroll lock during the intro gate. |
src/components/TVIntro.svelte |
Removes the tv-intro-active class in both completion and skip/finalize paths. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
@copilot apply changes based on the comments in this thread |
Agent-Logs-Url: https://github.com/jaypatrick/jk.com/sessions/2419212a-52ee-4d94-8351-54a140b93770 Co-authored-by: jaypatrick <1800595+jaypatrick@users.noreply.github.com>
Applied all five review comments in commit
|
Two independent production bugs: partial Astro cache hits could restore stale compiled CSS, and site chrome was visible for ~50ms before the TV intro black overlay hydrated.
Cache (
.github/workflows/deploy.yml)Drop
restore-keysfrom the Astro cache step. A partial key match onastro-Linux-node24-*was restoring old.astro/output, causing stale CSS to ship. Now only an exact hash match restores — anything else builds clean.TV intro flash (
BaseLayout.astro,global.css,TVIntro.svelte)The ~50ms gap existed because Svelte hydration is async; the black overlay didn't exist in the DOM yet when the browser first painted.
Fix: run a synchronous inline script in
<body>— before<TVIntro client:load />— that stampshtml.tv-intro-activeduring HTML parse if the intro should play:Paired CSS holds the viewport black and scroll-locked until the overlay is ready:
TVIntro.svelteremoves the class in bothnotifyDone(normal completion) andfinalizeImmediately(reduced-motion / already-seen skip path).Original prompt
Fix two issues: stale build cache causing old CSS to deploy, and TV intro flash.
FIX 1:
.github/workflows/deploy.yml— remove the restore-keys fallback from the Astro cache step. Change:To:
FIX 2: TV intro flash — site chrome is visible for ~50ms before the black overlay mounts.
In
src/layouts/BaseLayout.astro, replace the line{shouldRenderTvIntro && <TVIntro client:load />}with:In
src/styles/global.css, add after the existing root/body variable block:In
src/components/TVIntro.svelte, update thenotifyDonefunction to remove the class:And update
finalizeImmediatelyto also remove the class:The following is the prior conversation context from the user's chat exploration (may be truncated):
User: @copilot Accepted Confirmation: Confirm agent session
Assistant: ````list type="task"
data:
- title: 'fix: status text legibility, grid flash before intro, Calendly modal with CRT power-on effect'
repository: jaypatrick/jk.com
url: https://github.com/copilot/tasks/pull/PR_kwDOSHNyYs7ZARvz?session_id=16822cd6-b9d6-444b-8196-4a1b8ba52d36
state: queued