Skip to content

feat(sidebar): pin chats within projects#3913

Open
12ya wants to merge 13 commits into
pingdotgg:mainfrom
12ya:main
Open

feat(sidebar): pin chats within projects#3913
12ya wants to merge 13 commits into
pingdotgg:mainfrom
12ya:main

Conversation

@12ya

@12ya 12ya commented Jul 12, 2026

Copy link
Copy Markdown

What Changed

  • Persist pinned chat state per logical project.
  • Keep pinned chats above the normal thread sort order for each project.
  • Add hover pin and unpin controls without consuming title space.
  • Support pinning and unpinning by dragging a chat across the pinned divider.
  • Show a compact divider with a centered pin icon and distinct pin/unpin feedback colors.
  • Animate chats moving between pinned and regular sections.

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

  • This PR is small and focused
  • I explained what changed and why
  • I included before/after screenshots for any UI changes
  • I included a video for animation/interaction changes

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 uiStateStore as pinnedThreadKeysByProject, 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 prioritizeThreadsByPinnedKeys while 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 getVisibleThreadsForProject now 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

  • Adds a pin/unpin button to each thread row in the sidebar project list, with pinned threads sorted to the top of each project.
  • Introduces drag-and-drop reordering across a visual divider (SidebarPinnedDivider) between pinned and regular threads; dragging a thread across the divider pins or unpins it.
  • Persists pinnedThreadKeysByProject to localStorage via uiStateStore, hydrating on load and scoping pins per project.
  • Adds shouldBlockThreadDragActivation to prevent drag initiation on interactive elements (inputs, buttons, links, contenteditable, or data-thread-selection-safe elements).
  • Adds shouldHideThreadMeta to conditionally hide thread row metadata based on archive confirmation state and device type.

Macroscope summarized 3ad218d.

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.
@coderabbitai

coderabbitai Bot commented Jul 12, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: ac826ef2-4863-44db-8585-7e63acab06f9

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@github-actions github-actions Bot added size:L 100-499 changed lines (additions + deletions). vouch:unvouched PR author is not yet trusted in the VOUCHED list. labels Jul 12, 2026
Comment thread apps/web/src/components/Sidebar.tsx
12ya added 2 commits July 13, 2026 09:32
Track row hover and focus directly instead of relying on nested group selectors, and hide row actions while a thread drag is active.
@12ya 12ya marked this pull request as ready for review July 13, 2026 00:36
Comment thread apps/web/src/components/Sidebar.tsx
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.
Comment thread apps/web/src/components/Sidebar.tsx
Comment thread apps/web/src/components/Sidebar.tsx
Comment thread apps/web/src/components/Sidebar.tsx
@macroscopeapp

macroscopeapp Bot commented Jul 13, 2026

Copy link
Copy Markdown
Contributor

Approvability

Verdict: 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.

Comment thread apps/web/src/components/Sidebar.tsx Outdated
12ya added 2 commits July 13, 2026 09:49
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.

@cursor cursor Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes using high effort and found 3 potential issues.

Fix All in Cursor

❌ 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.

Comment thread apps/web/src/components/Sidebar.tsx
Comment thread apps/web/src/components/Sidebar.tsx Outdated
Comment thread apps/web/src/components/Sidebar.logic.ts
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:L 100-499 changed lines (additions + deletions). vouch:unvouched PR author is not yet trusted in the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant