Skip to content

Pick sidebar fallback thread after delete#1395

Merged
juliusmarminge merged 1 commit intomainfrom
feature/sidebar-delete-fallback
Mar 25, 2026
Merged

Pick sidebar fallback thread after delete#1395
juliusmarminge merged 1 commit intomainfrom
feature/sidebar-delete-fallback

Conversation

@juliusmarminge
Copy link
Copy Markdown
Member

@juliusmarminge juliusmarminge commented Mar 25, 2026

  • 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 for commit b671f72. This will update automatically on new commits. Configure here.

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.

- Choose the next visible thread by sidebar sort order
- Skip other threads deleted in the same action
@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Mar 25, 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: 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.

@github-actions github-actions bot added size:M 30-99 changed lines (additions + deletions). vouch:trusted PR author is trusted by repo permissions or the VOUCHED list. labels Mar 25, 2026
@juliusmarminge juliusmarminge merged commit bf71e0b into main Mar 25, 2026
11 checks passed
@juliusmarminge juliusmarminge deleted the feature/sidebar-delete-fallback branch March 25, 2026 06:38
emrezeytin pushed a commit to emrezeytin/t3code that referenced this pull request Mar 25, 2026
apexsloth pushed a commit to apexslothforks/t3code that referenced this pull request Mar 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:M 30-99 changed lines (additions + deletions). vouch:trusted PR author is trusted by repo permissions or the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant