Skip to content

Unify the new thread project picker#4263

Open
colonelpanic8 wants to merge 3 commits into
pingdotgg:mainfrom
colonelpanic8:t3code/replace-ctrl-n-thread-modal
Open

Unify the new thread project picker#4263
colonelpanic8 wants to merge 3 commits into
pingdotgg:mainfrom
colonelpanic8:t3code/replace-ctrl-n-thread-modal

Conversation

@colonelpanic8

@colonelpanic8 colonelpanic8 commented Jul 22, 2026

Copy link
Copy Markdown

Summary

  • route every new-thread entry point through one command-palette project picker
  • prioritize the project from the current route or thread context
  • preserve loading and empty states, Add project, and repeat-shortcut refresh behavior
  • remove the duplicate Sidebar V2 picker and its separate keyboard-navigation path

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 main screenshot 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.

Original Sidebar V2 new-thread dialog

Current main after #4269

main now 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.

Current main new-thread picker

This PR

This PR keeps the command-palette picker, prioritizes the contextual project, and includes Add project as a keyboard-addressable action.

New-thread picker on this PR

It also uses the same incremental search behavior as Ctrl+K → New thread in…:

New-thread picker filtered to Canvas Components

Validation

  • web package typecheck
  • targeted lint on changed files
  • CommandPalette.logic.test.ts and keybindings.test.ts (56 tests)
  • isolated end-to-end web verification: Ctrl+N opens the Projects command-palette submenu and selecting a project creates a fresh draft
  • compared against Ctrl+K → New thread in… to confirm both entry points render the same picker

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.

Unified new-thread picker filtered to Cedar Docs


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 preferredProjectRef on open and closeCommandPalette for 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 via leadingMessage. chat.new while 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

  • Adds a dedicated 'New thread in…' project picker view to the command palette, built via buildNewThreadProjectView and resolveNewThreadIntentViewStack in CommandPalette.logic.ts.
  • Callers (sidebar, chat route shortcuts) can now pass a preferredProjectRef when opening the palette, which moves the preferred project to the top of the picker list via prioritizeScopedProject.
  • Adds closeCommandPalette and onCloseCommandPalette to commandPaletteBus.ts so components can programmatically close the palette via a DOM event.
  • chat.new keyboard 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.
  • The picker shows loading and empty state messages via a new leadingMessage prop on CommandPaletteResults.

Macroscope summarized 6e0d514.

@coderabbitai

coderabbitai Bot commented Jul 22, 2026

Copy link
Copy Markdown

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: ece2a068-d09b-47b4-9e55-e6a529249410

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.

@github-actions github-actions Bot added vouch:unvouched PR author is not yet trusted in the VOUCHED list. size:L 100-499 changed lines (additions + deletions). labels Jul 22, 2026
Comment thread apps/web/src/components/CommandPalette.tsx Outdated
Comment thread apps/web/src/components/SidebarV2.tsx Outdated
Comment thread apps/web/src/components/SidebarV2.tsx Outdated
@macroscopeapp

macroscopeapp Bot commented Jul 22, 2026

Copy link
Copy Markdown
Contributor

Approvability

Verdict: 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.

Comment thread apps/web/src/components/SidebarV2.tsx Outdated
Comment thread apps/web/src/components/CommandPalette.tsx
Comment thread apps/web/src/commandPaletteContext.tsx Outdated
Comment thread apps/web/src/components/CommandPalette.tsx Outdated
Comment thread apps/web/src/components/SidebarV2.tsx Outdated
@juliusmarminge

Copy link
Copy Markdown
Member

BEFORE/AFTER SCREENSHOTS FOR UI CHANGES
CleanShot 2026-07-22 at 14 32 06@2x

@colonelpanic8
colonelpanic8 force-pushed the t3code/replace-ctrl-n-thread-modal branch from 393a8ab to ae058e8 Compare July 22, 2026 14:46
Comment thread apps/web/src/components/CommandPalette.tsx
Comment thread apps/web/src/components/CommandPalette.tsx Outdated
Comment thread apps/web/src/components/CommandPalette.tsx
Comment thread apps/web/src/components/CommandPalette.tsx Outdated
macroscopeapp[bot]
macroscopeapp Bot previously approved these changes Jul 22, 2026
@colonelpanic8

Copy link
Copy Markdown
Author

BEFORE/AFTER SCREENSHOTS FOR UI CHANGES CleanShot 2026-07-22 at 14 32 06@2x

this just gets rid of a duplicated modal where one version is clearly superior to the other. You really need a screenshot for that?

@colonelpanic8
colonelpanic8 force-pushed the t3code/replace-ctrl-n-thread-modal branch from 942961d to 95ef9ca Compare July 22, 2026 15:44
Comment thread apps/web/src/routes/_chat.tsx Outdated
@macroscopeapp
macroscopeapp Bot dismissed their stale review July 22, 2026 15:52

Dismissing prior approval to re-evaluate 891f36e

@colonelpanic8
colonelpanic8 force-pushed the t3code/replace-ctrl-n-thread-modal branch from 891f36e to f2fecdb Compare July 22, 2026 16:09
Comment thread apps/web/src/components/CommandPalette.tsx Outdated
@colonelpanic8
colonelpanic8 force-pushed the t3code/replace-ctrl-n-thread-modal branch from 584440b to dfc3277 Compare July 22, 2026 16:22
Comment thread apps/web/src/components/CommandPalette.tsx Outdated
@colonelpanic8
colonelpanic8 force-pushed the t3code/replace-ctrl-n-thread-modal branch from 9fb451d to 420ec83 Compare July 22, 2026 23:21

@cursor cursor Bot left a comment

Copy link
Copy Markdown
Contributor

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 using high effort and found 2 potential issues.

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 420ec83. Configure here.

Comment thread apps/web/src/components/CommandPalette.tsx
Comment thread apps/web/src/routes/_chat.tsx
@colonelpanic8
colonelpanic8 force-pushed the t3code/replace-ctrl-n-thread-modal branch from 420ec83 to 6e0d514 Compare July 22, 2026 23:43
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.

2 participants