From d5880796bcbc7ccd385b37fae59d819c439de4ce Mon Sep 17 00:00:00 2001 From: Swizzy Date: Sun, 27 Sep 2026 16:14:22 +0200 Subject: [PATCH] menubar: dock preference to keep every ring out at rest (#1560) --- windows/DEVELOPMENT.md | 4 ++++ windows/src/Dock.tsx | 4 +++- windows/src/lib/dockPrefs.ts | 4 ++++ windows/src/settings/GeneralPane.tsx | 11 +++++++++++ 4 files changed, 22 insertions(+), 1 deletion(-) diff --git a/windows/DEVELOPMENT.md b/windows/DEVELOPMENT.md index b18e9de1..1b08508f 100644 --- a/windows/DEVELOPMENT.md +++ b/windows/DEVELOPMENT.md @@ -130,6 +130,10 @@ the user's login. Like `ClaudeCredentialStore.refreshAfter401` on macOS, we re-r own credential file for a token it has already rotated, and report a transient failure when there isn't one yet. +The `keepExpanded` dock preference (Settings > General > Capacity Dock > Keep expanded) makes +the rail read as pinned, so every selected ring stays out at rest and the hover-out collapse +never runs. + ## Build a production package ```bash diff --git a/windows/src/Dock.tsx b/windows/src/Dock.tsx index 7bdc8e93..7d3a8d77 100644 --- a/windows/src/Dock.tsx +++ b/windows/src/Dock.tsx @@ -699,7 +699,9 @@ export function Dock() { orderedRef.current = ordered const loading = quota.fetchedAt === null && quota.error === null - const expanded = isExpanded(interaction) + // With the preference on the rail never rests on one ring: it reads as pinned, so every + // selected row stays out and the hover-out collapse has nothing to do. + const expanded = prefs.keepExpanded || isExpanded(interaction) useEffect(() => { if (expanded) setPresentationExpanded(true) }, [expanded]) diff --git a/windows/src/lib/dockPrefs.ts b/windows/src/lib/dockPrefs.ts index aed5cf0e..54b578b1 100644 --- a/windows/src/lib/dockPrefs.ts +++ b/windows/src/lib/dockPrefs.ts @@ -43,6 +43,8 @@ export type DockPrefs = { providers: string[] /// Latches once the user edits the provider set, so auto-seeding stops second-guessing them. manualSelection: boolean + /// Keeps every selected ring out at rest instead of collapsing to the resting provider. + keepExpanded: boolean } export const DEFAULT_DOCK_PREFS: DockPrefs = { @@ -53,6 +55,7 @@ export const DEFAULT_DOCK_PREFS: DockPrefs = { gaugeShape: 'circle', providers: [], manualSelection: false, + keepExpanded: false, } export function parseDockPrefs(raw: Record): DockPrefs { @@ -65,6 +68,7 @@ export function parseDockPrefs(raw: Record): DockPrefs { gaugeShape: raw.gaugeShape === 'squircle' ? 'squircle' : 'circle', providers: Array.isArray(raw.providers) ? raw.providers.filter((p): p is string => typeof p === 'string') : [], manualSelection: raw.manualSelection === true, + keepExpanded: raw.keepExpanded === true, } } diff --git a/windows/src/settings/GeneralPane.tsx b/windows/src/settings/GeneralPane.tsx index 843700e6..55296f9e 100644 --- a/windows/src/settings/GeneralPane.tsx +++ b/windows/src/settings/GeneralPane.tsx @@ -367,6 +367,17 @@ function CapacityDockSection({ quota }: { quota: QuotaState }) { } /> )} + apply({ keepExpanded: !prefs.keepExpanded })} + /> + } + />