diff --git a/.gitignore b/.gitignore index edcc957..120790e 100644 --- a/.gitignore +++ b/.gitignore @@ -36,3 +36,4 @@ src/utils/.env # AGENTS.md symlink AGENTS.md +GEMINI.md diff --git a/dev/continuity.md b/dev/continuity.md index ef73fe5..151d3a6 100644 --- a/dev/continuity.md +++ b/dev/continuity.md @@ -113,3 +113,24 @@ export async function updateClasses( --- +## 2026-01-02 - Client Router Implementation + +### Changes Made +- Updated `src/layouts/BaseLayout.astro` to use `` from `astro:transitions`. +- Modified theme initialization script to handle `astro:after-swap` events for persistent theming during navigation. +- Removed legacy "Intent-Based Prefetch" script as it is superseded by Astro's built-in router capabilities. + +### Decisions +- Adopted Astro's `ClientRouter` to provide a smoother, SPA-like user experience with view transitions. +- Consolidated theme logic into a function `applyTheme()` that runs on both initial load and after view transitions to prevent theme flickering or resetting. + +### How to Test +1. Open the site in a browser. +2. Toggle the theme to a non-default state (e.g., Light mode if default is Dark). +3. Click a navigation link (e.g., "Blog"). +4. Verify the new page loads without a full refresh (no white flash). +5. Verify the selected theme persists on the new page. + +### Next Steps +- [ ] Monitor for any script re-execution issues common with View Transitions. +- [ ] Consider adding custom transition animations for specific elements if needed. \ No newline at end of file diff --git a/src/layouts/BaseLayout.astro b/src/layouts/BaseLayout.astro index 4045a29..e5dce95 100644 --- a/src/layouts/BaseLayout.astro +++ b/src/layouts/BaseLayout.astro @@ -1,5 +1,6 @@ --- import type { ImageMetadata } from 'astro'; +import { ClientRouter } from 'astro:transitions'; import BaseHead from '../components/BaseHead.astro'; import Footer from '../components/Footer.astro'; import GridOverlay from '../components/GridOverlay.astro'; @@ -67,9 +68,10 @@ const personSchema = { + - -