fix(docs): theme flash + client-side navigation#216
Conversation
Move theme bootstrap before render-blocking font stylesheet; add critical body background rules; normalize stored theme; reapply on DOMContentLoaded and bfcache pageshow. Co-authored-by: Cursor <cursoragent@cursor.com>
Use ClientRouter for in-site link clicks instead of full document reloads. Reapply theme after view transitions swap root attributes; rebind navbar handlers on astro:page-load; delegate search modal to document listeners; reinit tabs and homepage install block on page-load. Co-authored-by: Cursor <cursoragent@cursor.com>
|
Closing per author request. |
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (5)
WalkthroughMultiple Astro components are refactored to prevent duplicate event listeners across client navigations by adopting persistent, guarded initialization patterns. The Navbar uses an AbortController to rebind listeners, SearchModal switches to one-time document-level handlers with a guard flag, Tabs and InstallSection are wired to ChangesComponent Event Listener Lifecycle Management
Theme & Routing Infrastructure
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related PRs
Poem
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Review rate limit: 0/1 reviews remaining, refill in 60 minutes.Comment |
Summary
bodybackground rules, normalizelocalStoragetheme values, reapply onDOMContentLoaded/ bfcachepageshow, and onastro:after-swapso dark mode stays consistent during view transitions.ClientRouterso in-site doc links use client-side navigations instead of a full document reload. Rebind navbar listeners onastro:page-load, use document-level delegation for the search modal, and reinit tabs / homepage install section after navigations.Test plan
npm run dev— dark mode, click many doc sidebar links — no light flash, no full reload feelMade with Cursor
Summary by CodeRabbit
Release Notes
Bug Fixes
New Features