Files
platform/src/workspaces/components/ui/ThemeProvider.tsx
T
pastilhasandClaude Opus 5 4ecd45c4a9 themes get their own control, and the vimazing keys
Fourteen themes was too many to keep under an avatar next to "Sign out" — that is where
a preference goes when nobody has decided it matters. It now has its own button in the
header, between the controls and the avatar, grouped by family.

── The keys, ported from the owner's vimazing ──

  ctrl+shift+l / ctrl+shift+h   cycle forward / back, from anywhere, no UI
  ctrl+alt+space                open the list
  j / k                         move the focus
  l or space                    apply the focused theme to the app BEHIND the list
  h                             back to where you started
  enter                         keep what you are looking at
  escape                        restore and close

The browse is the point, and it is why the overlay is a portal over a 55% backdrop
rather than a modal: you are not reading names, you are watching the application change.
The theme you started on is captured when the list opens, so `h` and `escape` undo a
whole browse however many previews happened inside it.

Typing is still typing: the list ignores j/k/l/h while focus is in an input, textarea,
select or anything contenteditable.

── Where it lives ──

The key handling is in the theme package — it is behaviour that belongs to themes, and
it needs no UI. The list and the button are Officer's, because a dialog would drag a
component library into a package that currently has none.

Verified by driving the real keyboard in a browser:

  start duck-dark · ctrl+shift+l -> plain · ctrl+alt+space -> overlay
  j, l -> tokyo-night (previewed) · escape -> plain, closed

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-08-17 01:15:55 +00:00

17 lines
989 B
TypeScript

/**
* Moved. The implementation now lives in the `theme` workspace.
*
* This file is a re-export so the six existing call sites — `frontend.tsx`, `useThemeSync`, `UserMenu`,
* `MapSection` and two unused toggles — keep working without being edited. That is not laziness: the
* extraction has to be provably invisible, and a diff that also rewrites every consumer makes any visual
* difference impossible to attribute to one change or the other.
*
* `ColorModeProvider` is an alias of `ThemeProvider`. The old provider managed a light/dark mode; the new
* one manages a theme, and light/dark are now two themes. `useColorMode` maps between the two worlds — see
* its note in the package.
*
* New code should import from `theme` directly. This file exists to be deleted once nothing points here.
*/
export { ThemeProvider as ColorModeProvider, ThemeProvider, useTheme, useColorMode, useThemeAsset, useThemeKeys } from 'theme';
export type { Theme, ThemeId } from 'theme';