From 8850b10b26ae842de19ef1dc35bface47ccfd1e0 Mon Sep 17 00:00:00 2001 From: Rowan Trollope Date: Tue, 5 May 2026 23:43:18 -0700 Subject: [PATCH] Fix UI lint regression in live-topology-card.tsx PR #14 (live topology redesign) landed before PR #13 cleared the UI lint baseline, but #13's branch was at an older base when Phase 9 ran. After both merged, main carried four @typescript-eslint/no-unnecessary- condition errors in live-topology-card.tsx: - displayAgentPrimaryName: agent.hostname?.trim() ?? "" -> .trim() (hostname is typed string, both ?. and ?? are dead). - displayAgentPrimaryName: agent.sessionId?.trim().slice(...) -> drop ?. (sessionId is typed string). - workspace grouping: ws.databaseName?.trim() || "Unassigned database" -> drop ?. (databaseName is typed string). The CI ui-lint job is blocking since Phase 9; main was red until this fix. Build, 60/60 vitest tests, and lint all green locally. Co-Authored-By: Claude Opus 4.7 (1M context) --- ui/src/components/live-topology-card.tsx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ui/src/components/live-topology-card.tsx b/ui/src/components/live-topology-card.tsx index f419a54..155e928 100644 --- a/ui/src/components/live-topology-card.tsx +++ b/ui/src/components/live-topology-card.tsx @@ -611,14 +611,14 @@ function displayLocalPath(path: string): string { // Prefer the session name, then the agent name; never return the hostname. // When neither is set, fall back to a short session id ("Session: a1b2c3d4"). function displayAgentPrimaryName(agent: AFSAgentSession): string { - const host = agent.hostname?.trim() ?? ""; + const host = agent.hostname.trim(); const notHost = (value?: string | null) => { const trimmed = value?.trim(); return trimmed && trimmed !== host ? trimmed : undefined; }; const named = notHost(agent.sessionName) || notHost(agent.agentName); if (named) return named; - const shortId = agent.sessionId?.trim().slice(0, 8); + const shortId = agent.sessionId.trim().slice(0, 8); return shortId ? `Session: ${shortId}` : "Session: unknown"; } @@ -968,7 +968,7 @@ export function LiveTopologyCard({ agents, workspaces }: Props) { if (!group) { group = { databaseId: ws.databaseId, - databaseName: ws.databaseName?.trim() || "Unassigned database", + databaseName: ws.databaseName.trim() || "Unassigned database", rows: [], }; groups.set(key, group);