Repository navigation
feat(mobile): show SSH host health on the workspace row badge - #26415
Conversation
Rows on an SSH host the desktop cannot reach looked healthy on the phone. The badge now
adds the desktop sidebar's own word ("devbox · Disconnected"), derived by the same shared
function from the connection status ssh.listTargetSummaries already sends; old desktops keep today's badge.
Claude-Session: https://claude.ai/code/session_01JNnE9qzUZMMnqpZWCqM3nb
The desktop card shows SSH status on any host count, so the phone now reads target summaries whenever a repo is on SSH and badges an unhealthy host alone too. Labels and health share one target-to-host keying, and a hook-level test pins the reply-to-row wiring. Claude-Session: https://claude.ai/code/session_01JNnE9qzUZMMnqpZWCqM3nb
…e dot
A catalog that no longer spans hosts or holds an SSH repo now clears the health and label maps,
so a host that left cannot keep badging rows. The badge gets a screen-reader label ("devbox,
Disconnected") instead of reading the middle dot.
Claude-Session: https://claude.ai/code/session_01JNnE9qzUZMMnqpZWCqM3nb
|
Important Review skippedReview was skipped as selected files did not have any reviewable changes. ⚙️ Run configuration
You can disable this status message by setting the Use the checkbox below for a quick retry:
📝 Walkthrough
Priority: ➖ Normal Merge Risk: 🔵 Low · up to Workspaces using a persisted SSH target ID of Pre-merge checks |
|
… tsc passes Fixtures hoisted into consts widened their health maps to string, which the now-required hostHealthById rejects under the tests-typecheck ratchet; passing them inline keeps the union. Claude-Session: https://claude.ai/code/session_01JNnE9qzUZMMnqpZWCqM3nb
There was a problem hiding this comment.
Actionable comments posted: 1
ℹ️ Review info
⚙️ Run configuration
- Configuration used: Repository UI
- Review profile: CHILL
- Plan: Advanced
- Run ID:
80666e8e-8185-4dd8-855d-7fee3c014802
📒 Files selected for processing (25)
mobile/src/components/WorktreeListRow.test.tsmobile/src/components/WorktreeListRow.tsxmobile/src/host-screen/host-screen-reply-schema.test.tsmobile/src/host-screen/host-screen-reply-schema.tsmobile/src/host-screen/host-show-pinned-in-groups.test.tsmobile/src/host-screen/host-ssh-health-badge-wiring.test.tsmobile/src/host-screen/use-host-display-worktrees.tsmobile/src/host-screen/use-host-repo-metadata.tsmobile/src/host-screen/use-host-screen-controller.tsmobile/src/host-screen/use-host-screen-identity.tsmobile/src/host-screen/use-host-screen-state.tsmobile/src/tasks/workspace-source-reply-schema.test.tsmobile/src/tasks/workspace-source-reply-schema.tsmobile/src/transport/ssh-connection-status-arms.tsmobile/src/worktree/host-worktree-refresh.test.tsmobile/src/worktree/host-worktree-refresh.tsmobile/src/worktree/workspace-list-types.tsmobile/src/worktree/worktree-host-context-labels.test.tsmobile/src/worktree/worktree-host-context-labels.tsmobile/src/worktree/worktree-host-health.test.tsmobile/src/worktree/worktree-host-health.tssrc/renderer/src/components/sidebar/sidebar-host-options.tssrc/shared/execution-host-health.tssrc/shared/execution-host-registry.tssrc/shared/worktree/host-context-labels.ts
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 5 remain after this review.
| <View | ||
| style={[styles.childBadge, styles.hostBadge]} | ||
| accessibilityLabel={[item.hostContextLabel, item.hostContextHealthLabel] | ||
| .filter(Boolean) | ||
| .join(', ')} |
There was a problem hiding this comment.
🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win
🔎 Supported by static analysis
🏁 Script executed:
set -eu
printf '%s\n' '--- component context ---'
nl -ba mobile/src/components/WorktreeListRow.tsx | sed -n '1,260p'
printf '%s\n' '--- references and tests ---'
rg -n -F --glob 'mobile/**' -- 'WorktreeListRow' . || test "$?" -eq 1
rg -n -F --glob 'mobile/**' -- 'hostContextHealthLabel' . || test "$?" -eq 1
printf '%s\n' '--- relevant accessibility props ---'
rg -n -F --glob 'mobile/src/**' -- 'accessibilityLabel' mobile/src/components mobile/src/screens || test "$?" -eq 1Repository: stablyai/orca
Length of output: 26690
🏁 Script executed:
set -eu
printf '%s\n' '--- focused WorktreeListRow test ---'
nl -ba mobile/src/components/WorktreeListRow.test.ts | sed -n '220,290p'
printf '%s\n' '--- WorktreeMetaGlyphs ---'
nl -ba mobile/src/components/WorktreeMetaGlyphs.tsx | sed -n '1,180p'
printf '%s\n' '--- prior/base-to-head diff for this component ---'
git diff 4f4f021f8a19fdd3786cdf98072b6ee802a82e03 527f66f729b530a11e6958772831276133d559e6 -- mobile/src/components/WorktreeListRow.tsx mobile/src/components/WorktreeListRow.test.tsRepository: stablyai/orca
Length of output: 9397
Expose the host status through the row’s accessible label.
The row’s Pressable is the accessible element, but the accessibilityLabel is on a nested View. Screen readers can therefore focus the row without announcing the explicit hostContextLabel, hostContextHealthLabel value. Build the Pressable label from the row’s existing text and append the host and health labels. Do not replace the row’s other information with only the host status. Check the result with VoiceOver and TalkBack.
The settled metadata state now carries hostHealthById, and an SSH-only catalog now reads the target summaries so a lone unhealthy host can be badged. Scoped re-record via rpc-recording.mts. Claude-Session: https://claude.ai/code/session_01JNnE9qzUZMMnqpZWCqM3nb
There was a problem hiding this comment.
Caution
Some comments are outside the diff and can’t be posted inline due to GitHub limitations.
🟡 Minor · Handle the raw local target ID in sshTargetSummaryHostId. · worktree-host-health.ts:20-29
mobile/src/worktree/worktree-host-health.ts:20-29
🎯 Functional Correctness | 🟡 Minor | ⚡ Quick winHandle the raw
localtarget ID insshTargetSummaryHostId.A persisted SSH target with ID
localis keyed aslocal, while its matching workspaceconnectionIdresolves tossh:local. The health and host-label lookups therefore miss the target.Suggested fix
import { + LOCAL_EXECUTION_HOST_ID, + getConnectionExecutionHostId, getExecutionHostLabel, getLocalExecutionHostLabel, normalizeExecutionHostId, @@ export function sshTargetSummaryHostId(targetId: string): ExecutionHostId { - return normalizeExecutionHostId(targetId) ?? toSshExecutionHostId(targetId) + return targetId === LOCAL_EXECUTION_HOST_ID + ? getConnectionExecutionHostId(targetId) + : normalizeExecutionHostId(targetId) ?? toSshExecutionHostId(targetId) }
ℹ️ Review info
⚙️ Run configuration
- Configuration used: Repository UI
- Review profile: CHILL
- Plan: Advanced
- Run ID:
aefd239c-0c65-4429-bb90-9f3cf70b7b6f
📒 Files selected for processing (2)
src/renderer/src/components/sidebar/sidebar-host-options.tssrc/shared/execution-host-registry.ts
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 6 remain after this review.
ELI5
When your computer can't reach one of its SSH machines, the phone now says so on that workspace's row,
for example "devbox · Disconnected", using the same words as the desktop. Before, the phone showed those
workspaces as if everything was fine.
What Changed
Before: a phone paired with a desktop listed SSH workspaces from saved state with no hint that the
desktop had lost the SSH connection. The desktop's own sidebar showed the connection state.
After: the row's existing host badge adds the host's health.
desktop sidebar uses.
desktop's per-card SSH status. Healthy single-host lists stay bare.
sshStateChanged, and the phone now refreshes on it,otherwise on its existing cadence.
Mechanism:
ssh.listTargetSummarieshas returnedconnectedandconnectionStatussince feat(cli): report SSH host platforms #18896. The phone already called it for host labels, but its reply schemadropped those two fields.
src/shared/execution-host-health.ts, and both apps now call them, so the words can't drift. Desktopbehaviour is unchanged.
hostHealthById), not an SSH special case, so other host kinds canreuse it later.
Why
This reuses data and wording the desktop already has, so it's a phone-page change only: no new request
and no wire change. Older desktops that don't send these fields give no health, so they keep today's
badge, and an unrecognised status shows no word rather than a guess. A per-host health map keeps the row
code independent of where health comes from.
Linked Issue
N/A (maintainer)
Visual Proof
The states as rendered through react-native-web, with stand-in icons: healthy, Disconnected, Connecting,
a long name with Needs attention, and Local.
Testing
I manually tested these changes locally
Automated tests added/updated, or explained why not below
A wiring test runs the real host-screen state, metadata refresh and row projection hooks against
faked desktop replies. Cases: single-host disconnected, mixed-host connecting, healthy single host, and
the host leaving the catalog.
Each red run was checked by deliberately breaking that link: dropping the health setter, passing an
empty map, restoring the mixed-host-only fetch, removing the no-shrink style, and using the dot in the
accessibility label.
Unit tests cover the health derivation across connected, connecting, disconnected, an unknown
status, missing fields from older desktops, and local hosts. Row render tests cover the badge text,
no-shrink and the accessibility label.
Results: mobile host-screen, worktree and row suites, 266 passed. Desktop sidebar, registry and
shared worktree suites, 314 passed. Mobile page closure suites pass, and no pin moved.
Not tested: a real device, or a live SSH disconnect.
Notes