mirror of
https://github.com/NousResearch/hermes-agent.git
synced 2026-07-21 16:18:55 +00:00
chore(desktop): drop the dev-only "soft switch" preview from gateway settings
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.
This commit is contained in:
parent
7550c594ce
commit
302a0dade8
3 changed files with 1 additions and 56 deletions
|
|
@ -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<GatewaySettingsState>(EMPTY_STATE)
|
||||
const [remoteToken, setRemoteToken] = useState('')
|
||||
|
|
@ -1065,26 +1063,6 @@ export function GatewaySettings() {
|
|||
description={g.diagnosticsDesc}
|
||||
title={g.diagnostics}
|
||||
/>
|
||||
{import.meta.env.DEV ? (
|
||||
<ListRow
|
||||
action={
|
||||
<Button
|
||||
disabled={previewingSwitch}
|
||||
onClick={() => {
|
||||
setPreviewingSwitch(true)
|
||||
void previewGatewaySwitch().finally(() => setPreviewingSwitch(false))
|
||||
}}
|
||||
size="sm"
|
||||
variant="textStrong"
|
||||
>
|
||||
{previewingSwitch ? <Loader2 className="animate-spin" /> : null}
|
||||
Preview soft switch
|
||||
</Button>
|
||||
}
|
||||
description="Wipe session lists so sidebar skeletons retrigger — no real backend teardown."
|
||||
title="Dev · soft switch"
|
||||
/>
|
||||
) : null}
|
||||
</div>
|
||||
</SettingsContent>
|
||||
)
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
})
|
||||
})
|
||||
|
|
|
|||
|
|
@ -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<void> {
|
||||
if ($gatewaySwitching.get()) {
|
||||
return
|
||||
}
|
||||
|
||||
$gatewaySwitching.set(true)
|
||||
wipeSessionListsForGatewaySwitch()
|
||||
|
||||
try {
|
||||
await new Promise<void>(resolve => {
|
||||
window.setTimeout(resolve, holdMs)
|
||||
})
|
||||
} finally {
|
||||
setSessionsLoading(false)
|
||||
$gatewaySwitching.set(false)
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue