feat(sidebar): pin chats within projects#3913
Conversation
Persist pinned thread keys per logical project, keep pinned chats above the project's normal sort order, and separate pinned chats with a compact divider.
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Track row hover and focus directly instead of relying on nested group selectors, and hide row actions while a thread drag is active.
Render the pinned divider during active drags when all threads are in one group, allowing the first pin and last unpin gestures to cross a measurable boundary.
ApprovabilityVerdict: Needs human review This PR introduces a new feature allowing users to pin chats within projects via drag-and-drop and button controls, including new UI components, state persistence, and visual dividers. New user-facing features with this scope warrant human review. You can customize Macroscope's approvability policy. Learn more. |
Prevent drag activation from interactive controls, preserve mobile row metadata beside actions, and keep scoped active threads visible in collapsed previews.
Overlay the temporary divider when only pinned or unpinned threads exist so mounting it during a drag does not shift the active row.
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using high effort and found 3 potential issues.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 02c19ff. Configure here.

What Changed
Why
Important chats should stay easy to reach without being pinned globally across unrelated projects. Project-scoped pinning keeps each sidebar group predictable while preserving the existing thread sort order for unpinned chats.
The hover control provides a quick direct action, while divider-crossing drag behavior makes bulk sidebar organization feel natural.
UI Changes
Interaction demo:
Screen.Recording.2026-07-12.at.11.51.13.PM.mp4
Checklist
Note
Low Risk
Client-side UI and localStorage preferences only; no auth or server API changes. Drag-and-drop and row interaction tweaks could affect sidebar behavior on edge cases.
Overview
Adds project-scoped thread pinning persisted in
uiStateStoreaspinnedThreadKeysByProject, with pin/unpin from row actions and by dragging across a pinned divider.Pinned threads are lifted to the top of each project list via
prioritizeThreadsByPinnedKeyswhile keeping sort order within pinned and unpinned groups. The thread list splits into pinned and regular sections with a divider whose visibility and pin/unpin feedback come from new sidebar logic helpers.Thread rows gain hover/focus pin and archive controls (with metadata hidden on desktop when actions show), drag activation blocked on interactive elements, and
getVisibleThreadsForProjectnow accepts optional scoped thread keys for grouped projects.Reviewed by Cursor Bugbot for commit 3ad218d. Bugbot is set up for automated code reviews on this repo. Configure here.
Note
Add pinned chats within projects to the sidebar
SidebarPinnedDivider) between pinned and regular threads; dragging a thread across the divider pins or unpins it.pinnedThreadKeysByProjectto localStorage viauiStateStore, hydrating on load and scoping pins per project.shouldBlockThreadDragActivationto prevent drag initiation on interactive elements (inputs, buttons, links,contenteditable, ordata-thread-selection-safeelements).shouldHideThreadMetato conditionally hide thread row metadata based on archive confirmation state and device type.Macroscope summarized 3ad218d.