Skip to content

Commit 0dc5a58

Browse files
committed
Theme picker for the standalone app.
1 parent c782a24 commit 0dc5a58

3 files changed

Lines changed: 389 additions & 2 deletions

File tree

docs/specs/theme.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,14 @@ The picker is labeled `Theme:` and uses a custom dropdown rather than a native `
144144

145145
The dropdown footer is always `Install theme from OpenVSX`; it opens the runtime installer dialog. The picker is not mounted on non-playground routes.
146146

147+
## Standalone AppBar picker
148+
149+
The standalone Tauri app renders its theme picker in `AppBar`, not in `mouseterm-lib/App` or `Pond`, so the VS Code extension entry point does not mount it. On macOS it sits in the right-side AppBar action group next to the shell dropdown; on Windows/Linux it sits before the native window controls. The AppBar already uses `bg-surface-alt`, `text-foreground`, and related theme tokens, so changing the active theme updates the AppBar chrome as well as Dockview and terminals.
150+
151+
`standalone/src/main.tsx` restores the persisted active theme before reconnecting/restoring Pond. This prevents the first terminal render from briefly using fallback colors. The picker itself also restores and refreshes theme state on mount.
152+
153+
The standalone picker has the same core behavior as the playground picker: it lists bundled and installed themes, persists selection to `mouseterm:active-theme`, applies the theme immediately, shows an `X` for installed themes, confirms deletion, falls back to the first remaining theme if the active installed theme is deleted, and exposes `Install theme from OpenVSX` as the dropdown footer action.
154+
147155
## Runtime OpenVSX installer
148156

149157
Users can browse and install themes from OpenVSX directly in the app.
@@ -196,6 +204,9 @@ user searches OpenVSX
196204
| [`lib/src/lib/terminal-registry.ts`](../../lib/src/lib/terminal-registry.ts) | MutationObserver + `getTerminalTheme()` — no changes needed |
197205
| [`website/src/components/ThemePicker.tsx`](../../website/src/components/ThemePicker.tsx) | Playground-only header dropdown for selecting, installing, and deleting themes |
198206
| [`website/src/components/SiteHeader.tsx`](../../website/src/components/SiteHeader.tsx) | Shared site header; playground enables `themeAware` so header chrome follows the active theme |
207+
| [`standalone/src/StandaloneThemePicker.tsx`](../../standalone/src/StandaloneThemePicker.tsx) | Standalone-only AppBar dropdown and OpenVSX dialog |
208+
| [`standalone/src/AppBar.tsx`](../../standalone/src/AppBar.tsx) | Mounts the standalone theme picker in the Tauri AppBar, outside the VS Code extension path |
209+
| [`standalone/src/main.tsx`](../../standalone/src/main.tsx) | Restores the persisted standalone theme before Pond reconnects |
199210

200211
## Dependencies
201212

standalone/src/AppBar.tsx

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import { useState, useEffect, useRef, useCallback } from 'react';
22
import { getCurrentWindow } from '@tauri-apps/api/window';
33
import { CaretDownIcon, MinusIcon, CornersOutIcon, CornersInIcon, XIcon, TerminalWindowIcon, PlusIcon } from '@phosphor-icons/react';
4+
import { StandaloneThemePicker } from './StandaloneThemePicker';
45

56
export interface ShellEntry {
67
name: string;
@@ -208,11 +209,17 @@ export function AppBar({ projectDir, homeDir, shells }: AppBarProps) {
208209

209210
{/* Shell dropdown on the right (macOS) or window controls (Windows/Linux) */}
210211
{IS_MAC ? (
211-
<div className="pr-2">
212+
<div className="flex items-center gap-1 pr-2">
213+
<StandaloneThemePicker />
212214
<ShellDropdown shells={shells} />
213215
</div>
214216
) : (
215-
<WinControls />
217+
<div className="flex items-stretch self-stretch">
218+
<div className="flex items-center pr-2">
219+
<StandaloneThemePicker />
220+
</div>
221+
<WinControls />
222+
</div>
216223
)}
217224
</div>
218225
);

0 commit comments

Comments
 (0)