Skip to content
Source
Sign inSign up
pingdotgg/t3code

Add support for pinned threads in the sidebar #1824

ClosedRobrusi(GitHub profile, opens in a new tab)wants to merge 4 commits intomain fromrefs/pull/1824/headopened View on GitHub

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](https://cursor.com/bugbot) for commit 9de609c57cbced897d81b6bb3c7f83ec23b9acd9. Bugbot is set up for automated code reviews on this repo. Configure [here](https://www.cursor.com/dashboard/bugbot).

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.
    1. coderabbitai[bot](GitHub profile, opens in a new tab)commented

      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.
    2. github-actions[bot](GitHub profile, opens in a new tab) added labelsvouch:unvouched

    3. macroscopeapp[bot](GitHub profile, opens in a new tab)commented

      🟠 High

      https://github.com/pingdotgg/t3code/blob/aa96bfddb34e0c4a63d7aad93bd2bdd635b9bec7/apps/web/src/hooks/useThreadActions.ts#L69

      The deleteThread callback reads pinnedThreadIds from closure-captured state (line 26) but reads threads fresh via useStore.getState() (line 73). If pins change between render and invocation, getFallbackThreadIdAfterDelete receives stale isPinned values mixed with fresh thread data, causing incorrect fallback thread selection. Consider reading pinnedThreadIds fresh inside the callback via useUiStateStore.getState().pinnedThreadIds.

      ✅ Resolved in b164956ea70d03d8383360237c9c68ea921b6a48

    4. macroscopeapp[bot](GitHub profile, opens in a new tab)commented

      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](https://docs.macroscope.com/approvability#example-custom-eligibility-rules).
    5. 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](https://www.cursor.com/dashboard/bugbot). Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit b164956ea70d03d8383360237c9c68ea921b6a48. Configure [here](https://www.cursor.com/dashboard/bugbot).
    6. Closing as part of backlog cleanup: this PR is stale, currently conflicting with main, has no approval, and has not had active remediation for 30+ days. If the change is still relevant, please rebase onto current main and request reopening or submit a focused current diff. Thank you for the contribution.

    7. juliusmarminge closed this

Sign in to join this conversation.