From 302a0dade8df2b2bbcf2d7a1f040d23772a39100 Mon Sep 17 00:00:00 2001 From: Brooklyn Nicholson Date: Sun, 12 Jul 2026 03:34:57 -0400 Subject: [PATCH] chore(desktop): drop the dev-only "soft switch" preview from gateway settings MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Remove the DEV-gated "Dev · soft switch" ListRow and its previewGatewaySwitch helper. It was a temporary review affordance for exercising the soft-switch reconnect; dead-stripped from production, but it doesn't belong in the tree. wipeSessionListsForGatewaySwitch (the real path) and $gatewaySwitching stay. --- .../src/app/settings/gateway-settings.tsx | 22 ---------------- apps/desktop/src/store/gateway-switch.test.ts | 10 +------- apps/desktop/src/store/gateway-switch.ts | 25 ------------------- 3 files changed, 1 insertion(+), 56 deletions(-) diff --git a/apps/desktop/src/app/settings/gateway-settings.tsx b/apps/desktop/src/app/settings/gateway-settings.tsx index 2be223b341ec..a06c57a396cf 100644 --- a/apps/desktop/src/app/settings/gateway-settings.tsx +++ b/apps/desktop/src/app/settings/gateway-settings.tsx @@ -10,7 +10,6 @@ import { ExternalLink } from '@/lib/external-link' import { AlertCircle, Check, Cloud, FileText, Globe, HelpCircle, Loader2, LogIn, Monitor, RefreshCw } from '@/lib/icons' import { selectableCardClass } from '@/lib/selectable-card' import { cn } from '@/lib/utils' -import { previewGatewaySwitch } from '@/store/gateway-switch' import { notify, notifyError } from '@/store/notifications' import { $profiles, refreshActiveProfile } from '@/store/profile' @@ -117,7 +116,6 @@ export function GatewaySettings() { const [loading, setLoading] = useState(true) const [saving, setSaving] = useState(false) const [testing, setTesting] = useState(false) - const [previewingSwitch, setPreviewingSwitch] = useState(false) const [signingIn, setSigningIn] = useState(false) const [state, setState] = useState(EMPTY_STATE) const [remoteToken, setRemoteToken] = useState('') @@ -1065,26 +1063,6 @@ export function GatewaySettings() { description={g.diagnosticsDesc} title={g.diagnostics} /> - {import.meta.env.DEV ? ( - { - setPreviewingSwitch(true) - void previewGatewaySwitch().finally(() => setPreviewingSwitch(false)) - }} - size="sm" - variant="textStrong" - > - {previewingSwitch ? : null} - Preview soft switch - - } - description="Wipe session lists so sidebar skeletons retrigger — no real backend teardown." - title="Dev · soft switch" - /> - ) : null} ) diff --git a/apps/desktop/src/store/gateway-switch.test.ts b/apps/desktop/src/store/gateway-switch.test.ts index b50cfb059afa..5b24c120ccc9 100644 --- a/apps/desktop/src/store/gateway-switch.test.ts +++ b/apps/desktop/src/store/gateway-switch.test.ts @@ -16,7 +16,7 @@ import { setSessionsTotal } from '@/store/session' -import { $gatewaySwitching, previewGatewaySwitch, wipeSessionListsForGatewaySwitch } from './gateway-switch' +import { $gatewaySwitching, wipeSessionListsForGatewaySwitch } from './gateway-switch' vi.mock('@/lib/query-client', () => ({ queryClient: { invalidateQueries: vi.fn() } @@ -54,12 +54,4 @@ describe('wipeSessionListsForGatewaySwitch', () => { expect($sessionsLimit.get()).toBe(SIDEBAR_SESSIONS_PAGE_SIZE) expect($freshDraftReady.get()).toBe(true) }) - - it('previewGatewaySwitch holds skeletons then clears loading', async () => { - await previewGatewaySwitch(20) - - expect($sessions.get()).toEqual([]) - expect($sessionsLoading.get()).toBe(false) - expect($gatewaySwitching.get()).toBe(false) - }) }) diff --git a/apps/desktop/src/store/gateway-switch.ts b/apps/desktop/src/store/gateway-switch.ts index 44be58186d0f..27f9f952f67c 100644 --- a/apps/desktop/src/store/gateway-switch.ts +++ b/apps/desktop/src/store/gateway-switch.ts @@ -24,8 +24,6 @@ import { // overlay from resurrecting when startHermes re-emits boot progress. export const $gatewaySwitching = atom(false) -const PREVIEW_HOLD_MS = 1400 - /** * Clear gateway-bound session UI so sidebar skeletons retrigger. * @@ -58,26 +56,3 @@ export function wipeSessionListsForGatewaySwitch(): void { void queryClient.invalidateQueries() } - -/** - * Dev review beat: wipe → skeletons for PREVIEW_HOLD_MS → clear loading. - * Does not tear down a real backend. Fired from the Settings button (Electron - * has no easy `?query=` entry). - */ -export async function previewGatewaySwitch(holdMs = PREVIEW_HOLD_MS): Promise { - if ($gatewaySwitching.get()) { - return - } - - $gatewaySwitching.set(true) - wipeSessionListsForGatewaySwitch() - - try { - await new Promise(resolve => { - window.setTimeout(resolve, holdMs) - }) - } finally { - setSessionsLoading(false) - $gatewaySwitching.set(false) - } -}