feat(quick-261016-0fm): manual theme switch on the rail

- the rail's top button cycles system, light and dark and names the
  current choice; light and dark ignore prefers-color-scheme
- usePreferences applies the cached theme before the first await of boot,
  saves the choice through PUT /account/preferences and reverts with a
  toast when the save fails; me() applies the stored preference
This commit is contained in:
Jakub Zych
2026-10-16 09:54:02 +02:00
parent 047858ae84
commit 21b0d39de0
7 changed files with 181 additions and 17 deletions

View File

@@ -2,9 +2,10 @@
// D-06, D-10). The section panel hides below about 1100px or when the admin
// collapses it. The viewport only forces the collapse and never overwrites
// the admin's own choice, which persists in localStorage as a boolean under
// SIDEBAR_KEY. The only other writer of browser storage is listState.ts,
// which keeps list query parameters per list; tokens and record data are
// never stored (T-10-22, T-16.1-03).
// SIDEBAR_KEY. The other writers of browser storage are listState.ts,
// which keeps list query parameters per list, and usePreferences.ts, which
// caches the theme and locale codes; tokens and record data are never stored
// (T-10-22, T-16.1-03).
import { computed, readonly, ref } from 'vue'
export const SIDEBAR_KEY = 'summer-admin.sidebar'