From 2afb5ced902666d252d549dabdd4388291e12da9 Mon Sep 17 00:00:00 2001 From: Kacper Date: Wed, 10 Dec 2025 19:07:13 +0100 Subject: [PATCH] feat(cli-refresh): add refresh buttons for CLI detection in settings view --- app/src/components/views/settings-view.tsx | 85 +++++++++++++++++++--- 1 file changed, 75 insertions(+), 10 deletions(-) diff --git a/app/src/components/views/settings-view.tsx b/app/src/components/views/settings-view.tsx index f3fe7581..57f2c839 100644 --- a/app/src/components/views/settings-view.tsx +++ b/app/src/components/views/settings-view.tsx @@ -38,6 +38,7 @@ import { GitBranch, TestTube, Settings2, + RefreshCw, } from "lucide-react"; import { getElectronAPI } from "@/lib/electron"; import { Checkbox } from "@/components/ui/checkbox"; @@ -134,6 +135,8 @@ export function SettingsView() { } | null>(null); const [activeSection, setActiveSection] = useState("api-keys"); const [showDeleteDialog, setShowDeleteDialog] = useState(false); + const [isCheckingClaudeCli, setIsCheckingClaudeCli] = useState(false); + const [isCheckingCodexCli, setIsCheckingCodexCli] = useState(false); const scrollContainerRef = useRef(null); useEffect(() => { @@ -339,6 +342,36 @@ export function SettingsView() { } }; + const handleRefreshClaudeCli = useCallback(async () => { + setIsCheckingClaudeCli(true); + try { + const api = getElectronAPI(); + if (api?.checkClaudeCli) { + const status = await api.checkClaudeCli(); + setClaudeCliStatus(status); + } + } catch (error) { + console.error("Failed to refresh Claude CLI status:", error); + } finally { + setIsCheckingClaudeCli(false); + } + }, []); + + const handleRefreshCodexCli = useCallback(async () => { + setIsCheckingCodexCli(true); + try { + const api = getElectronAPI(); + if (api?.checkCodexCli) { + const status = await api.checkCodexCli(); + setCodexCliStatus(status); + } + } catch (error) { + console.error("Failed to refresh Codex CLI status:", error); + } finally { + setIsCheckingCodexCli(false); + } + }, []); + const handleSave = () => { setApiKeys({ anthropic: anthropicKey, @@ -729,11 +762,27 @@ export function SettingsView() { className="rounded-xl border border-border bg-card backdrop-blur-md overflow-hidden scroll-mt-6" >
-
- -

- Claude Code CLI -

+
+
+ +

+ Claude Code CLI +

+
+

Claude Code CLI provides better performance for long-running @@ -853,11 +902,27 @@ export function SettingsView() { className="rounded-xl border border-border bg-card backdrop-blur-md overflow-hidden scroll-mt-6" >

-
- -

- OpenAI Codex CLI -

+
+
+ +

+ OpenAI Codex CLI +

+
+

Codex CLI enables GPT-5.1 Codex models for autonomous coding