Skip to content

fix(desktop,mobile): keep pinned conversations out of batch selection - #691

Merged
huichen merged 1 commit into
mainfrom
fix/pinned-batch-selection
Sep 17, 2026
Merged

huichen merged 1 commit into
mainfrom
fix/pinned-batch-selection

Conversation

@huichen

@huichen huichen commented Sep 17, 2026

Copy link
Copy Markdown
Collaborator

Problem

Pinned conversations are hoisted into a global pinned section, outside every workspace/chat group. Batch selection still reached them anyway:

  • Desktop rail: useRailSelection scoped threads by threadScopes alone, and a pinned thread keeps its group's scope, so "select all" in a chat or workspace group included the pinned rows — which are not even rendered in that group.
  • Phone: "全选当前可见" iterated every visible row, and the workspace menu's "全选该工作区的会话" filtered by workspace without looking at pins, so both swept up the pinned shortcuts promoted above the groups.

Clearing a group could therefore delete a conversation the user deliberately pinned.

Change

A pinned conversation is never part of a batch, on either surface:

  • Desktop (useRailSelection): scopedThreads and isThreadInScope skip pinned threads, so a pinned row carries no checkbox, its row cannot toggle it, and select-all/delete ignore it.
  • Mobile (SessionList): pinned rows render the checkbox column's width as a spacer (no box) so the shortcut's title stays on the same column as the group rows; the row press and select-all ("select visible" and "select all sessions in this workspace") skip them. The workspace header still counts the pin itself.
  • docs/internals/desktop/PRODUCT.md / PRODUCT.zh-CN.md: the batch-selection rule now states pinned conversations are excluded.

Tests

  • useRailSelection.test.ts: new case — a pinned thread stays out of selectAll/deleteSelected and has no scope.
  • mobile/SessionList.test.ts: new chat-tab case ("select visible skips pinned chats"); the promoted-pin workspace case now asserts the shortcut is left out of the workspace batch while the pinned session stays visible/openable.
  • Full desktop suite (1134 tests) and mobile suite (only the pre-existing MarkdownText module-identity case fails locally in this worktree because a symlinked node_modules resolves @future-os/markdown to a second copy; it passes in the main checkout) run green; tsc/eslint clean on both sides.

Pinned conversations are hoisted into a global pinned section, outside every
workspace/chat group, but batch selection still reached them: the desktop
rail's scoped select-all and the phone's "select visible" / "select all
sessions in this workspace" swept pinned rows up, so clearing a group could
delete a conversation the user pinned on purpose.

A pinned conversation is now never part of a batch on either surface: it
carries no checkbox while selection mode is open, its row cannot toggle it,
and select-all skips it (the phone keeps the checkbox column's width as a
spacer so pinned shortcuts stay aligned with the group rows).
@huichen
huichen enabled auto-merge (squash) September 17, 2026 04:45
@huichen
huichen merged commit 3857369 into main Sep 17, 2026
12 checks passed
@huichen
huichen deleted the fix/pinned-batch-selection branch September 17, 2026 04:47
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