Repository navigation
feat(desktop): add "All devices" option to the Workspaces device filter - #6478
Conversation
The v2-workspaces device filter could only show one host at a time (this device or a specific remote). Add an "All devices" sentinel that runs the existing host fan-out in useHostWorkspacesSource, sharing query keys with HostWorkspacesProvider so nothing fetches twice, with PR chips, agent statuses, and board tombstones intact per host.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (5)
📝 WalkthroughWalkthroughAdds an “All devices” filter to the workspace header and trigger label. The filter store exports its identifier. Workspace loading uses an unscoped source and creates pull-request targets per host with visible rows. ChangesAll devices workspace filter
Estimated code review effort: 3 (Moderate) | ~20 minutes Merge Risk: ⚪ Minimal · up to This change adds an All devices filter option and its URL state while preserving the existing default behavior; no actionable merge-blocking risk remains after normal checks and review. Sequence Diagram(s)sequenceDiagram
participant User
participant V2WorkspacesHeader
participant v2WorkspacesFilterStore
participant useAccessibleV2Workspaces
participant HostWorkspaces
User->>V2WorkspacesHeader: Select All devices
V2WorkspacesHeader->>v2WorkspacesFilterStore: Read DEVICE_FILTER_ALL_DEVICES
V2WorkspacesHeader->>useAccessibleV2Workspaces: Apply device filter
useAccessibleV2Workspaces->>HostWorkspaces: Load unscoped workspaces
HostWorkspaces-->>useAccessibleV2Workspaces: Return host workspaces
useAccessibleV2Workspaces-->>User: Show workspaces from all devices
Possibly related PRs
Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
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. Comment |
🧹 Preview Cleanup CompleteThe following preview resources have been cleaned up:
Thank you for your contribution! 🎉 |
Summary
Why / Context
With workspaces spread across several hosts (laptop, dev boxes, sandboxes), there was no way to see everything in one view; you had to flip through hosts one by one.
How It Works
DEVICE_FILTER_ALL_DEVICES = "all-devices"sentinel inv2WorkspacesFilterStore, next to the existingthis-deviceone. Default andreset()still point at This device, and the choice round-trips through the URL as?device=all-deviceslike any other selection.useAccessibleV2WorkspacespassesundefinedtouseHostWorkspacesSource— that source's existing fan-out mode, which queries every known host and shares query keys with the always-runningHostWorkspacesProvider, so nothing fetches twice. Offline hosts contribute their last-seen cached rows, same as the sidebar.derivePullRequestQueryTargetsalready groups workspaces per host and skips offline hosts, and the archived queries iterate the same targets.DeviceFilterTriggerLabelrenders it instead of falling through to "Unknown device".Manual QA Checklist
Verified end-to-end over CDP against the dev app built from this branch (real clicks, signed-in session, screenshots captured at each step):
?device=all-devicesTesting
bun run typecheck(apps/desktop)biome checkon the touched directoryDesign Decisions
Summary by cubic
Adds an “All devices” option to the Workspaces device filter so users can view workspaces across all hosts. Previously the filter showed only one host; now “All devices” fans out across known hosts without duplicate fetching and preserves PR, agent status, and archived data.
DEVICE_FILTER_ALL_DEVICESin the v2 Workspaces filter store; selection round-trips as?device=all-devices. Default and reset remain “This device.”useAccessibleV2WorkspacespassesundefinedtouseHostWorkspacesSourceto invoke the existing fan-out, sharing query keys withHostWorkspacesProvider(no double fetch; offline hosts contribute cached rows).derivePullRequestQueryTargets; unscoped callers (palette/dev seeding) are unchanged.Written for commit 9fec14d. Summary will update on new commits.
Summary by CodeRabbit