Skip to content

fix(mobile): keep directly paired servers hidden from the first frame after launch - #52212

Merged
AmoabaKelvin merged 1 commit into
mainfrom
fix/hidden-relayed-rows-cold-launch
Nov 29, 2026
Merged

AmoabaKelvin merged 1 commit into
mainfrom
fix/hidden-relayed-rows-cold-launch

Conversation

@AmoabaKelvin

@AmoabaKelvin AmoabaKelvin commented Nov 29, 2026 •

Copy link
Copy Markdown
Collaborator

ELI5

When the phone pairs with a server directly, the Mac's copy of that server is hidden from the Mac's workspace list (#51647). But on a cold launch the phone painted the saved list before it had asked the Mac which servers to hide, so the hidden server's workspaces could flash under the Mac, and stayed there while the Mac was unreachable. Now the saved list remembers which servers were hidden, so they stay hidden from the first frame.

Files Added Deleted Net
Test 1 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​17 $\color{#cf222e}{\Huge{\mathbf{−}}}$​1 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​16
Prod 2 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​45 $\color{#cf222e}{\Huge{\mathbf{−}}}$​17 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​28

What Changed

  • Each server-workspaces reply now records hiddenHostIds: the relayed servers the phone paired with directly when the reply was read, taken from the relay-hosts feed's listing.
  • The record is stored with the query's persisted data. It is optional both ways: older saved data parses without it, and older apps drop the unknown field.
  • listedServerWorkspaces uses that record until this launch's relay list is read, and the live listing after that. Nothing waits on the network, so the first paint isn't delayed.
  • Unchanged polls keep their identity: the record is compared and reused, and the filtered view is memoized per reply.

Why

The hide decision depends on the relay list, which a cold launch hasn't read yet. Carrying the last known decision with the saved rows means the first paint already matches the rest of the session, instead of either flashing the hidden rows or holding every server row back until the network answers.

Linked Issue

Part of #40079 and #27988. This is a follow-up to #51647.

Visual Proof

N/A: no new UI. It removes a brief flash of rows that should already be hidden. The invariant is pinned in server-workspaces.test.ts.

Testing

  • The new case in server-workspaces.test.ts covers the rule. A restored reply hides its recorded server while the listing is unknown, and once the listing is known, it decides. The test fails on main, which shows everything while the listing is null.

  • Mobile typecheck, lint and the changed-files gate pass.

  • I manually tested these changes locally

  • Automated tests added/updated, or explained why not below

  • Every added test fails without this change and avoids the test anti-patterns

Performance

None, because it adds one set and one filter over the relayed servers per poll, plus a few ids in the stored query. There are no extra reads, RPCs or timers, and unchanged polls keep their identity.

Risk

  • Stale record: a record made before the phone dropped its direct pairing keeps that server hidden until this launch's relay list is read.
  • Back-out: a plain revert. The stored field is ignored by older code.

Level: Low

AI Disclosure

Review

Agent skill upstream boundary

  • Not applicable, or this change copies or mechanically translates no upstream skill-installer source, tests, fixtures, registry entries, path tables, comments, or documentation.

Notes

Ensure no issues in: Security, Cross-platform support (Linux, Windows, Mac), Remote SSH, Mobile, general backwards compatibility, performance

Page-only change: no store build.

Checklist

  • This PR is small and focused
  • I explained what changed and why (ELI5, the user-facing before/after, the mechanism, and why over the alternatives)
  • I stated the risk: what could break, for whom, and how to back it out
  • Before/after screenshots or videos attached for UI changes, or N/A with reason
  • Self-reviewed for correctness, security, and performance
  • Cross-platform, SSH/remote, and path/shortcut impact considered (or N/A)
  • pnpm lint, pnpm typecheck, pnpm test, and pnpm build pass (or CI will cover; local preferred)

…relay list is read

A cold launch applied restored server rows before this launch's relay list
was read, so a server the phone pairs with directly flashed under the desktop
and stayed there while the desktop was unreachable. Each server-workspaces
reply now records which servers were hidden when it was read, and a restored
reply hides those until the relay list is read again; nothing waits on the
network.
@greptile-apps

greptile-apps Bot commented Nov 29, 2026 •

Copy link
Copy Markdown

Confidence Score: 5/5 · The changes appear safe to merge.RetriggerView in GreptileConfidence Score: 5/5

[Low impact] The changes appear safe to merge.

Summary

Remembers which directly paired servers should stay hidden when saved workspace rows first appear.

  • Saved workspace replies keep directly paired servers out of the desktop list on launch.

No actionable issues found.

Acknowledged limitation: AmoabaKelvin noted that a record made before the phone drops its direct pairing keeps that server hidden until this launch reads the relay list.

Reviews (1) · Last reviewed commit: "fix(mobile): keep directly paired server..." · Reviewed by Greptile

@coderabbitai

coderabbitai Bot commented Nov 29, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

The change adds optional hiddenHostIds to server-workspace state and persisted cache data. Fetching compares returned hosts with the relay feed snapshot, or with the returned hosts when no snapshot exists, and records absent IDs. Listing filters by hiddenHostIds while the relay listing is unavailable, and by listed host IDs once it is available. The cache retains nonempty hiddenHostIds. Tests cover visibility before and after the relay list is read.

Merge Risk: Minimal · up to 34647

This change hides servers paired directly with the phone on cold launch until the relay list is read, using a saved record of hidden servers. No concrete defect was found, and rollback is a simple revert, so merge risk is minimal.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title names the fix and the affected area (mobile, directly paired servers, first frame after launch), which matches the main change: persisting hiddenHostIds so restored rows stay hidden before t…
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.
Description check Passed The description follows the repository template and covers ELI5, What Changed, Why, Linked Issue, Visual Proof, Testing, Performance, Risk, and the checklist. It explains the cold-launch flash, the hi…
Full details: Title check

Explanation

The title names the fix and the affected area (mobile, directly paired servers, first frame after launch), which matches the main change: persisting hiddenHostIds so restored rows stay hidden before the relay list is read. It is specific enough for a teammate scanning history. The wording is long at 82 characters, but it stays on topic.

Full details: Description check

Explanation

The description follows the repository template and covers ELI5, What Changed, Why, Linked Issue, Visual Proof, Testing, Performance, Risk, and the checklist. It explains the cold-launch flash, the hiddenHostIds record, and why the chosen approach avoids delaying first paint. The Risk section names a stale-record case and a plain revert as the back-out path. The Linked Issue section refers to #40079, #27988, and follow-up #51647, but it does not use the template's 'Fixes #' form. The AI Disclosure section is blank, and the lint/typecheck/test/build checklist item is unchecked. The Testing section does not say whether the change was manually tested. These gaps are minor, so the description is mostly complete.

  • Autofix · 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

Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 8c08d63c-5326-416d-8fd1-9515433dc607
Commits

Reviewing files that changed from the base of the PR and between a42c042 and 34647f0.

Files selected for processing: 3

  • mobile/src/host-screen/catalog/host-list-queries.ts
  • mobile/src/worktree/execution-hosts/server-workspaces.test.ts
  • mobile/src/worktree/execution-hosts/server-workspaces.ts

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 7 remain after this review.

@AmoabaKelvin
AmoabaKelvin merged commit 93aff6c into main Nov 29, 2026
2 checks passed
@AmoabaKelvin
AmoabaKelvin deleted the fix/hidden-relayed-rows-cold-launch branch November 29, 2026 03:46
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