Skip to content

feat(desktop): pin workspaces from the rail group menu - #678

Merged
huichen merged 1 commit into
mainfrom
feat/desktop-workspace-pin
Sep 17, 2026
Merged

huichen merged 1 commit into
mainfrom
feat/desktop-workspace-pin

Conversation

@huichen

@huichen huichen commented Sep 17, 2026

Copy link
Copy Markdown
Collaborator

What

The desktop already had the workspace pin data (workspaces.pinned, store::pin_workspace, the set_workspace_pinned remote command) but no surface for it — the flag could only be set from the phone. This wires the desktop up:

  • Backend: pin_workspace Tauri command (registered in the invoke handler).
  • Storage layer: pinWorkspace, and StoredWorkspace.pinned.
  • UI: the workspace group menu (⋯ on a group header) gains Pin / Unpin beside Rename, reusing the existing activityRail.pin / unpin strings; AppShell toggles and refreshes the store like a thread pin.
  • Ordering: the rail orders its workspace groups pinned-first, keeping the store’s recency order inside each half, and marks a pinned header with a Pin icon.

Why list_workspaces keeps its recency order

The new-conversation picker reads workspaces[0] as the most recently used workspace (useWorkspaceForm.cancel), so ordering by the pin flag belongs to the surfaces that render groups — this rail, and the phone’s workspace tab from the same column — rather than to the shared list contract.

The pin is not activity: last_opened_at / updated_at stay put, so unpinning returns a group to its recency position instead of jumping it to the front (locked by the existing store test).

Tests

  • Rust: workspace_commands_round_trip now pins and asserts the stored flag; GUI and headless (--no-default-features) clippy both pass with -D warnings; full suite 1275 lib + 1 bin + 5 integration tests.
  • Desktop TS: tsc --noEmit, eslint, and 128 vitest files / 1086 tests. New rail tests cover pinned-first ordering (marker and order, and the unpin fallback) and the group-menu Pin / Unpin path, plus a storage-layer assertion for the new command.
  • Docs: PRODUCT.md §5.2 (pinning + group menu) and ER.md §4.1 (field and semantics) in en + zh; the mobile README now states the rail orders by the same flag.

Not verified on a live desktop window: the change is a menu item, an icon and list order, all covered by DOM-level tests.

The desktop already held the workspace pin data (column, store call, remote
command) but had no surface for it: `workspaces.pinned` could only be set from
the phone. Wire the desktop up.

- `pin_workspace` Tauri command, plus `pinWorkspace` in the storage layer and
  `onTogglePinWorkspace` through AppShell (the same refresh shape as a thread
  pin).
- The workspace group menu gains Pin / Unpin beside rename, reusing the
  existing `activityRail.pin` / `unpin` strings.
- The rail orders its workspace groups pinned-first, keeping the store's
  recency order inside each half, and marks a pinned header with a Pin icon.

`list_workspaces` deliberately keeps its recency order: the new-conversation
picker reads `workspaces[0]` as the most recently used workspace, so ordering
belongs to the surfaces that show groups (this rail, and the phone's workspace
tab from the same column) rather than to the shared list contract.
@huichen
huichen enabled auto-merge (squash) September 17, 2026 02:41
@huichen
huichen merged commit 1fcae0b into main Sep 17, 2026
12 checks passed
@huichen
huichen deleted the feat/desktop-workspace-pin branch September 17, 2026 02:49
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