Unify the new thread project picker#4263
Conversation
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
ApprovabilityVerdict: Approved This PR consolidates the 'new thread' project picker UI logic, extracts it into testable functions, and adds comprehensive unit tests. The changes are self-contained to command palette behavior with no security, schema, or infrastructure implications. Author has recent active experience with this code. You can customize Macroscope's approvability policy. Learn more. |
393a8ab to
ae058e8
Compare
942961d to
95ef9ca
Compare
Dismissing prior approval to re-evaluate 891f36e
891f36e to
f2fecdb
Compare
584440b to
dfc3277
Compare
9fb451d to
420ec83
Compare
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using high effort and found 2 potential issues.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 420ec83. Configure here.
420ec83 to
6e0d514
Compare



Summary
Why
T3 Code originally had two project-picker experiences for starting a thread. The command-palette picker was searchable and already served the Ctrl+K flow, while Ctrl+N and the Sidebar V2 button used a separate sidebar-owned modal. Consolidating them gives every entry point the same interaction and removes duplicate UI and keyboard-navigation code.
PR #4269 landed the basic route into the command palette after this PR opened. That means the current
mainscreenshot below is an intermediate state, while the first screenshot is the real product before-state of the consolidation this PR proposed.UI comparison
Before: standalone Sidebar V2 dialog
The original new-thread flow used a separate project dialog. It duplicated the Ctrl+K picker and did not support incremental filtering.
Current
mainafter #4269mainnow routes into the command palette, but the intermediate picker still shows the new-thread shortcut on every project row and does not include Add project in the same result set.This PR
This PR keeps the command-palette picker, prioritizes the contextual project, and includes Add project as a keyboard-addressable action.
It also uses the same incremental search behavior as Ctrl+K → New thread in…:
Validation
CommandPalette.logic.test.tsandkeybindings.test.ts(56 tests)Exact-head evidence
Revalidated at 9fb451d on current main (9a0a071): focused tests, vp check, and vp run typecheck passed. The capture uses only disposable local projects.
Note
Medium Risk
Touches global shortcuts, command-palette navigation, and thread-creation entry points across sidebar and chat routes; behavior is well covered by new unit tests but user-facing flows are easy to regress.
Overview
Routes new thread flows (sidebar,
chat.new, Ctrl+K “New thread in…”) through one command-palette project picker instead of ad-hoc submenu stacks or a separate sidebar dialog.The palette bus gains
preferredProjectRefon open andcloseCommandPalettefor programmatic dismiss. Picker logic (buildNewThreadProjectView,buildNewThreadPickerGroups,prioritizeScopedProject,resolveNewThreadIntentViewStack) drives a dedicated view with contextual project first, searchable projects, Add project in the same list, and loading / empty copy vialeadingMessage.chat.newwhile the palette is open refreshes the picker (other chat shortcuts stay blocked); single-project and Sidebar V1 still create immediately.Reviewed by Cursor Bugbot for commit 6e0d514. Bugbot is set up for automated code reviews on this repo. Configure here.
Note
Unify the new thread project picker in the command palette
buildNewThreadProjectViewandresolveNewThreadIntentViewStackin CommandPalette.logic.ts.preferredProjectRefwhen opening the palette, which moves the preferred project to the top of the picker list viaprioritizeScopedProject.closeCommandPaletteandonCloseCommandPaletteto commandPaletteBus.ts so components can programmatically close the palette via a DOM event.chat.newkeyboard shortcut now works while the palette is open: it opens the project picker in sidebar v2 with multiple projects, or closes the palette and creates a thread immediately otherwise.leadingMessageprop onCommandPaletteResults.Macroscope summarized 6e0d514.