Clean up gateway status conditionals and logging bootstrap mode detection.

Simplify nested dashboard gateway status branches for readability and use a concise first-subcommand check when selecting early GUI logging mode.
This commit is contained in:
Brooklyn Nicholson
2026-05-15 19:42:46 -05:00
parent af245abec9
commit 40ad610968
3 changed files with 28 additions and 22 deletions
@@ -40,14 +40,19 @@ export function GatewayMenuPanel({
statusSnapshot
}: GatewayMenuPanelProps) {
const gatewayOpen = gatewayState === 'open'
const gatewayConnecting = gatewayState === 'connecting'
const inferenceReady = gatewayOpen && inferenceStatus?.ready === true
const connectionLabel = gatewayOpen ? 'Connected' : prettyState(gatewayState || 'offline')
const connectionLabel = gatewayOpen
? 'Connected'
: gatewayConnecting
? 'Connecting'
: prettyState(gatewayState || 'offline')
const inferenceLabel = gatewayOpen
? inferenceStatus
? inferenceReady
? 'Inference ready'
: 'Inference not ready'
: 'Checking inference'
? inferenceStatus?.ready
? 'Inference ready'
: inferenceStatus
? 'Inference not ready'
: 'Checking inference'
: 'Disconnected'
const platforms = Object.entries(statusSnapshot?.gateway_platforms || {}).sort(([l], [r]) => l.localeCompare(r))
const recentLogs = logLines.slice(-5)
@@ -105,19 +105,21 @@ export function useStatusbarItems({
}, [desktopActionTasks, previewServerRestartStatus, subagentsBySession, workingSessionIds])
const gatewayOpen = gatewayState === 'open'
const gatewayConnecting = gatewayState === 'connecting'
const inferenceReady = gatewayOpen && inferenceStatus?.ready === true
const gatewayDegraded = gatewayOpen || gatewayConnecting
const gatewayDetail = gatewayOpen
? inferenceStatus
? inferenceReady
? 'ready'
: 'needs setup'
: 'checking'
: gatewayState === 'connecting'
? inferenceStatus?.ready
? 'ready'
: inferenceStatus
? 'needs setup'
: 'checking'
: gatewayConnecting
? 'connecting'
: 'offline'
const gatewayClassName = inferenceReady
? undefined
: gatewayOpen || gatewayState === 'connecting'
: gatewayDegraded
? 'text-amber-600 hover:text-amber-600'
: 'text-destructive hover:text-destructive'