Skip to content

Keep pinned conversations in the sidebar's Recent list - #1027

Open
Flyneen wants to merge 1 commit into
spacering-net:mainfrom
Flyneen:fix/recent-keeps-pinned
Open

Flyneen wants to merge 1 commit into
spacering-net:mainfrom
Flyneen:fix/recent-keeps-pinned

Conversation

@Flyneen

@Flyneen Flyneen commented Oct 24, 2026

Copy link
Copy Markdown
Contributor

What was wrong

Pinning a conversation removed it from the Recent list entirely. selectRecentConversationsWithReuse skipped every row with a pinned_at, so bookmarking something made it vanish from the one list the user scans by time.

Pinning is a bookmark that lifts a row into the top section — it is not a statement that the conversation stopped being recent. The user's expectation is that the pinned row is also still where they left it in the timeline.

The change

  • Recent now includes pinned rows, ordered with everything else by last activity.
  • A pinned row also bypasses the "Show completed" and closed-folder gates, matching the Pinned section's own reachability rule: the two sections must never disagree about a row the user deliberately kept.
  • The duplicated row is the existing, intended shape. A conversation already appears under its folder (or in Chat) and again in Recent; the Pinned section is one more copy. The recent- row-key prefix already keeps the React keys distinct, and flatIndexOfConversation already prefers the canonical (Pinned/folder/Chat) row, so "scroll to the active conversation" still lands in the right place.

Tests

  • selectRecentConversationsWithReuse: a pinned row stays in the bucket (and is ordered by activity with its neighbours), including when its folder is closed, and when it is completed while completed rows are hidden.
  • SidebarConversationList: a pinned conversation renders under both Pinned and Recent.

pnpm test: 10560 passed. The single failure in that full run (a recharts bar render) is an unrelated flake — the file passes on its own. tsc --noEmit and eslint on the touched files are clean.

Built on top of the merged #1010 (Recent ordered by last activity).

Pinning a conversation removed it from Recent entirely: the selector
skipped every row with a `pinned_at`. Pinning is a bookmark that lifts a
row into the top section, not a statement that it stopped being recent, so
the row vanished from the one list the user scans by time.

Recent now includes pinned rows, ordered with everything else by last
activity. A pinned row also bypasses the "Show completed" and closed-folder
gates, matching the Pinned section's own reachability rule — the two
sections must never disagree about a row the user deliberately kept.

The duplicated row is the existing, intended shape: a conversation already
appears under its folder (or in Chat) and again in Recent. The Pinned
section is one more copy, and the `recent-` row-key prefix already keeps
the two React keys distinct, so `flatIndexOfConversation` still prefers the
canonical row.

Agent: opencode
Session-Id: 45868-2cf53768
Working-Dir: D:\dev\codeg-recent-sort
Generated-By: AI-assisted
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