fix(core): wire the computed theme into Vuetify so auto dark-mode works - #4466
Conversation
coreStore.theme (computed via syncOsTheme()/init() from config
vuetify.theme.dark, including 'auto' + a real matchMedia listener in
main.js) was never read back into Vuetify. app.vue's themeName computed
just echoed Vuetify's own useTheme().name into <v-app :theme>, a
self-referential no-op, so automatic dark-mode never actually switched
the rendered theme.
app.vue now watches coreStore.theme ({ immediate: true }) and assigns
useTheme().global.name.value directly, dropping the dead themeName
echo and the now-redundant :theme prop on <v-app> (provideTheme already
falls back to the injected global theme's live name). vuetify.js seeds
defaultTheme from isDark(config.vuetify.theme.dark) so the initial
paint (before the watch fires) also honors the OS/config preference
instead of defaulting to light.
Closes #4462
Claude-Session: https://claude.ai/code/session_01WfNC8bt1TgL4AsiYgCEGup
…gnment Vuetify 4.1.5's Proxy set trap deprecates direct `.value =` assignment on `theme.global.name` in favor of `theme.change()` — same synchronous effect, sanctioned API, adds theme-name validation, no console noise. Test mock updated to mirror change()'s effect on global.name.value so existing state-based assertions still hold.
|
Warning Review limit reached
Next review available in: 46 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Run ID: 📒 Files selected for processing (3)
✨ 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 |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #4466 +/- ##
=======================================
Coverage 99.57% 99.57%
=======================================
Files 35 35
Lines 1398 1398
Branches 439 439
=======================================
Hits 1392 1392
Misses 6 6 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
# [2.3.0](v2.2.0...v2.3.0) (2026-08-01) ### Bug Fixes * **auth,organizations:** guard soft-refresh navigation and the signout race ([#4464](#4464)) ([6a2546e](6a2546e)), closes [#4451](#4451) [#4459](#4459) * **auth,organizations:** soft-refresh (token) at onboarding sites to prevent silent sign-out ([#4431](#4431)) ([5d88766](5d88766)) * **auth,organizations:** surface failures in org-create and email-verification flows ([#4451](#4451)) ([b161df5](b161df5)), closes [#4431](#4431) [#4447](#4447) * **auth:** surface requestJoin failures in the org-setup alert ([#4389](#4389)) ([#4397](#4397)) ([f92003d](f92003d)) * **auth:** token() soft-refresh also carries pendingRequests ([#4436](#4436)) ([0b40e8c](0b40e8c)) * **billing:** config-source the upgrade-prompt pricing copy ([#4465](#4465)) ([9cb370d](9cb370d)), closes [#4460](#4460) * **billing:** meter-mode upgrade prompt copy + single-entry route ([#4410](#4410)) ([df396cf](df396cf)), closes [pricing#units](https://github.com/pricing/issues/units) [pricing#units](https://github.com/pricing/issues/units) * **billing:** migrate default packs to the V4 pricing-card schema ([#4463](#4463)) ([84789b8](84789b8)), closes [pricing#units](https://github.com/pricing/issues/units) [#4458](#4458) * **core,organizations:** config-gate org-required header + unify first-org redirect ([#4423](#4423)) ([7adb298](7adb298)), closes [#4421](#4421) [#4422](#4422) * **core:** wire the computed theme into Vuetify so auto dark-mode works ([#4466](#4466)) ([ed35252](ed35252)), closes [#4462](#4462) * **prerender:** strip local server origin from captured HTML + fail-hard leak assert ([#4502](#4502)) ([#4503](#4503)) ([dbcf8d7](dbcf8d7)) * **skills:** flip PR to ready before waiting on CodeRabbit to avoid a draft deadlock ([#4473](#4473)) ([a733998](a733998)), closes [#4450](#4450) ### Features * **billing:** pricing feature rows wrap + explicit ✗ not-included marker ([#4390](#4390)) ([4bc2515](4bc2515)) * **invitations:** show invite form when user-facing invitations enabled with open signup ([#4501](#4501)) ([daa6688](daa6688)), closes [#4500](#4500) * **skills:** /feature non-interactive invocation — structured SKIP/STOP instead of prompts ([#4455](#4455)) ([197c5f3](197c5f3)), closes [#N](https://github.com/pierreb-devkit/Vue/issues/N) [#failure](https://github.com/pierreb-devkit/Vue/issues/failure) [#4454](#4454) * **ui:** config-overridable loader, plan-badge set, and copy strings ([#4475](#4475)) ([688911a](688911a)), closes [#4474](#4474)
Summary
app.vuenow drives Vuetify's theme by callingtheme.change(coreStore.theme)inside an{ immediate: true }watch, replacing the old self-referentialthemeNamecomputed that echoed Vuetify's ownuseTheme().nameback into<v-app :theme>(a no-op).vuetify.jsnow seedsdefaultThemefrom the resolved config/OS preference so there's no light-theme flash before the watch fires on mount. The redundant:theme="themeName"prop is dropped from<v-app>.config.vuetify.theme.dark: 'auto'was dead-wired.core.store.js'ssyncOsTheme()correctly computedcoreStore.themefromisDark(config.vuetify.theme.dark)andmain.jswired a realmatchMedialistener to keep it live — but nothing readcoreStore.themeback into Vuetify. The app stayed light regardless of config or OS setting.Scope
app(app.vue),lib/plugins(vuetify.js)nonelowValidation
npm run lintnpm run test:unitnpm run buildTests note —
app.vue.unit.tests.jsadds a "theme wiring (#4462)" suite using the real (un-mocked) PiniacoreStoresocoreStore.themeis genuinely reactive; assertions are state-based (wrapper.vm.theme.global.name.value) rather than mechanism-based, covering initial mount (immediate) and post-mount flips. Also updated the theme watch to calltheme.change(v)instead of assigningtheme.global.name.valuedirectly — Vuetify 4.1.5's Proxy set trap deprecates the latter in favor oftheme.change()(same synchronous effect, adds theme-name validation, no console noise); the test mock'schange()mirrors the real API's effect onglobal.name.valueso the existing state-based assertions still hold. Full suite: 2494 tests green, build green.Guardrails check
.env*,secrets/**, keys, tokens)Notes for reviewers
https://claude.ai/code/session_01WfNC8bt1TgL4AsiYgCEGup