Skip to content

Fix UI lint regression in live-topology-card.tsx#16

Merged
rowantrollope merged 1 commit intomainfrom
fix-live-topology-lint
May 6, 2026
Merged

Fix UI lint regression in live-topology-card.tsx#16
rowantrollope merged 1 commit intomainfrom
fix-live-topology-lint

Conversation

@rowantrollope
Copy link
Copy Markdown
Collaborator

Summary

Fix four @typescript-eslint/no-unnecessary-condition errors in ui/src/components/live-topology-card.tsx that broke the ui-lint CI job on main after #15 merged.

#13's Phase 9 cleared the UI lint baseline (27 → 0) and made the ui-lint CI job blocking. #14 (live topology redesign) introduced new optional-chain / nullish-coalesce uses on fields that the type system already proves non-null, but the timing meant Phase 9's lint sweep didn't see them. After both #14 and #15 landed on top of #13, main was red on ui-lint.

What's fixed

Line Before After Reason
614 agent.hostname?.trim() ?? "" agent.hostname.trim() hostname: string is required; both ?. and ?? are dead
621 agent.sessionId?.trim().slice(0, 8) agent.sessionId.trim().slice(0, 8) sessionId: string is required
971 ws.databaseName?.trim() || "..." ws.databaseName.trim() || "..." databaseName: string is required

Behavior is unchanged when the runtime values match the TypeScript types (which they should, per the API contract).

Test plan

  • cd ui && npm run lint — clean (was 4 errors, now 0)
  • cd ui && npm run build — clean
  • cd ui && npm test — 60/60 pass
  • Manual sanity-check on npm run dev — Live Topology card renders the same agent/workspace names as before (visual no-op)

🤖 Generated with Claude Code

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) <noreply@anthropic.com>
@jit-ci
Copy link
Copy Markdown

jit-ci Bot commented May 6, 2026

🛡️ Jit Security Scan Results

CRITICAL HIGH MEDIUM

✅ No security findings were detected in this PR


Security scan by Jit

@rowantrollope rowantrollope merged commit 8850b10 into main May 6, 2026
6 checks passed
@rowantrollope rowantrollope deleted the fix-live-topology-lint branch May 6, 2026 07:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant