diff --git a/app/src/components/settings/SettingsPanel.tsx b/app/src/components/settings/SettingsPanel.tsx index bfff841..5bfe422 100644 --- a/app/src/components/settings/SettingsPanel.tsx +++ b/app/src/components/settings/SettingsPanel.tsx @@ -9,6 +9,7 @@ import EnvVarsModal from "../projects/EnvVarsModal"; import { detectHostTimezone } from "../../lib/tauri-commands"; import type { EnvVar } from "../../lib/types"; import Tooltip from "../ui/Tooltip"; +import AccordionSection from "../ui/AccordionSection"; import WebTerminalSettings from "./WebTerminalSettings"; import SttSettings from "./SttSettings"; @@ -61,153 +62,160 @@ export default function SettingsPanel() { }; return ( -
+

Settings

- - - {/* Default SSH Key Directory */} -
- -

- Mounted into all containers unless overridden by a per-project setting. -

- setSshKeyPath(e.target.value)} - onBlur={async () => { - if (appSettings) { - await saveSettings({ ...appSettings, default_ssh_key_path: sshKeyPath || null }); - } - }} - placeholder="~/.ssh" - className="w-full px-2 py-1 text-sm bg-[var(--bg-primary)] border border-[var(--border-color)] rounded focus:outline-none focus:border-[var(--accent)]" - /> -
- - {/* Default Git Name */} -
- - setGitName(e.target.value)} - onBlur={async () => { - if (appSettings) { - await saveSettings({ ...appSettings, default_git_user_name: gitName || null }); - } - }} - placeholder="Your Name" - className="w-full px-2 py-1 text-sm bg-[var(--bg-primary)] border border-[var(--border-color)] rounded focus:outline-none focus:border-[var(--accent)]" - /> -
- - {/* Default Git Email */} -
- - setGitEmail(e.target.value)} - onBlur={async () => { - if (appSettings) { - await saveSettings({ ...appSettings, default_git_user_email: gitEmail || null }); - } - }} - placeholder="you@example.com" - className="w-full px-2 py-1 text-sm bg-[var(--bg-primary)] border border-[var(--border-color)] rounded focus:outline-none focus:border-[var(--accent)]" - /> -
- - {/* Container Timezone */} -
- -

- Timezone for containers — affects scheduled task timing (IANA format, e.g. America/New_York) -

- setTimezone(e.target.value)} - onBlur={async () => { - if (appSettings) { - await saveSettings({ ...appSettings, timezone: timezone || null }); - } - }} - placeholder="UTC" - className="w-full px-2 py-1 text-sm bg-[var(--bg-primary)] border border-[var(--border-color)] rounded focus:outline-none focus:border-[var(--accent)]" - /> -
- - {/* Global Claude Instructions */} -
- -

- Global instructions applied to all projects (written to ~/.claude/CLAUDE.md in containers) -

-
- - {globalInstructions ? "Configured" : "Not set"} - - + + {/* Container Timezone */} +
+ +

+ Timezone for containers — affects scheduled task timing (IANA format, e.g. America/New_York) +

+ setTimezone(e.target.value)} + onBlur={async () => { + if (appSettings) { + await saveSettings({ ...appSettings, timezone: timezone || null }); + } + }} + placeholder="UTC" + className="w-full px-2 py-1 text-sm bg-[var(--bg-primary)] border border-[var(--border-color)] rounded focus:outline-none focus:border-[var(--accent)]" + />
-
- {/* Global Environment Variables */} -
- -

- Applied to all project containers. Per-project variables override global ones with the same key. -

-
- - {globalEnvVars.length > 0 ? `${globalEnvVars.length} variable${globalEnvVars.length === 1 ? "" : "s"}` : "None"} - - + {/* Global Claude Instructions */} +
+ +

+ Global instructions applied to all projects (written to ~/.claude/CLAUDE.md in containers) +

+
+ + {globalInstructions ? "Configured" : "Not set"} + + +
-
- {/* Global Claude Code Settings */} -
- -

- Default Claude Code CLI settings applied to all projects. Per-project settings take precedence. -

-
- - {appSettings?.global_claude_code_settings ? "Configured" : "Using defaults"} - - + {/* Global Environment Variables */} +
+ +

+ Applied to all project containers. Per-project variables override global ones with the same key. +

+
+ + {globalEnvVars.length > 0 ? `${globalEnvVars.length} variable${globalEnvVars.length === 1 ? "" : "s"}` : "None"} + + +
-
- {/* Web Terminal */} - + {/* Global Claude Code Settings */} +
+ +

+ Default Claude Code CLI settings applied to all projects. Per-project settings take precedence. +

+
+ + {appSettings?.global_claude_code_settings ? "Configured" : "Using defaults"} + + +
+
+ - {/* Speech to Text */} - + + + - {/* Updates section */} -
- + + + + + + {/* Default SSH Key Directory */} +
+ +

+ Mounted into all containers unless overridden by a per-project setting. +

+ setSshKeyPath(e.target.value)} + onBlur={async () => { + if (appSettings) { + await saveSettings({ ...appSettings, default_ssh_key_path: sshKeyPath || null }); + } + }} + placeholder="~/.ssh" + className="w-full px-2 py-1 text-sm bg-[var(--bg-primary)] border border-[var(--border-color)] rounded focus:outline-none focus:border-[var(--accent)]" + /> +
+ + {/* Default Git Name */} +
+ + setGitName(e.target.value)} + onBlur={async () => { + if (appSettings) { + await saveSettings({ ...appSettings, default_git_user_name: gitName || null }); + } + }} + placeholder="Your Name" + className="w-full px-2 py-1 text-sm bg-[var(--bg-primary)] border border-[var(--border-color)] rounded focus:outline-none focus:border-[var(--accent)]" + /> +
+ + {/* Default Git Email */} +
+ + setGitEmail(e.target.value)} + onBlur={async () => { + if (appSettings) { + await saveSettings({ ...appSettings, default_git_user_email: gitEmail || null }); + } + }} + placeholder="you@example.com" + className="w-full px-2 py-1 text-sm bg-[var(--bg-primary)] border border-[var(--border-color)] rounded focus:outline-none focus:border-[var(--accent)]" + /> +
+
+ + + + + + +
{appVersion && (

@@ -237,11 +245,11 @@ export default function SettingsPanel() { {imageUpdateInfo && (

- A newer container image is available. Re-pull the image in Docker settings above to update. + A newer container image is available. Re-pull the image in Container settings above to update.
)}
-
+ {showInstructionsModal && ( (() => loadOpenState(key, defaultOpen)); + + useEffect(() => { + persistOpenState(key, open); + }, [key, open]); + + return ( +
+ + {open && ( +
+ {children} +
+ )} +
+ ); +}