Skip to content

feat(desktop): default v2 workspaces to all devices, sort by host then created#3928

Merged
saddlepaddle merged 1 commit intomainfrom
all-devices-sort-created
Apr 30, 2026
Merged

feat(desktop): default v2 workspaces to all devices, sort by host then created#3928
saddlepaddle merged 1 commit intomainfrom
all-devices-sort-created

Conversation

@saddlepaddle
Copy link
Copy Markdown
Collaborator

@saddlepaddle saddlepaddle commented Apr 30, 2026

Summary

  • Default device filter is now All devices (was "This device") so cross-device workspaces are visible up-front
  • Default sort is host asc (current device first, remote hosts after) with createdAt desc as the natural tiebreak from compareWorkspaces
  • Main workspaces now show the same CgLaptop icon used in the sidebar next to their name, with a "Main workspace" tooltip

Test plan

  • Open v2 workspaces — list shows workspaces from all devices grouped by project, with local-device rows above remote rows within each project
  • Within a host, rows are ordered newest createdAt first
  • Main workspaces render with the laptop icon + tooltip; worktree workspaces do not
  • Clicking the device filter still works; resetting filters returns to "All devices"

Summary by CodeRabbit

  • New Features

    • Added a visual indicator icon to main workspaces in the workspace list, helping users identify them at a glance.
  • Updates

    • Default workspace sorting changed from creation date to host for improved organization.
    • Device filter now defaults to displaying all devices instead of limiting to the current device.

…n created

- Default device filter is now "All devices" (was "This device")
- Default sort is host asc (local device first), createdAt desc as tiebreak
- Show CgLaptop icon next to main workspace names, matching sidebar
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Apr 30, 2026

📝 Walkthrough

Walkthrough

The changes modify the V2 workspaces feature to alter default sorting behavior from created (descending) to host (ascending), introduce a main workspace visual indicator icon in workspace rows, and update the default device filter from THIS_DEVICE to ALL across the filtering store.

Changes

Cohort / File(s) Summary
Workspace List & Filter Store Defaults
apps/desktop/src/renderer/.../V2WorkspacesList/V2WorkspacesList.tsx, apps/desktop/src/renderer/.../v2WorkspacesFilterStore.ts
Changed default sort from created (descending) to host (ascending); updated active filter logic to compare against DEVICE_FILTER_ALL instead of DEVICE_FILTER_THIS_DEVICE for determining non-default filters and empty-state messaging.
Workspace Row Display
apps/desktop/src/renderer/.../V2WorkspaceRow/V2WorkspaceRow.tsx
Added conditional rendering of laptop icon indicator with tooltip for main workspaces in the row's left content area.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

🐰 Sorted hosts now lead the way,
Main workspace badges on display,
Device filters shift their stand,
Configuration tweaks so grand,
V2 workspaces dance today! ✨

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The pull request title accurately and concisely summarizes the main changes: defaulting v2 workspaces to all devices and sorting by host then created.
Description check ✅ Passed The pull request description provides a clear summary of changes, includes a test plan with checkboxes, but is missing the standard template sections (Related Issues, Type of Change, Testing, Screenshots, Additional Notes).
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
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.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch all-devices-sort-created

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
Review rate limit: 7/8 reviews remaining, refill in 7 minutes and 30 seconds.

Comment @coderabbitai help to get the list of available commands and usage tips.

@greptile-apps
Copy link
Copy Markdown

greptile-apps Bot commented Apr 30, 2026

Greptile Summary

This PR updates v2 workspaces to default the device filter to All devices (previously "This device"), changes the default sort to host asc (local device first, then alphabetical by hostname, newest-first as a tiebreak), and adds a CgLaptop icon with a "Main workspace" tooltip to main workspace rows. The filter store's reset() is also updated to restore the new "All devices" default, and hasActiveFilters is correctly rebased against DEVICE_FILTER_ALL.

Confidence Score: 5/5

Safe to merge — all logic changes are correct and well-scoped, with only a minor keyboard-accessibility gap in the new tooltip.

All findings are P2 style/accessibility suggestions. The sort tiebreak (b.createdAt - a.createdAt before the direction flip) correctly produces newest-first within a host when direction is asc, matching the stated test plan. Filter defaults, reset logic, and hasActiveFilters baseline are all consistently updated.

V2WorkspaceRow.tsx — minor keyboard-accessibility improvement on the CgLaptop tooltip trigger.

Important Files Changed

Filename Overview
apps/desktop/src/renderer/routes/_authenticated/_dashboard/v2-workspaces/components/V2WorkspacesList/V2WorkspacesList.tsx Changed default sort from created/desc to host/asc and updated the hasActiveFilters baseline to DEVICE_FILTER_ALL. Logic is correct — compareWorkspaces with host/asc produces local-device first, then alphabetical hostname, then newest-first tiebreak.
apps/desktop/src/renderer/routes/_authenticated/_dashboard/v2-workspaces/components/V2WorkspacesList/components/V2WorkspaceRow/V2WorkspaceRow.tsx Added CgLaptop icon with tooltip for main workspaces. Icon is not keyboard-focusable (no tabIndex), so tooltip is hover-only; aria-label partially mitigates accessibility gap.
apps/desktop/src/renderer/routes/_authenticated/_dashboard/v2-workspaces/stores/v2WorkspacesFilterStore/v2WorkspacesFilterStore.ts Initial and reset deviceFilter changed from DEVICE_FILTER_THIS_DEVICE to DEVICE_FILTER_ALL. Consistent and correct change.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A[V2WorkspacesList mounts] --> B[sortField='host', sortDirection='asc']
    A --> C[deviceFilter='all' from store]
    B & C --> D[groupByProject]
    D --> E[compareWorkspaces per project]
    E --> F{Sort field?}
    F -->|host| G[hostTypeRank: local=0, remote=1]
    G --> H{Tie?}
    H -->|no| I[Apply direction]
    H -->|yes| J[localeCompare hostName]
    J --> K{Tie?}
    K -->|no| I
    K -->|yes| L[tiebreak: b.createdAt - a.createdAt]
    L --> I
    I --> M[Sorted workspaces per project]
    M --> N[Projects sorted by latestCreatedAt desc]
    N --> O[Render rows]
    O --> P{isMainWorkspace?}
    P -->|yes| Q[CgLaptop icon + tooltip]
    P -->|no| R[Name only]
Loading
Prompt To Fix All With AI
Fix the following 1 code review issue. Work through them one at a time, proposing concise fixes.

---

### Issue 1 of 1
apps/desktop/src/renderer/routes/_authenticated/_dashboard/v2-workspaces/components/V2WorkspacesList/components/V2WorkspaceRow/V2WorkspaceRow.tsx:214-224
**Tooltip not keyboard-accessible**

`CgLaptop` is a bare SVG with no `tabIndex`, so keyboard users can never focus it to trigger the tooltip. The `aria-label="Main workspace"` on the SVG does expose the information to screen readers, but interactive tooltip hover-on-focus is lost. Adding a `tabIndex={0}` to the element (or wrapping it in a focusable `<span>`) would allow keyboard users to access the tooltip as well.

```suggestion
<CgLaptop
							tabIndex={0}
							className="size-3.5 shrink-0 text-muted-foreground"
							aria-label="Main workspace"
						/>
```

Reviews (1): Last reviewed commit: "feat(desktop): default v2 workspaces to ..." | Re-trigger Greptile

Comment on lines 214 to +224

<span className="flex min-w-0 items-center gap-2">
{isMainWorkspace ? (
<Tooltip delayDuration={300}>
<TooltipTrigger asChild>
<CgLaptop
className="size-3.5 shrink-0 text-muted-foreground"
aria-label="Main workspace"
/>
</TooltipTrigger>
<TooltipContent side="top">Main workspace</TooltipContent>
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Tooltip not keyboard-accessible

CgLaptop is a bare SVG with no tabIndex, so keyboard users can never focus it to trigger the tooltip. The aria-label="Main workspace" on the SVG does expose the information to screen readers, but interactive tooltip hover-on-focus is lost. Adding a tabIndex={0} to the element (or wrapping it in a focusable <span>) would allow keyboard users to access the tooltip as well.

Suggested change
<span className="flex min-w-0 items-center gap-2">
{isMainWorkspace ? (
<Tooltip delayDuration={300}>
<TooltipTrigger asChild>
<CgLaptop
className="size-3.5 shrink-0 text-muted-foreground"
aria-label="Main workspace"
/>
</TooltipTrigger>
<TooltipContent side="top">Main workspace</TooltipContent>
<CgLaptop
tabIndex={0}
className="size-3.5 shrink-0 text-muted-foreground"
aria-label="Main workspace"
/>
Prompt To Fix With AI
This is a comment left during a code review.
Path: apps/desktop/src/renderer/routes/_authenticated/_dashboard/v2-workspaces/components/V2WorkspacesList/components/V2WorkspaceRow/V2WorkspaceRow.tsx
Line: 214-224

Comment:
**Tooltip not keyboard-accessible**

`CgLaptop` is a bare SVG with no `tabIndex`, so keyboard users can never focus it to trigger the tooltip. The `aria-label="Main workspace"` on the SVG does expose the information to screen readers, but interactive tooltip hover-on-focus is lost. Adding a `tabIndex={0}` to the element (or wrapping it in a focusable `<span>`) would allow keyboard users to access the tooltip as well.

```suggestion
<CgLaptop
							tabIndex={0}
							className="size-3.5 shrink-0 text-muted-foreground"
							aria-label="Main workspace"
						/>
```

How can I resolve this? If you propose a fix, please make it concise.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Apr 30, 2026

🧹 Preview Cleanup Complete

The following preview resources have been cleaned up:

  • ✅ Neon database branch

Thank you for your contribution! 🎉

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In
`@apps/desktop/src/renderer/routes/_authenticated/_dashboard/v2-workspaces/components/V2WorkspacesList/V2WorkspacesList.tsx`:
- Around line 166-169: The empty-state message in V2WorkspacesList is still
instructing users only to clear the device filter even though hasActiveFilters
(derived from searchQuery, deviceFilter vs DEVICE_FILTER_ALL, and projectFilter
vs PROJECT_FILTER_ALL) now includes search and project filters; update the
empty-state copy to reference clearing filters more generally (e.g., “clear
filters or search terms”) or dynamically mention which filter is active so users
know to clear the device, project, or search query as appropriate; adjust the
text displayed where the empty-state is rendered in V2WorkspacesList to use the
broader copy or to inspect deviceFilter, projectFilter, and searchQuery to
tailor the suggestion.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 9d57b406-4b57-4daf-a56c-47c1f80a4607

📥 Commits

Reviewing files that changed from the base of the PR and between b6ab7e9 and 534b070.

⛔ Files ignored due to path filters (1)
  • bun.lock is excluded by !**/*.lock
📒 Files selected for processing (3)
  • apps/desktop/src/renderer/routes/_authenticated/_dashboard/v2-workspaces/components/V2WorkspacesList/V2WorkspacesList.tsx
  • apps/desktop/src/renderer/routes/_authenticated/_dashboard/v2-workspaces/components/V2WorkspacesList/components/V2WorkspaceRow/V2WorkspaceRow.tsx
  • apps/desktop/src/renderer/routes/_authenticated/_dashboard/v2-workspaces/stores/v2WorkspacesFilterStore/v2WorkspacesFilterStore.ts

Comment on lines 166 to 169
const hasActiveFilters =
searchQuery.trim() !== "" ||
deviceFilter !== DEVICE_FILTER_THIS_DEVICE ||
deviceFilter !== DEVICE_FILTER_ALL ||
projectFilter !== PROJECT_FILTER_ALL;
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.

⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Broaden the empty-state guidance.

hasActiveFilters now covers search, device, and project filters, but the empty-state copy still tells users to clear only the device filter. When the project filter is what excludes results, this points them at the wrong control.

Suggested copy tweak
- "Try a different search term or clear the device filter."
+ "Try a different search term or clear the filters."
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In
`@apps/desktop/src/renderer/routes/_authenticated/_dashboard/v2-workspaces/components/V2WorkspacesList/V2WorkspacesList.tsx`
around lines 166 - 169, The empty-state message in V2WorkspacesList is still
instructing users only to clear the device filter even though hasActiveFilters
(derived from searchQuery, deviceFilter vs DEVICE_FILTER_ALL, and projectFilter
vs PROJECT_FILTER_ALL) now includes search and project filters; update the
empty-state copy to reference clearing filters more generally (e.g., “clear
filters or search terms”) or dynamically mention which filter is active so users
know to clear the device, project, or search query as appropriate; adjust the
text displayed where the empty-state is rendered in V2WorkspacesList to use the
broader copy or to inspect deviceFilter, projectFilter, and searchQuery to
tailor the suggestion.

@saddlepaddle saddlepaddle merged commit 9b42474 into main Apr 30, 2026
15 checks passed
@Kitenite Kitenite deleted the all-devices-sort-created branch May 6, 2026 04:51
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