fix(docs): prevent theme reset to dark after user switches to auto/light#1078
fix(docs): prevent theme reset to dark after user switches to auto/light#1078lifeiyu071 wants to merge 1 commit intocoleam00:devfrom
Conversation
Starlight removes the `starlight-theme` localStorage key when the user selects "auto" mode. The old init script checked that key, so every navigation or refresh re-forced dark theme. Use a separate `archon-theme-init` sentinel that persists across theme changes. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughUpdated the theme initialization check in the Astro configuration to use Changes
Possibly Related PRs
Poem
Estimated Code Review Effort🎯 1 (Trivial) | ⏱️ ~3 minutes ✨ 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. Comment |
Summary
<head>init script now uses a separatearchon-theme-initlocalStorage sentinel instead of checkingstarlight-themedirectly. Starlight deletesstarlight-themewhen the user selects "auto", which caused the old guard to re-fire and force dark on every loadLabel Snapshot
risk: lowsize: XSdocsdocs:themeChange Metadata
bugdocsValidation Evidence (required)
bun run validate # all pass (type-check, lint, format, tests)Security Impact (required)
NoNoNoNoCompatibility / Migration
YesNoNoHuman Verification (required)
Side Effects / Blast Radius (required)
Rollback Plan (required)
Risks and Mitigations
starlight-themein localStorage but noarchon-theme-initwill see the init script run once more on next visit, setting dark again🤖 Generated with Claude Code
Summary by CodeRabbit