Skip to content

Add support for pinned threads in the sidebar#1824

Open
Robrusi wants to merge 4 commits intopingdotgg:mainfrom
Robrusi:pinned-threads-sidebar
Open

Add support for pinned threads in the sidebar#1824
Robrusi wants to merge 4 commits intopingdotgg:mainfrom
Robrusi:pinned-threads-sidebar

Conversation

@Robrusi
Copy link
Copy Markdown

@Robrusi Robrusi commented Apr 7, 2026

What changed

This PR adds support for pinning threads in the UI so important conversations are easier to keep in view.

Pinned threads now:

  • Can be pinned and unpinned from the sidebar thread context menu
  • Appear in a dedicated Pinned section above the project folders
  • Still remain visible inside their original project folder
  • Show a minimal folder indicator in the pinned section so it’s clear which project they belong to
  • Stay pinned across reloads via persisted UI state

Why

Made it easier to keep track of important threads

Details

  • Pin state is stored in the existing web UI state store
  • Pinned threads are sorted ahead of unpinned threads
  • Sidebar navigation keeps a deduplicated logical ordering so keyboard traversal and jump hints do not treat the same pinned thread as two separate entries

UI

Screenshot 2026-04-07 at 21 09 35 Screenshot 2026-04-07 at 21 09 23

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

Testing

  • bun fmt
  • bun lint
  • bun typecheck
  • bun run test

Note

Medium Risk
Moderate risk: changes sidebar rendering/order and navigation indexes, plus persists new pinnedThreadIds in localStorage; regressions could affect thread selection, sorting, and post-delete navigation.

Overview
Adds pinned threads support in the sidebar: threads can now be pinned/unpinned via single- and multi-select context menus, and pinned items render in a new Pinned section above projects with a pin indicator and optional project folder suffix.

Updates thread ordering logic so sortThreadsForSidebar prioritizes isPinned, and rebuilds visibleSidebarThreadIds as pinned-first then projects with deduping to keep keyboard traversal/jump hints stable even when a thread appears in both places.

Extends uiStateStore to store/persist pinnedThreadIds (including pruning on syncThreads/clearThreadUi) and updates delete fallback selection in useThreadActions to respect pin ordering; includes new unit tests for pin state.

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

Note

Add pinned threads support to the sidebar

  • Introduces a Pinned section at the top of the sidebar that shows pinned threads with a pin icon and folder label suffix.
  • Adds setThreadPinned to uiStateStore.ts, persisting pin state in localStorage and pruning stale ids when threads are deleted.
  • Single and multi-select context menus expose a toggle-pin action; sortThreadsForSidebar in Sidebar.logic.ts now places pinned threads before unpinned ones.
  • Fallback thread selection after deletion in useThreadActions.ts now respects pin ordering.
  • Behavioral Change: visibleSidebarThreadIds (used for keyboard navigation) is rebuilt as pinned threads first, then per-project threads, deduplicated.

Macroscope summarized 9de609c.

@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Apr 7, 2026

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: 40e6eacd-3858-4814-9456-35b9c2535e74

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 and usage tips.

@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 Apr 7, 2026
- Avoid capturing stale pinned thread IDs in thread delete actions
- Read the latest pin state when computing fallback navigation
@macroscopeapp
Copy link
Copy Markdown
Contributor

macroscopeapp bot commented Apr 7, 2026

Approvability

Verdict: Needs human review

This PR introduces a new user-facing feature allowing threads to be pinned in the sidebar, with new UI sections, sorting behavior, and persistence. While self-contained and including tests, new features that introduce user-facing behavior and workflows warrant human review to verify the implementation meets product expectations.

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

Copy link
Copy Markdown
Contributor

@cursor cursor bot left a comment

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

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