From 64581734c61f3ad31e52c3decc6de10a6f983050 Mon Sep 17 00:00:00 2001
From: kaitranntt
Date: Fri, 23 Jan 2026 13:53:53 -0500
Subject: [PATCH] fix(ui): integrate ProxyStatusWidget in Settings & block
backend switch when running
- Add ProxyStatusWidget to Settings/Proxy page for quick start/stop access
- Disable backend selection when proxy is running with clear warning
- Removes UX friction: no need to navigate to CLIProxy page to stop instance
- Shows amber alert explaining why backend switch is blocked
User can now:
1. See proxy status directly in Settings
2. Stop proxy from Settings page
3. Change backend only when proxy is stopped
---
.../pages/settings/sections/proxy/index.tsx | 30 +++++++++++++++----
1 file changed, 25 insertions(+), 5 deletions(-)
diff --git a/ui/src/pages/settings/sections/proxy/index.tsx b/ui/src/pages/settings/sections/proxy/index.tsx
index 4c1518f7..73388d35 100644
--- a/ui/src/pages/settings/sections/proxy/index.tsx
+++ b/ui/src/pages/settings/sections/proxy/index.tsx
@@ -19,9 +19,10 @@ import {
AlertTriangle,
} from 'lucide-react';
import { useProxyConfig, useRawConfig } from '../../hooks';
-import { useUpdateBackend } from '@/hooks/use-cliproxy';
+import { useUpdateBackend, useProxyStatus } from '@/hooks/use-cliproxy';
import { LocalProxyCard } from './local-proxy-card';
import { RemoteProxyCard } from './remote-proxy-card';
+import { ProxyStatusWidget } from '@/components/monitoring/proxy-status-widget';
import { api } from '@/lib/api-client';
/** LocalStorage key for debug mode preference */
@@ -78,6 +79,8 @@ export default function ProxySection() {
const [backend, setBackend] = useState<'original' | 'plus'>('plus');
const [hasKiroGhcpVariants, setHasKiroGhcpVariants] = useState(false);
const updateBackendMutation = useUpdateBackend();
+ const { data: proxyStatus } = useProxyStatus();
+ const isProxyRunning = proxyStatus?.running ?? false;
// Fetch backend setting
const fetchBackend = useCallback(async () => {
@@ -253,6 +256,14 @@ export default function ProxySection() {
for proxy-based profiles
+ {/* Proxy Status Widget - Quick access to start/stop controls */}
+ {!isRemoteMode && (
+
+ )}
+
{/* Mode Toggle - Card based selection */}
Connection Mode
@@ -307,16 +318,25 @@ export default function ProxySection() {
Backend Binary
+ {/* Warning when proxy is running - must stop to change backend */}
+ {isProxyRunning && (
+
+
+
+ Stop the running proxy above to switch backend binary.
+
+
+ )}
{/* Plus Backend Card */}