Repository navigation
fix(desktop,mobile): keep pinned conversations out of batch selection - #691
Merged
Merged
Conversation
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).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Pinned conversations are hoisted into a global pinned section, outside every workspace/chat group. Batch selection still reached them anyway:
useRailSelectionscoped threads bythreadScopesalone, 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.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:
useRailSelection):scopedThreadsandisThreadInScopeskip pinned threads, so a pinned row carries no checkbox, its row cannot toggle it, and select-all/delete ignore it.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 ofselectAll/deleteSelectedand 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.MarkdownTextmodule-identity case fails locally in this worktree because a symlinkednode_modulesresolves@future-os/markdownto a second copy; it passes in the main checkout) run green;tsc/eslintclean on both sides.