fix(docs): prevent theme reset to dark after user switches to auto/light#1079
fix(docs): prevent theme reset to dark after user switches to auto/light#1079Wirasm merged 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>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughThe theme-initialization script in Changes
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~2 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ 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 |
|
This PR looks similar to #1078, which was closed on April 11, 2026. You may want to read the discussion there before pushing further. |
|
@Wirasm Because I accidentally submitted the same issue twice, and the functions to be fixed were actually the same, I closed one of them. |
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