Repository navigation
fix(mobile): group by Project with the desktop sidebar's own code - #28850
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.
The project sections the desktop sidebar draws under Group by Project are built from the project/setup projection, the per-host catalog fold, the endpoint host stamp, and the section labelling and ordering rules. Move the pure parts of each into src/shared (no behaviour change) so the paired phone can call the same code instead of guessing the grouping.
The phone grouped Project sections by repo display name, so it merged checkouts the desktop keeps apart (several local stablyai/orca checkouts, or a server's copy) and split what the desktop merges. The phone now reads each host's repo.list, project.list and projectHostSetup.list (the desktop's own and each server's through the relay), folds them with the renderer's shared catalog fold and projection merge, and builds sections with the desktop's shared grouping, labelling and ordering code. Keys, labels and Recent order equal the sidebar's; a host that predates the project lists gets the repo-derived projection, as the desktop does. Header colour and icon come from the section's anchor repo and rows from their own repo by id, as on the desktop. The repo filter lists every catalog repo by id per host instead of merging same-named repos. Group-by labels read Project and None. project.list and projectHostSetup.list are routed for paired phones (read-only, workspace permission).
…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.
…ct-grouping-shared
…ct-grouping-shared
…the desktop's repo order Review fixes. The sidebar's buildOrderedGroups now calls the shared buildProjectSections for Group by Project (notice and pending repos are optional inputs), so desktop and phone run one function. The phone ranks manual header order by its folded catalog order, which is each host's repo.list order with the desktop's own repos first, as the renderer loads them; only the desktop's cross-host manualRepoOrder (pairing-local) is unknown to it. The projection selector is now a memo over the shared resolver. A transient project-list failure keeps that host's last catalog; only forbidden or method_not_found falls back to the repo-derived projection. Catalog rows are checked on every member grouping reads, and the parity test answers the renderer's real catalog fetch, includes a server's own project rows, and fixes Manual and Recent orders that differ.
… of the phone fetching it The phone fetched repo.list, project.list and projectHostSetup.list from the desktop and every relay-ready server each minute and folded them itself, so rows from offline or older servers fell back to repo sections and keys moved on cold start. The desktop renderer now publishes the inputs its own Project headers use (state.repos in sidebar order, the projection selector's projects and setups, projectOrderBy) on the runtime window graph it already sends to main, only when they change. Main keeps the last one and answers it on a new paired-desktop read, mobileRelay.projectSections. The phone reads it with its repo metadata and groups with the shared builder; a desktop that predates the read (forbidden or method_not_found) leaves the phone grouping rows by repo from the desktop's repo.list, and a transient failure keeps the last catalog. The payload carries only grouping and label fields, no hooks, credentials or uploaded icons. The phone's own catalog fetching and its project.list/projectHostSetup.list routes are removed.
… recorded repo-metadata flow The extra read inside the repo-metadata refresh stalled its recorded RPC sequence. It now runs beside it with its own throttle. The repo-metadata goldens are re-recorded for the intended state change: the name-keyed colour, icon and id maps became desktopRepos.
# Conflicts: # config/scripts/ci-shard-timings.json
…ng-shared # Conflicts: # config/scripts/ci-shard-timings.json # mobile/src/host-screen/host-workspace-list.tsx # src/renderer/src/i18n/en-runtime-required.json
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info
📝 Walkthrough
Priority: ⬇️ Low 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:
8eb94f41-734d-4f55-9f7e-be50b74f266d
⛔ Files ignored due to path filters: 1
src/shared/rpc-contract/rpc-params-catalog.generated.tsis excluded by!**/*.generated.*
📒 Files selected for processing: 105
config/scripts/ci-shard-timings.jsonmobile/rpc-foundation/goldens/matrix-settings.repo-metadata-host.platform-1.jsonmobile/rpc-foundation/goldens/matrix-settings.repo-metadata-repo.list-1.jsonmobile/rpc-foundation/goldens/matrix-settings.repo-metadata-settings.get-1.jsonmobile/rpc-foundation/goldens/matrix-settings.repo-metadata-ssh.listtargetsummaries-1.jsonmobile/rpc-foundation/goldens/schedules-settings-repo-metadata-fulfilled.jsonmobile/rpc-foundation/goldens/settings-repo-cache-expiry.jsonmobile/rpc-foundation/goldens/settings-repo-metadata-fulfilled.jsonmobile/rpc-foundation/goldens/settings-repo-metadata-icons.jsonmobile/rpc-foundation/goldens/settings-repo-metadata-refuse-after-data.jsonmobile/rpc-foundation/goldens/settings-repo-metadata-refused.jsonmobile/rpc-foundation/goldens/settings-repo-metadata-single-host.jsonmobile/rpc-foundation/goldens/settings-repo-metadata-transport-error.jsonmobile/src/host-screen/host-repo-looks.tsmobile/src/host-screen/host-screen-overlays.tsxmobile/src/host-screen/host-screen-reply-schema.tsmobile/src/host-screen/host-show-pinned-in-groups.test.tsmobile/src/host-screen/host-workspace-list-action-error.test.tsxmobile/src/host-screen/host-workspace-list-row-memo.test.tsxmobile/src/host-screen/host-workspace-list.tsxmobile/src/host-screen/use-host-project-sections.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/worktree/project-section-catalog.test.tsmobile/src/worktree/project-section-catalog.tsmobile/src/worktree/project-sections-operations.tsmobile/src/worktree/use-workspace-sections.tsmobile/src/worktree/workspace-filter-repos.test.tsmobile/src/worktree/workspace-filter-repos.tsmobile/src/worktree/workspace-list-picker-options.tsmobile/src/worktree/workspace-list-pinned-lineage.test.tsmobile/src/worktree/workspace-list-sections-desktop-parity.test.tsmobile/src/worktree/workspace-list-sections.test.tsmobile/src/worktree/workspace-list-sections.tsmobile/src/worktree/workspace-list-types.tsmobile/src/worktree/worktree-list-completeness.test.tssrc/main/ipc/runtime.test.tssrc/main/ipc/runtime.tssrc/main/runtime/mobile-project-sections-snapshot.tssrc/main/runtime/rpc/methods/index.tssrc/main/runtime/rpc/methods/mobile-project-sections.test.tssrc/main/runtime/rpc/methods/mobile-project-sections.tssrc/main/runtime/runtime-rpc/runtime-rpc-mobile-paired-desktop-methods.tssrc/renderer/src/app-shell/use-runtime-graph-sync.tssrc/renderer/src/components/cmd-j/palette-filter-options.tssrc/renderer/src/components/cmd-j/palette-project-results.tssrc/renderer/src/components/repo/NestedRepoChecklist.tsxsrc/renderer/src/components/settings/settings-project-list.tssrc/renderer/src/components/settings/settings-project-regrouping.test.tssrc/renderer/src/components/sidebar/project-header-drag-commit.tssrc/renderer/src/components/sidebar/project-header-drop.test.tssrc/renderer/src/components/sidebar/project-header-drop.tssrc/renderer/src/components/sidebar/rendered-sidebar-worktree-order.tssrc/renderer/src/components/sidebar/worktree-list-groups-mobile-parity.test.tssrc/renderer/src/components/sidebar/worktree-list-groups-notice-host-labels.test.tssrc/renderer/src/components/sidebar/worktree-list/grouping/build-rows.tssrc/renderer/src/components/sidebar/worktree-list/grouping/group-sections.tssrc/renderer/src/components/sidebar/worktree-list/grouping/host-labels.tssrc/renderer/src/components/sidebar/worktree-list/grouping/project-group-sections.tssrc/renderer/src/components/sidebar/worktree-list/grouping/project-grouping.tssrc/renderer/src/components/sidebar/worktree-list/grouping/recent-project-rank-scan-budget.test.tssrc/renderer/src/components/sidebar/worktree-list/grouping/section-order.tssrc/renderer/src/components/sidebar/worktree-list/grouping/worktree-group-entry.tssrc/renderer/src/components/sidebar/worktree-list/grouping/worktree-group-keys.tssrc/renderer/src/components/sidebar/worktree-list/grouping/worktree-grouping.tssrc/renderer/src/components/sidebar/worktree-list/listing/use-collapsed-groups.tssrc/renderer/src/components/sidebar/worktree-list/listing/use-section-rows.tssrc/renderer/src/components/sidebar/worktree-list/navigation/pending-reveal-inputs.tssrc/renderer/src/components/sidebar/worktree-list/navigation/reveal-ancestors.tssrc/renderer/src/components/sidebar/worktree-list/navigation/worktree-reveal-group-keys.tssrc/renderer/src/components/sidebar/worktree-list/viewport/viewport-props.tssrc/renderer/src/hooks/settings-navigation-build-options.tssrc/renderer/src/hooks/useSettingsNavigationMetadata.tssrc/renderer/src/runtime/sync-runtime-graph-project-sections.test.tssrc/renderer/src/runtime/sync-runtime-graph/graph-publication.tssrc/renderer/src/runtime/sync-runtime-graph/graph-state.tssrc/renderer/src/runtime/sync-runtime-graph/project-section-catalog.tssrc/renderer/src/store/adopt-from-endpoint.tssrc/renderer/src/store/github/work-item-fetch-actions.tssrc/renderer/src/store/project-host-setup-selector-normalization.tssrc/renderer/src/store/project-host-setup-selector.tssrc/renderer/src/store/projects/project-host-routing.tssrc/renderer/src/store/projects/project-update.tssrc/renderer/src/store/repos/all-host-repo-catalog-actions.tssrc/renderer/src/store/repos/repo-catalog-actions.tssrc/renderer/src/store/repos/repo-catalog-identity.tssrc/renderer/src/store/repos/repo-catalog-merge.tssrc/renderer/src/store/repos/runtime-repo-catalog-actions.tssrc/renderer/src/store/slices/repo-identity-reconcile.tssrc/renderer/src/store/slices/runtime-status.tssrc/shared/catalog-row-reconcile.tssrc/shared/endpoint-catalog-adoption.tssrc/shared/mobile-project-sections-contract.tssrc/shared/project-compatibility-host-merge.tssrc/shared/project-compatibility-merge.tssrc/shared/project-host-setup-hydration.tssrc/shared/project-section-grouping.tssrc/shared/project-section-order.tssrc/shared/project-section-parity.test-fixture.tssrc/shared/repo-display-labels.test.tssrc/shared/repo-display-labels.tssrc/shared/runtime-session-contracts.tstests/e2e/paired-mobile-desktop-mirror-workspace-visibility.spec.ts
💤 Files with no reviewable changes: 4
- src/renderer/src/components/sidebar/project-header-drop.ts
- src/renderer/src/store/project-host-setup-selector-normalization.ts
- src/renderer/src/components/sidebar/worktree-list/grouping/project-grouping.ts
- src/renderer/src/store/repos/repo-catalog-merge.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.
…to another host The refresh window is now kept per client, so a host screen reused for another desktop doesn't wait out the previous host's 60s window before showing its Project headers.
Upstream renamed runtimeTargetForOwnerHostId to ipcOrRuntimeTargetForHostId and dropped the RuntimeClientTarget re-export (stablyai#27992), so createProjectGroup and the shared createOnTarget helper use the new name and import the type from shared. ProjectGroupingModel moved to shared/project-section-grouping (stablyai#28850). Locale conflicts were sibling additions; both sides are kept.
Stacked on #28819. Review that PR first; this diff is against its branch.
ELI5
With "Group by Project" on, the phone should show the project sections the desktop sidebar shows. It didn't. The phone grouped by repo name, so "orca" on the desktop, on windows 2 and on m4 air collapsed into one section, while the desktop showed "jinwoo/stably/orca" and "m4air/orca/orca" separately.
Now the desktop hands the phone the data its sidebar groups with, and both run the same grouping function.
What Changed
Before: the phone grouped workspaces by repo display name. Its section keys came from a map of only the desktop's own repos, and server repos borrowed the desktop repo's colour and icon.
After:
Shared code: the desktop's Project grouping code moves to
src/sharedwith no change to the desktop sidebar:project-section-grouping.ts: project keys,getProjectGroupingForRepo, and thebuildProjectSectionsbuilderproject-section-order.ts: path-suffix labels, Manual or Recent orderrepo-display-labels.tsThe desktop sidebar's Group by Project step (
buildOrderedGroups) now callsbuildProjectSections, so desktop and phone run one function. Existing desktop grouping tests pass with unchanged bodies.The desktop serves its catalog:
runtime:syncWindowGraph. That snapshot now carries one optional extra field: the repos the sidebar groups (in sidebar order), the projects and host setups it groups them by, and the header order setting.mobileRelay.projectSections.The payload:
repo.listfor the desktop's own repos.The phone:
buildProjectSections.Smaller fixes:
Why
Guessing the desktop's grouping on the phone was already wrong once: an earlier attempt split projects by host, but the desktop merges a project across hosts unless one host has several checkouts of it. Having the desktop serve exactly what its sidebar groups with, and running the same function, keeps the two from drifting.
An earlier version of this PR had the phone fetch each host's project lists itself. That cost three requests per host per minute. It also failed for servers the phone could not reach and regrouped on cold start, so it was replaced.
Older versions:
forbiddenormethod_not_found, and the phone groups by repo from the desktop'srepo.list, as before.Decision for Jinwoo
The repos the desktop sends are in the sidebar's final order, which already includes the desktop's manual drag order across hosts (
manualRepoOrder). So the phone now shows the desktop's manual Project order across hosts too. Paired desktops still do not receive that setting; that policy is unchanged. If the phone should not get the cross-host order, the desktop can send repos in their per-host order instead.Limits
projectGroup.list) are not yet mirrored on the phone.Linked Issue
None. Internal parity fix for the phone-mirrors-desktop project.
Visual Proof
Not captured on a device. The parity test below renders the desktop's section rows and the phone's sections from the same data and compares their keys, labels and order.
Visual proof (combined build)
One build of this branch at
3a59465(this PR stacked on #28819), on an Android emulator paired with a desktop that is a client of one testorca serveserver. The desktop, the server and the phone's page bundle all come from that commit. The phone list is the desktop-served page: the footer on each phone shot readsf6362a34eed1, the buildId of this commit'sout/mobile-web. #28824's row fixes are not in this build (it merged after #28819's base), so the cut-off host badge on the long row below is expected here.Fixture: the server holds
from-server(created on the server itself),from-desktop(created by the desktop),from-phone(created in the phone's Create worktree sheet, through the desktop), and a long-named desktop workspace. The desktop also has a local repo with the same name,orca. On the desktop: Group by Project, Hide other-client workspaces on, Hide sleeping on (with its default Except default branch).1. Workspace list and project grouping. Left: desktop sidebar. Right: the phone, at the same moment. Both show the desktop's and the phone's server workspaces and hide
from-server, which the server does have. Both show two separate headers for the twoorcarepos, with the desktop's labelsd/home/repos/orca(local) ands/home/repos/orca(server), and the same rows in the same order.2. Group-by picker and project filter. Left: the desktop's Workspace options with its Projects filter open. Middle: the phone's Group By sheet reads None / Status / Project / PR Status. Right: the phone's Filter sheet lists one entry per host and repo (two
orcarows), as the desktop's Projects filter does, and shows Hide sleeping on, synced from the desktop.3. Opening a server workspace. Tapping
from-desktopon the phone, frames from a screen recording: Checking host, then Opening workspace (about 6 seconds on this first open), then the Terminal tab, then the shell prompt. "No tabs in this session" did not appear at any point.Recording of the same open:
3-open-server-workspace.mp4
Seen while capturing, not changed by this PR: the toolbar chip on the phone still reads "Repo" while the picker says "Project", and the phone's Filter sheet titles the project list "Repositories" where the desktop says "Projects". Both project filters show the two
orcarepos without a host label, so they can't be told apart in either app.Testing
Parity test. The fixture has Jinwoo's shape: several local checkouts of stablyai/orca, plus server repos of the same project on windows 2 and m4 air.
buildRows. Windows 2 answers with its own project rows; m4 air answersmethod_not_found.buildSections.Other unit tests. Covered:
forbiddenormethod_not_found, and a timeout;End-to-end.
paired-mobile-desktop-mirror-workspace-visibility.spec.tsnow also checks that a real desktop window serves a catalog containing the server's repo, under that server's host id. It passes, along withpaired-mobile-desktop-mirror.spec.ts.Gates.
pnpm tc, mobiletsc,check:code-quality:changed, oxlint andverify:rpc-params-catalogpass.Not covered. Not checked on a physical phone or emulator.
I manually tested these changes locally
Automated tests added/updated, or explained why not below
Review
Opus bug and design reviews were done on each round, including the move to a desktop-served catalog. That review found nothing blocking. Its one regression, uploaded repo icons, is fixed.
Agent skill upstream boundary
Notes
Checklist
N/Awith reasonpnpm lint,pnpm typecheck,pnpm test, andpnpm buildpass (or CI will cover; local preferred)