Fix Cmd+J host badge spacing and false "Connected" runtime state#5362
Conversation
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.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthroughThe PR makes three changes. First, 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
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. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro
Run ID: dc7778d2-2bff-4b87-b08e-bb2c26629594
📒 Files selected for processing (6)
src/renderer/src/components/WorktreeJumpPalette.tsxsrc/renderer/src/components/cmd-j/palette-host-badge.test.tssrc/renderer/src/components/cmd-j/palette-host-badge.tssrc/renderer/src/components/sidebar/sidebar-host-options.test.tssrc/shared/execution-host-registry.test.tssrc/shared/execution-host-registry.ts
Co-authored-by: Orca <[email protected]>
…blyai#5362) Co-authored-by: Orca <[email protected]>
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).runtimeHealthdefaulted toavailablewhenever there was no compat verdict, which included the never-connected case. SSH hosts already defaulted todisconnected; 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
setHostnow 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 becamedisconnected).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).Files
src/shared/execution-host-registry.tsdisconnected;setHostpreserves friendly label on health upgradesrc/renderer/src/components/cmd-j/palette-host-badge.tssrc/renderer/src/components/WorktreeJumpPalette.tsx*.test.ts(3)Made with Orca 🐋