Repository navigation
fix(mobile): phone server rows follow the desktop's other-client and sleeping filters - #28819
Conversation
…sleeping filters A phone created through a desktop now records whom it acted for, so the desktop's Hide other-client workspaces filter keeps the user's own phone workspaces (locally and on servers) and hides only other people's. The desktop relay marks each server row its sidebar would hide, and the rows its own browser or chat tabs keep awake; the phone applies both.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info
📝 Walkthrough
Priority: ➖ Normal Merge Risk: ⚪ Minimal · up to
|
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:
490601eb-e71d-44cf-97bd-6fc95b0a95d5
📒 Files selected for processing: 51
config/scripts/ci-shard-timings.jsonmobile/src/worktree/workspace-list-sections.test.tsmobile/src/worktree/workspace-list-sections.tsmobile/src/worktree/workspace-list-types.tssrc/main/ipc/runtime-environment-mobile-relay-hosts.tssrc/main/runtime/mobile-desktop-relay/delegated-phone-grant-cache.tssrc/main/runtime/mobile-desktop-relay/mobile-desktop-relay-hosts.tssrc/main/runtime/mobile-desktop-relay/mobile-desktop-relay.tssrc/main/runtime/mobile-desktop-relay/mobile-relay-host-catalog.test.tssrc/main/runtime/mobile-desktop-relay/mobile-relay-host-catalog.tssrc/main/runtime/orca-runtime-pty-foreground-process-reads.tssrc/main/runtime/rpc/core.tssrc/main/runtime/rpc/dispatcher-stream-options.tssrc/main/runtime/rpc/methods/worktree-catalog-methods.tssrc/main/runtime/rpc/workspace-creator-context.test.tssrc/main/runtime/rpc/workspace-creator-context.tssrc/main/runtime/rpc/worktree-ps-other-client-marks.test.tssrc/main/runtime/rpc/worktree-ps-other-client-marks.tssrc/main/runtime/runtime-rpc/runtime-rpc-pairing.tssrc/main/runtime/runtime-rpc/runtime-rpc-websocket-dispatch.tssrc/renderer/src/components/activity/activity-scope-filter.tssrc/renderer/src/components/activity/use-agent-pane-threads.tssrc/renderer/src/components/native-chat/StructuredAgentSessionPaneOverlayLayer.tsxsrc/renderer/src/components/native-chat/native-chat-tab-directory.tssrc/renderer/src/components/native-chat/structured-agent-registered-agent-surface.test.tssrc/renderer/src/components/native-chat/structured-agent-session-tabs.tssrc/renderer/src/components/native-chat/structured-attention-dispatch.test.tssrc/renderer/src/components/native-chat/structured-attention-surface.tssrc/renderer/src/components/sidebar/use-visible-workspace-kanban-worktree-ids.tssrc/renderer/src/components/sidebar/visible-worktree-options-from-state.tssrc/renderer/src/components/sidebar/visible-worktrees.test.tssrc/renderer/src/components/sidebar/visible-worktrees.tssrc/renderer/src/components/sidebar/workspace-creator-visibility.test.tssrc/renderer/src/components/sidebar/worktree-list/listing/use-filters.tssrc/renderer/src/components/sidebar/worktree-list/listing/use-host-visible-scope.tssrc/renderer/src/components/sidebar/worktree-list/listing/use-visible-worktrees.tssrc/renderer/src/components/use-worktree-jump-palette-worktrees.tssrc/renderer/src/hooks/agent-auto-ack-targets.tssrc/renderer/src/lib/running-agent-targets.tssrc/renderer/src/lib/unread-badge-count-selector.tssrc/renderer/src/lib/unread-badge-count.tssrc/renderer/src/store/slices/runtime-status.test.tssrc/shared/mobile-relay-hosts-contract.tssrc/shared/runtime-worktree-contracts.tssrc/shared/structured-agent-session-tab.tssrc/shared/workspace-creator-provenance.tssrc/shared/workspace-creator-visibility.test.tssrc/shared/workspace-creator-visibility.tssrc/shared/workspace-session-tab-activity.tssrc/shared/worktree/types.tstests/e2e/paired-mobile-desktop-mirror-workspace-visibility.spec.ts
💤 Files with no reviewable changes: 1
- src/renderer/src/components/sidebar/workspace-creator-visibility.test.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.
…tab activity into the host flag A phone now records its owner as the creator (this host for a directly paired phone, the relaying desktop for a delegated one), so the shared rule is unchanged and onBehalfOf is gone. The relay ORs the desktop's saved browser/chat tabs into hasHostSidebarActivity, so the phone's status dot follows too, and local worktree.ps counts the same signals. The old-server fallback is removed.
|
Visual proof for this PR is on #28850, under "Visual proof (combined build)": #28850 (comment) It was captured on one build of #28850 (stacked on this PR), with an Android emulator, a desktop and one test |
# Conflicts: # config/scripts/ci-shard-timings.json
ELI5
Your phone's workspace list should show exactly what your desktop's sidebar shows. For workspaces on remote Orca servers it didn't.
Now the desktop marks the server workspaces its sidebar hides, and counts its own open tabs as activity. The phone follows both.
The setting also now means what it says: it hides other people's workspaces. Workspaces you create from your own phone stay visible, on the desktop and on the phone.
What Changed
Before, on Jinwoo's real setup:
After:
A phone's workspace is recorded as its owner's. When a phone creates a workspace, the machine that runs it records the phone's owner as the creator:
The "Hide other-client workspaces" rule itself is unchanged; it moves to
src/shared/workspace-creator-visibility.tsasisWorkspaceOwnedBySomeoneElse. Because phones now record their owner, the user's own phone workspaces stay visible. This also changes the desktop: workspaces made from your own phone are no longer hidden by this filter. Nothing else reads the phone's own device id from that record; every reader was checked.Server workspaces on the phone. When the desktop passes a server's workspace list to the phone (
MobileRelayHostCatalog.worktrees), it changes two things on each row:desktopOtherClient: truewhen its sidebar hides the row as someone else's. This is only sent while that setting is on, and it uses the desktop's own device id on that server.hasHostSidebarActivityflag to true when the desktop's saved session has a browser tab or native-chat tab open in that workspace. The phone's "Hide sleeping" and its status dot both read this flag, so they follow the desktop with no phone change.The desktop's own workspaces on the phone.
worktree.psadds the samedesktopOtherClientmark for phones paired straight to this computer. It never adds it for another desktop's relayed phone.src/shared/workspace-session-tab-activity.ts). This changes one thing for everyworktree.psreader: a workspace whose only open tab is a native chat now counts as active, which matches the desktop sidebar. That affects the phone, theorca worktree psCLI, and the order rows sort in. Browser tabs saved under aworktree:-prefixed key are now recognised too.On the phone, the only change is dropping rows marked
desktopOtherClient. Marked rows are still sent, so notification links and workspace lineage keep working.What the desktop's main process sees, compared with the sidebar. The sidebar treats a workspace as awake if it has any of these: a live terminal, a browser tab, a native-chat tab, or a running agent.
Why
Record the owner at creation. Only the machine that runs a workspace knows whether a phone is one it relays for a desktop (
parentDeviceIdin its device registry). Recording the owner there means:An earlier version of this PR added a separate
onBehalfOffield and an in-memory fallback for older servers. Review showed both were extra moving parts, and the fallback made the phone disagree with the desktop sidebar, so both are gone.Mark rows instead of sending the setting. The setting is deliberately kept off paired clients (
src/shared/pairing-local-ui-fields.ts). The phone also couldn't apply it, because the rule needs the desktop's device id on each server and the desktop's saved tabs.Reuse the existing activity flag. Folding the desktop's tab activity into
hasHostSidebarActivitykeeps "Hide sleeping" and the status dot consistent without a new wire field.Compatibility.
desktopOtherClientand shows what it showed before. It does get the improved activity flag.Workspaces created before this change. Workspaces a directly paired phone created before this change stay hidden on the desktop, as today. They are now hidden on the phone too. There is no device-registry fallback for them. Jinwoo's desktop has none: all 3,743 of its saved workspace records have either no creator or the desktop itself as creator.
Linked Issue
None. Internal parity fix for the phone-mirrors-desktop project.
Visual Proof
N/A for screenshots: there is no new UI. The visible change is which rows the existing list shows, and their status dot. The end-to-end test below compares the phone's rows with the rows the real desktop sidebar draws.
Testing
New end-to-end test
tests/e2e/paired-mobile-desktop-mirror-workspace-visibility.spec.ts. It runs a real headlessorca serve, a real paired desktop (background launch), and a phone protocol client paired to that desktop. The server has three workspaces: one created on the server itself, one by the desktop, and one by the phone through the desktop.paired-mobile-desktop-mirror.spec.ts.active, receivedinactive). Onmainit cannot pass, because the marks do not exist there.Unit tests:
worktree.psmarks: only this computer's own phones, setting off, other callers.filterWorktrees, and the existing renderer tests for the moved rule.pnpm tc, mobiletsc,check:code-quality:changed, oxlint and the mobile page-closure tests pass. The closure count did not move.Not verified on a physical phone or emulator. The phone side is covered by unit tests, and the end-to-end test runs the phone's own filter and status functions.
I manually tested these changes locally
Automated tests added/updated, or explained why not below
Review
An Opus bug review and an Opus design review were done before opening. A further review covered the simplification. The CodeRabbit thread about the unread-badge cache is answered: the cache compares every field the rule reads.
Agent skill upstream boundary
Notes
Checklist
N/Awith reasonpnpm lint,pnpm typecheck,pnpm test, andpnpm buildpass (or CI will cover; local preferred)