Skip to content
Source
Sign inSign up
pingdotgg/t3code

Pick sidebar fallback thread after delete #1395

Mergedjuliusmarmingemerged 1 commit intomain fromrefs/pull/1395/headmerged by juliusmarminge View on GitHub

juliusmarmingecommented
  • Choose the next visible thread by sidebar sort order
  • Skip other threads deleted in the same action

What Changed

Why

UI Changes

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 Low risk: changes only client-side navigation after thread deletion, with added unit tests; main risk is incorrect fallback selection in edge cases (e.g., bulk delete or cross-project threads).

Overview When deleting the currently viewed thread, the sidebar now navigates to a deterministic fallback thread: the top remaining thread in the same project according to the configured sidebar thread sort order, while skipping any other threads being deleted in the same bulk action.

This introduces getFallbackThreadIdAfterDelete in Sidebar.logic.ts, uses it from Sidebar.tsx during thread deletion (including adding sidebarThreadSortOrder to the callback deps), and adds targeted tests covering sort-order selection and bulk-delete skipping.

Written by [Cursor Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit b671f726ebe8ef53e0f86f2f0929a8db975490e0. This will update automatically on new commits. Configure [here](https://cursor.com/dashboard?tab=bugbot).

Note

Pick fallback thread from same project when deleting the active sidebar thread

  • Adds getFallbackThreadIdAfterDelete in Sidebar.logic.ts to find the top remaining thread in the deleted thread's project, sorted by sidebarThreadSortOrder, skipping any other threads being deleted in the same action.
  • Updates Sidebar.tsx to use this function instead of the previous logic, which could navigate to any first available thread across all projects.
  • Behavioral Change: after deleting the active thread, navigation now targets the same project's next thread rather than the globally first available thread.
Macroscope summarized b671f72.
    1. 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: 539ecbd8-26de-4d0f-be9c-56628ab37da6

      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
      • Commit unit tests in branch `feature/sidebar-delete-fallback`

      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:trusted

    3. juliusmarminge merged thisbf71e0b

    4. juliusmarminge closed this

Sign in to join this conversation.