Skip to content

feat(mobile): pin workspaces above the unpinned groups - #674

Merged
huichen merged 2 commits into
mainfrom
feat/workspace-pin
Sep 16, 2026
Merged

huichen merged 2 commits into
mainfrom
feat/workspace-pin

Conversation

@huichen

@huichen huichen commented Sep 16, 2026

Copy link
Copy Markdown
Collaborator

What

The mobile workspace tab can now pin a workspace group, not just a conversation.

  • Ordering (the requested rule): pinned conversations (already promoted) → pinned workspaces → every other group, with the desktop's recency order kept inside each half.
  • Entry point: the workspace group menu (⋯) gains pin / unpin; a pinned group's header shows the same pin marker a pinned conversation does.
  • The pin is durable, not phone-local: the desktop store gains workspaces.pinned (pin_workspace + the set_workspace_pinned remote command, published to the phone in the existing versioned workspace snapshot), so it survives a re-pair and re-install.
  • Pinning never stamps updated_at/last_opened_at (same rule as pin_thread), so unpinning drops the group back to its recency position instead of jumping it to the front.

Migration

v1.1.9-workspaces-pinned adds ALTER TABLE workspaces ADD COLUMN pinned INTEGER NOT NULL DEFAULT 0 (plus the column in SCHEMA for fresh installs), with an upgrade + fresh-database test in store::db::tests.

Scope

The desktop rail and the new-conversation picker keep the store's recency order for now, so nothing changes on the desktop until ordering groups by the flag is added there too — the column and command are already in place for that follow-up.

Tests

  • Rust (desktop/src-tauri): cargo fmt --check, cargo clippy --all-targets -- -D warnings, cargo test on the pinned 1.97.0 toolchain — 1268 lib + 1 bin + 5 integration tests pass; new coverage for the migration, pin_workspace, and the remote command (missing id / success / unknown workspace).
  • Mobile: tsc --noEmit, eslint, jest --runInBand (105 suites / 1475 tests) with new cases for the catalog order, the group menu, and the pin command.

The workspace tab could only pin conversations. A workspace group is the same
kind of ordering shortcut, so it is now pinnable from its group menu (pin
marker on the header, unpin to restore): a pinned group sits below the pinned
conversations and above every unpinned group, keeping the desktop's recency
order inside each half.

The pin is durable state rather than phone-local view state: the desktop store
gains `workspaces.pinned` (versioned migration `v1.1.9-workspaces-pinned`, plus
`pin_workspace` and `set_workspace_pinned`), and it reaches the phone in the
existing versioned workspace snapshot, so a pin survives a re-pair. Pinning
leaves `last_opened_at`/`updated_at` alone, so unpinning drops the group back to
its recency position instead of jumping it to the front.

The desktop rail and the new-conversation picker keep reading the store's
recency order for now (ordering groups by the flag there is a follow-up).
@huichen
huichen enabled auto-merge (squash) September 16, 2026 16:09
@huichen
huichen merged commit b85d122 into main Sep 16, 2026
12 checks passed
@huichen
huichen deleted the feat/workspace-pin branch September 16, 2026 16:25
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