From 1a6981cfc3fe8a79f443872148072d6680f62bce Mon Sep 17 00:00:00 2001 From: iamtoruk Date: Tue, 1 Sep 2026 17:28:29 -0700 Subject: [PATCH] feat(windows): open the settings panel on the section the tray asked for About CodeBurn in the tray menu now lands on the About group rather than the top of the panel, and Capacity Dock Settings lands in General, as it does on the mac until the dock has a pane of its own. The panel takes the section it should show rather than guessing from what opened it. --- windows/src/components/SettingsPanel.tsx | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/windows/src/components/SettingsPanel.tsx b/windows/src/components/SettingsPanel.tsx index 5e9e3fae..f528d08b 100644 --- a/windows/src/components/SettingsPanel.tsx +++ b/windows/src/components/SettingsPanel.tsx @@ -1,4 +1,4 @@ -import { useEffect, useState, type ReactNode } from 'react' +import { useEffect, useRef, useState, type ReactNode } from 'react' import { invoke } from '@tauri-apps/api/core' import { openUrl } from '@tauri-apps/plugin-opener' import type { CurrencyState } from '../lib/currency' @@ -14,9 +14,14 @@ import { ChevronDown, ChevronRight } from './Icons' export type ThemeChoice = 'system' | 'light' | 'dark' +/// Where an entry point wants the panel opened. The tray's Capacity Dock Settings lands in +/// General, as it does on the mac, until package C gives the dock a pane of its own. +export type SettingsSection = 'general' | 'about' + const GITHUB_URL = 'https://github.com/getagentseal/codeburn' type Props = { + section: SettingsSection onBack: () => void version: string currency: CurrencyState @@ -32,11 +37,12 @@ type Props = { } export function SettingsPanel({ - onBack, version, currency, onCurrency, themeChoice, onThemeChoice, trayBadge, onTrayBadge, + section, onBack, version, currency, onCurrency, themeChoice, onThemeChoice, trayBadge, onTrayBadge, cliStatus, onCheckCli, cliChecking, onQuit, }: Props) { const [loginItem, setLoginItem] = useState(null) const [loginError, setLoginError] = useState(null) + const about = useRef(null) // No CLI probe here: App owns the gate and probes it on mount, so the panel only ever // displays what that probe found. Its own probe could otherwise fail transiently and drop @@ -45,6 +51,10 @@ export function SettingsPanel({ invoke('launch_at_login').then(setLoginItem).catch(() => setLoginItem(false)) }, []) + useEffect(() => { + if (section === 'about') about.current?.scrollIntoView({ block: 'start' }) + }, [section]) + const toggleLogin = async () => { if (loginItem === null) return setLoginError(null) @@ -117,7 +127,7 @@ export function SettingsPanel({ -
+
About