Skip to content

feat(sidebar): pin chats within projects#4047

Open
12ya wants to merge 15 commits into
pingdotgg:mainfrom
12ya:codex/sidebar-project-pins
Open

feat(sidebar): pin chats within projects#4047
12ya wants to merge 15 commits into
pingdotgg:mainfrom
12ya:codex/sidebar-project-pins

Conversation

@12ya

@12ya 12ya commented Jul 16, 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 distinct pin/unpin feedback.
  • 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 sidebar organization feel natural.

Validation

  • vp check
  • vp run typecheck
  • vp test apps/web/src/components/Sidebar.logic.test.ts apps/web/src/uiStateStore.test.ts — 81 tests passed

UI Changes

Interaction demo:

Screen.Recording.2026-07-12.at.11.51.13.PM.mp4

Replaces #3913, whose head accidentally tracked the fork's long-lived main branch.

Note

Add pin/unpin support for chat threads within sidebar projects

  • Adds a pin/unpin button to each thread row in the sidebar, with drag-and-drop reordering across a visual pinned/unpinned divider in SidebarProjectThreadList.
  • Pinned thread keys are stored per-project in uiStateStore and persisted to localStorage via pinnedThreadKeysByProject.
  • Pinned threads are always shown in the sidebar even when a project is folded beyond the preview limit, alongside the active thread.
  • New logic helpers (prioritizeThreadsByPinnedKeys, resolveThreadPinCrossingAction, shouldShowPinnedThreadDivider, shouldBlockThreadDragActivation) handle ordering, drag state, and divider rendering.
  • Behavioral Change: getVisibleThreadsForProject now accepts optional getThreadId/isThreadAlwaysVisible params; hasHiddenThreads now reflects whether threads are actually hidden rather than whether the list exceeds the limit.

Macroscope summarized 16a5331.


Note

Low Risk
Client-only UI state in localStorage and sidebar interaction logic; no auth or server data changes.

Overview
Adds project-scoped thread pinning in the sidebar: pinned chats stay at the top of each project (after the normal sort), persist in pinnedThreadKeysByProject via uiStateStore, and remain visible when the thread list is folded.

Pin/unpin UX: hover pin controls on each row (with desktop row-action visibility tweaks via shouldHideThreadMeta), plus drag across a pinned divider (DndContext / useDraggable) with divider coloring from resolveThreadPinCrossingAction. Drag does not start from buttons/inputs (shouldBlockThreadDragActivation); clicks are suppressed after a drag.

Logic: prioritizeThreadsByPinnedKeys, divider visibility helpers, and an extended getVisibleThreadsForProject (scoped keys, isThreadAlwaysVisible for pins) drive list rendering and jump/preview behavior.

Reviewed by Cursor Bugbot for commit 16a5331. Bugbot is set up for automated code reviews on this repo. Configure here.

12ya added 13 commits July 17, 2026 00:09
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.
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.
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.
@coderabbitai

coderabbitai Bot commented Jul 16, 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: 54cdaed2-8d5b-4589-86d0-a057eabb9f7f

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 16, 2026
Comment thread apps/web/src/components/Sidebar.tsx
Comment thread apps/web/src/components/Sidebar.tsx Outdated
@12ya 12ya marked this pull request as ready for review July 16, 2026 15:16

@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 1 potential issue.

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 e42b031. Configure here.

Comment thread apps/web/src/components/Sidebar.tsx
@macroscopeapp

macroscopeapp Bot commented Jul 16, 2026

Copy link
Copy Markdown
Contributor

Approvability

Verdict: Needs human review

This PR introduces a new user-facing feature (pinning chats within projects) with drag-and-drop interactions, new UI components, and new persisted state. New features with user-facing behavior changes warrant human review.

You can customize Macroscope's approvability policy. Learn more.

@github-actions github-actions Bot added size:XL 500-999 changed lines (additions + deletions). and removed size:L 100-499 changed lines (additions + deletions). labels Jul 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:XL 500-999 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