Skip to content

feat(mobile): show SSH host health on the workspace row badge - #26415

Merged
Jinwoo-H merged 7 commits into
mainfrom
feat/mobile-ssh-host-offline-badge
Oct 11, 2026
Merged

Jinwoo-H merged 7 commits into
mainfrom
feat/mobile-ssh-host-offline-badge

Conversation

@Jinwoo-H

@Jinwoo-H Jinwoo-H commented Oct 8, 2026 •

Copy link
Copy Markdown
Contributor
Files Added Deleted Net
Test 8 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​289 $\color{#cf222e}{\Huge{\mathbf{−}}}$​2 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​287
Prod 29 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​1338 $\color{#cf222e}{\Huge{\mathbf{−}}}$​852 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​486

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.

  • Words: "Disconnected", "Connecting" or "Needs attention". These come from the same table the
    desktop sidebar uses.
  • Healthy and local hosts keep today's name-only badge.
  • Single-host lists: an unhealthy host is labelled even when every workspace is on it, matching the
    desktop's per-card SSH status. Healthy single-host lists stay bare.
  • Updates live: the desktop already pushes sshStateChanged, and the phone now refreshes on it,
    otherwise on its existing cadence.
  • Truncation: long host names cut off first; the health word always stays visible.
  • Screen readers read "devbox, Disconnected".

Mechanism:

  • The data already reached the phone. ssh.listTargetSummaries has returned connected and
    connectionStatus since feat(cli): report SSH host platforms #18896. The phone already called it for host labels, but its reply schema
    dropped those two fields.
  • One shared table. The desktop's private SSH health function and the sidebar's label table moved to
    src/shared/execution-host-health.ts, and both apps now call them, so the words can't drift. Desktop
    behaviour is unchanged.
  • Health is a per-host fact (hostHealthById), not an SSH special case, so other host kinds can
    reuse 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.

ssh-host-badge-states.png

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

  • Ships to OTA phones with the desktop update; store-app users get it with the next app release.
  • No wire change, so older desktops keep today's badge.

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
@coderabbitai

coderabbitai Bot commented Oct 8, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

Important

Review skipped

Review was skipped as selected files did not have any reviewable changes.

⚙️ Run configuration
  • Configuration used: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: b5d80d75-ad66-4c4b-9942-31753de16edd

📥 Commits

Reviewing files that changed from the base of the PR and between b7c0df9 and bcfe44a.


You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
📝 Walkthrough
📝 Walkthrough

Walkthrough

The changes add shared SSH connection health mapping and labels. Mobile host metadata preserves SSH lifecycle fields and stores health by host ID. The host screen applies health labels to matching worktree rows and refreshes metadata when SSH state changes. Worktree host badges display the health label and include it in their accessibility label.



Priority: ➖ Normal

Merge Risk: 🔵 Low · up to b7c0d

Workspaces using a persisted SSH target ID of local can omit the host health badge text, although the workspace remains usable. Align the shared ID conversion; this is a narrow display issue, not a broad merge blocker.

Pre-merge checks | Passed 4 | Failed 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 33.33% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 27 functions across 25 files. 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 clearly and concisely describes the primary change: displaying SSH host health on mobile workspace row badges.
Description check Passed The description is mostly complete. It includes the required ELI5, What Changed, Why, Linked Issue, Visual Proof, Testing, and Notes sections, with clear user impact, implementation details, compatibi…
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.



✨ Finishing Touches 💡 2
📝 Generate docstrings 💡
  • Commit to this branch
  • Create a new PR


🛠️ Fix failing CI checks 💡
  • Commit to this branch
  • Create a new PR

  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

… 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

@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: Advanced
  • Run ID: 80666e8e-8185-4dd8-855d-7fee3c014802
📥 Commits

Reviewing files that changed from the base of the PR and between d0e729c and 527f66f.

📒 Files selected for processing (25)
  • mobile/src/components/WorktreeListRow.test.ts
  • mobile/src/components/WorktreeListRow.tsx
  • mobile/src/host-screen/host-screen-reply-schema.test.ts
  • mobile/src/host-screen/host-screen-reply-schema.ts
  • mobile/src/host-screen/host-show-pinned-in-groups.test.ts
  • mobile/src/host-screen/host-ssh-health-badge-wiring.test.ts
  • mobile/src/host-screen/use-host-display-worktrees.ts
  • mobile/src/host-screen/use-host-repo-metadata.ts
  • mobile/src/host-screen/use-host-screen-controller.ts
  • mobile/src/host-screen/use-host-screen-identity.ts
  • mobile/src/host-screen/use-host-screen-state.ts
  • mobile/src/tasks/workspace-source-reply-schema.test.ts
  • mobile/src/tasks/workspace-source-reply-schema.ts
  • mobile/src/transport/ssh-connection-status-arms.ts
  • mobile/src/worktree/host-worktree-refresh.test.ts
  • mobile/src/worktree/host-worktree-refresh.ts
  • mobile/src/worktree/workspace-list-types.ts
  • mobile/src/worktree/worktree-host-context-labels.test.ts
  • mobile/src/worktree/worktree-host-context-labels.ts
  • mobile/src/worktree/worktree-host-health.test.ts
  • mobile/src/worktree/worktree-host-health.ts
  • src/renderer/src/components/sidebar/sidebar-host-options.ts
  • src/shared/execution-host-health.ts
  • src/shared/execution-host-registry.ts
  • src/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.

Comment on lines +170 to +174
<View
style={[styles.childBadge, styles.hostBadge]}
accessibilityLabel={[item.hostContextLabel, item.hostContextHealthLabel]
.filter(Boolean)
.join(', ')}

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.

🎯 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 1

Repository: 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.ts

Repository: 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

@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.

Caution

Some comments are outside the diff and can’t be posted inline due to GitHub limitations.

⚠️ Outside diff range comments (1)

🟡 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 win

Handle the raw local target ID in sshTargetSummaryHostId.

A persisted SSH target with ID local is keyed as local, while its matching workspace connectionId resolves to ssh: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
📥 Commits

Reviewing files that changed from the base of the PR and between 1896b05 and b7c0df9.

📒 Files selected for processing (2)
  • src/renderer/src/components/sidebar/sidebar-host-options.ts
  • src/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.

@Jinwoo-H
Jinwoo-H merged commit 7abee44 into main Oct 11, 2026
31 checks passed
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