Skip to content

Fix Cmd+J host badge spacing and false "Connected" runtime state#5362

Merged
Jinwoo-H merged 2 commits into
mainfrom
Jinwoo-H/fix-cmdj-host-badge-and-runtime-connected-state
Jun 14, 2026
Merged

Fix Cmd+J host badge spacing and false "Connected" runtime state#5362
Jinwoo-H merged 2 commits into
mainfrom
Jinwoo-H/fix-cmdj-host-badge-and-runtime-connected-state

Conversation

@Jinwoo-H

@Jinwoo-H Jinwoo-H commented Jun 14, 2026

Copy link
Copy Markdown
Contributor

Summary

Fixes three related issues with how remote hosts are displayed, all stemming from one root cause.

1. Runtime hosts falsely shown as "Connected" (root cause)

A runtime host (Orca server) with no live status read as available → the UI showed "Connected" even when it was never connected (e.g. in the Add a project → Host dropdown). runtimeHealth defaulted to available whenever there was no compat verdict, which included the never-connected case. SSH hosts already defaulted to disconnected; runtime now matches — no live status means no proof of reachability.

2. Cmd+J palette tagged every row with a host badge

The palette showed a host badge ("Local Mac") on every worktree row whenever any non-local host existed in the registry — even a configured-but-offline one. Because of bug #1, an offline Orca server counted as a live remote, so the badge appeared with nothing actually to disambiguate from.

The palette now disambiguates only when a non-local host is actually reachable (health !== 'disconnected'), using its own gate rather than the shared sidebar control gate. (The sidebar/create-modal gate intentionally lists offline hosts so you can connect to them — only its status label was wrong, which #1 fixes.)

3. Palette row spacing regression

The host/repo badges in palette rows were stacked vertically (regression from #5071), inflating every row's height. They now sit inline (items-center), restoring compact rows.

Notes

  • setHost now preserves the first (named) registration's label on a health-only upgrade, so a later id-labeled registration can't clobber a friendly runtime environment name (exposed once no-status runtimes became disconnected).
  • Scoped the "is there a remote to disambiguate from?" change to the palette only — the sidebar host strip and create modal continue to list disconnected hosts by design.

Testing

  • execution-host-registry.test.ts, sidebar-host-options.test.ts, palette-host-badge.test.ts — 27 tests pass (updated assertions for the corrected runtime health + new regression tests for the disconnected-runtime / no-badge cases).
  • Typecheck clean.

Files

File Change
src/shared/execution-host-registry.ts No-status runtime → disconnected; setHost preserves friendly label on health upgrade
src/renderer/src/components/cmd-j/palette-host-badge.ts Badge only when a non-local host is reachable
src/renderer/src/components/WorktreeJumpPalette.tsx Inline badge layout (3 row types)
*.test.ts (3) Updated + new regression tests

Made with Orca 🐋

Three related fixes around remote-host display:

1. Runtime hosts with no live status incorrectly read as "Connected".
   `runtimeHealth` defaulted to `available` whenever there was no compat
   verdict, including the never-connected case. SSH already defaulted to
   `disconnected`; runtime now matches — no live status means no proof of
   reachability, so the host reads `disconnected`. This is the root cause
   behind both UI symptoms below.

2. Cmd+J palette tagged every row with a host badge ("Local Mac") whenever
   any non-local host existed in the registry, even a configured-but-offline
   one. The palette now disambiguates only when a non-local host is actually
   reachable (`health !== 'disconnected'`), via its own gate rather than the
   shared sidebar control gate (which intentionally lists offline hosts).

3. The host/repo badges in palette rows were stacked vertically (regression
   from #5071), inflating every row's height. They now sit inline.

setHost preserves the first (named) registration's label on a health-only
upgrade so a later id-labeled registration can't clobber a friendly runtime
environment name.
@coderabbitai

coderabbitai Bot commented Jun 14, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 5e7f50d3-5d1f-454b-8192-b49604499b31

📥 Commits

Reviewing files that changed from the base of the PR and between a2f155b and 87540d8.

📒 Files selected for processing (1)
  • src/renderer/src/components/WorktreeJumpPalette.tsx
🚧 Files skipped from review as they are similar to previous changes (1)
  • src/renderer/src/components/WorktreeJumpPalette.tsx

📝 Walkthrough

Walkthrough

The PR makes three changes. First, runtimeHealth in the execution host registry now returns disconnected when no live runtime status is present, rather than treating absence of status as reachable; setHost additionally preserves the existing label when upgrading a disconnected entry. Second, getPaletteHostBadge switches its display gate from shouldShowHostScopeControls to a new hasActiveRemoteHost helper that returns null whenever all non-local hosts are disconnected, covering SSH and runtime cases. Third, badge wrapper elements in three palette row types in WorktreeJumpPalette.tsx change from vertical (flex-col items-end) to horizontal (flex items-center) layout.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 14.29% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately summarizes the main changes: fixing Cmd+J host badge spacing and addressing false 'Connected' runtime state issues.
Description check ✅ Passed The PR description provides comprehensive coverage of all three issues, implementation details, testing results, and affected files, closely following the template structure.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1


ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: dc7778d2-2bff-4b87-b08e-bb2c26629594

📥 Commits

Reviewing files that changed from the base of the PR and between c377ec1 and a2f155b.

📒 Files selected for processing (6)
  • src/renderer/src/components/WorktreeJumpPalette.tsx
  • src/renderer/src/components/cmd-j/palette-host-badge.test.ts
  • src/renderer/src/components/cmd-j/palette-host-badge.ts
  • src/renderer/src/components/sidebar/sidebar-host-options.test.ts
  • src/shared/execution-host-registry.test.ts
  • src/shared/execution-host-registry.ts

Comment thread src/renderer/src/components/WorktreeJumpPalette.tsx
@Jinwoo-H
Jinwoo-H merged commit a28dd42 into main Jun 14, 2026
1 check passed
@Jinwoo-H
Jinwoo-H deleted the Jinwoo-H/fix-cmdj-host-badge-and-runtime-connected-state branch June 14, 2026 18:23
thomaszdxsn pushed a commit to thomaszdxsn/orca that referenced this pull request Jun 15, 2026
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