Skip to content

fix: remove stale Astro build cache and broken TV intro CSS suppression#57

Merged
jaypatrick merged 2 commits intomainfrom
copilot/fix-regressions-remove-astro-cache
May 7, 2026
Merged

fix: remove stale Astro build cache and broken TV intro CSS suppression#57
jaypatrick merged 2 commits intomainfrom
copilot/fix-regressions-remove-astro-cache

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented May 7, 2026

Two regressions from the previous PR: stale .astro/ cache causing old CSS/JS to survive deploys, and a visibility: hidden rule that was swallowing the TV intro because Astro wraps client:load components in <astro-island> — a direct <body> child without .tv-intro-overlay.

.github/workflows/deploy.yml

  • Removed the Cache Astro build step entirely. The restore-keys fallback was restoring stale incremental build output across content-only changes, defeating CSS/JS updates.

src/styles/global.css

Removed two CSS blocks that are no longer needed:

/* Both blocks deleted */
html[data-phosphor-intro="active"] body { background: #000 !important; ... }
html[data-phosphor-intro="active"] .grid-overlay { background-image: none !important; }

html.tv-intro-active, html.tv-intro-active body { overflow: hidden; background: #000; }
html.tv-intro-active body > *:not(.tv-intro-overlay):not(.crt-power-line) { visibility: hidden; }

The not(.tv-intro-overlay) selector matched <astro-island>, hiding the overlay it was meant to protect. The overlay's own position: fixed; inset: 0; z-index: 9999; background: #000 already covers the viewport — no external suppression needed.

src/layouts/BaseLayout.astro

  • Removed the <script is:inline> that was setting data-phosphor-intro="active" and tv-intro-active on <html> — now dead code with the CSS rules gone.
Original prompt

Fix two regressions introduced by the previous PR and remove the broken Astro build cache.

Fix 1: Remove the Astro build cache step from .github/workflows/deploy.yml

Delete the entire "Cache Astro build" step from the build job. It has been causing stale CSS and JS to be deployed. Clean builds are required.

Remove this block entirely:

      # Caches Astro's incremental build output (.astro/) to skip recompiling
      # unchanged pages and components on repeat runs.
      - name: Cache Astro build
        uses: actions/cache@v4
        with:
          path: .astro/
          key: astro-${{ runner.os }}-node${{ env.NODE_VERSION }}-${{ hashFiles('src/**', 'astro.config.*', 'tsconfig.json', 'package-lock.json') }}

Fix 2: Restore the TV intro in src/styles/global.css

The visibility: hidden rule introduced in the last PR breaks the TV intro because Astro wraps client:load Svelte components in an <astro-island> element. The selector body > *:not(.tv-intro-overlay) hides astro-island (which is a direct body child without that class), taking the entire TV intro overlay with it.

Remove these two CSS blocks entirely from global.css:

/* Phosphor — suppress site flash before TV intro overlay mounts */
html.tv-intro-active,
html.tv-intro-active body {
  overflow: hidden;
  background: #000;
}

html.tv-intro-active body > *:not(.tv-intro-overlay):not(.crt-power-line) {
  visibility: hidden;
}

Fix 3: Remove the tv-intro-active inline script from src/layouts/BaseLayout.astro

The inline script that adds tv-intro-active to <html> is no longer needed (since we're removing the CSS rules that used it). Remove this block from BaseLayout.astro:

{shouldRenderTvIntro && <script is:inline>
  (function() {
    try {
      var seen = sessionStorage.getItem('tv-intro-seen');
      var rm = window.matchMedia('(prefers-reduced-motion: reduce)').matches;
      if (!seen && !rm) { document.documentElement.classList.add('tv-intro-active'); }
    } catch(e) {}
  })();
</script>}

The {shouldRenderTvIntro && <TVIntro client:load />} line should remain untouched.

Fix 4: Also remove the existing data-phosphor-intro CSS block from global.css if it exists

Remove this block too since it was also part of the same broken approach:

/* Phosphor — hide page content during TV intro to prevent grid flash */
html[data-phosphor-intro="active"] body {
  background: #000 !important;
  background-image: none !important;
}

html[data-phosphor-intro="active"] .grid-overlay {
  background-image: none !important;
}

The TV intro overlay itself (.tv-intro-overlay) is position: fixed; inset: 0; z-index: 9999; background: #000 — it already covers the entire viewport on its own. No additional CSS suppression is needed.

The following is the prior conversation context from the user's chat exploration (may be truncated):

Assistant: ````list type="task"
data:
- title: 'fix: portfolio bracket tags, remove all emoji, eliminate duplicate THIS. IS. JK.com during intro'
repository: jaypatrick/jk.com
url: https://github.com/copilot/tasks/pull/PR_kwDOSHNyYs7ZMVuN?session_id=c322f5e5-ae9e-45b3-979f-ebd23322f99d
state: queued


Three clean fixes, all surgical. Here's the "why" on each:

**Portfolio bracket tags** — the existing tag spans were raw inline-styled elements, inconsistent with the `[ tag ]` treatment in the hero. The new `.portfolio-tag` class mirrors the hero's bracket style exactly — same `border-radius: 3px`, same cyan-dim base color, same bracket opacity trick — but sized slightly tighter to fit card density.

**Emoji removal** — gone across the board. `📅`, `📞`, `📍`, `✅` all replaced with mono text labels (`TEL`, `LOC`, `CAL`) that match the terminal readout language established by the status bar and form fields. The success state checkmark div gets dropped entirely — the `TRANSMISSION_RECEIVED` heading already communicates success without a decorative emoji. The whole site will read as intentional craft rather than default template output.

**Duplicate heading** — the root cause is that `TVIntro.svelte` was rendering its own `THIS. IS. JK.com` inside the overlay during `phase === 'emerge'`, while `Hero.svelte` underneath was *also* rendering it (fading in as `mounted` activated). With the intro text block living in both places and the overlay fading out over 450ms, you'd see both simultaneously during the crossfade. The fix is simple: the intro overlay's only job is line → static → clear. The heading belongs exclusively to `Hero.svelte`. Delete the duplicate from `TVIntro`, and there's exactly one "THIS. IS. JK.com" in the world — the one in the hero, appearing cleanly as the static lifts.

User: The OG metadata doesn't appear to have updated, even with caching purged and then cloudflare put in development mode. Using the FB scraper site, it's still showing the old OG.

Assistant: Looking at the screenshot carefully, I can spot ...

</details>



<!-- START COPILOT CODING AGENT SUFFIX -->

*This pull request was created from Copilot chat.*
>

@jaypatrick jaypatrick added the bug Something isn't working label May 7, 2026
@jaypatrick jaypatrick added this to the launch milestone May 7, 2026
…, remove obsolete inline script

Agent-Logs-Url: https://github.com/jaypatrick/jk.com/sessions/0ae071e3-9ce2-48a1-be2d-d30986c1a512

Co-authored-by: jaypatrick <1800595+jaypatrick@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix regressions and remove Astro build cache fix: remove stale Astro build cache and broken TV intro CSS suppression May 7, 2026
Copilot AI requested a review from jaypatrick May 7, 2026 17:03
@jaypatrick jaypatrick marked this pull request as ready for review May 7, 2026 17:12
Copilot AI review requested due to automatic review settings May 7, 2026 17:12
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Fixes two regressions affecting production deploy freshness and the homepage TV intro overlay by removing stale build caching and eliminating CSS/JS that incorrectly hid the intro due to Astro’s <astro-island> wrapper behavior.

Changes:

  • Removed the GitHub Actions cache step that persisted Astro’s .astro/ incremental build output across runs, which could serve stale CSS/JS.
  • Deleted TV-intro “content suppression” CSS that unintentionally hid the overlay when rendered inside <astro-island>.
  • Removed now-dead inline scripting in BaseLayout.astro that set data-phosphor-intro / tv-intro-active on <html>.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.

File Description
.github/workflows/deploy.yml Removes caching of .astro/ to prevent stale incremental outputs from affecting deploy artifacts.
src/styles/global.css Deletes intro-related suppression rules that were breaking the overlay due to selector mismatch with Astro islands.
src/layouts/BaseLayout.astro Removes the inline script that toggled intro suppression flags on <html>, now unused after CSS removal.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@jaypatrick jaypatrick merged commit f46a36d into main May 7, 2026
8 checks passed
@jaypatrick jaypatrick deleted the copilot/fix-regressions-remove-astro-cache branch May 7, 2026 17:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants