feat(web): group new-thread project picker by connection#4295
Conversation
With the same repo checked out on several machines, the flat "New thread in..." list showed identical project names with only a truncated path to tell them apart. Group the picker by environment so each connection's projects sit under its machine name, keep the active project's group and row on top, and collapse back to the flat "Projects" heading when only one environment is known. Machine names are searchable so filtering by a visible heading doesn't empty the list. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
|
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: Needs human review This PR introduces a new user-facing feature that changes how projects are grouped and displayed in the command palette picker. While well-scoped and tested, new UI features with non-trivial logic warrant human review. You can customize Macroscope's approvability policy. Learn more. |
What Changed
The command palette's "New thread in..." project picker now groups projects under one heading per connection (machine), instead of rendering a single flat list. Group headings use the same resolved environment labels as the add-project flow ("This device" / the machine's name), ordered primary-first. The group containing the active project moves to the top with that project as its first row (replacing the old flat-list bubble-to-top behavior). Machine names are added to each row's search terms, so filtering by a visible heading like "Work laptop" narrows to that machine instead of emptying the list.
Behavior is unchanged when only one connection is known: the picker keeps its flat "Projects" heading. Projects whose connection is gone from the catalog stay visible under a fallback heading rather than disappearing.
Scope:
CommandPalette.logic.ts(two new pure functions),CommandPalette.tsx(wiring for the submenu and the sidebar-triggered open-intent view), and unit tests.Why
With the same repo checked out on several machines, the flat picker showed identical entries — three rows distinguishable only by truncated paths. Grouping by connection makes it obvious which machine each project lives on.
UI Changes
Before: one flat "Projects" list where same-named projects from different machines repeat back-to-back.
After: one section per connection, machine name as the heading, active project's machine on top.
Screenshots
Checklist
Verification
vp test run src/components/CommandPalette.logic.test.ts— 11/11 passing (grouping, catalog ordering, single-connection collapse, removed-connection fallback, prioritization, heading search)tsgo --noEmitandvp lintclean (two pre-existingno-unstable-nested-componentswarnings unchanged from main)vp run devenvironment in the in-app browser (single-connection collapse path)🤖 Generated with Claude Code
Note
Group projects by environment connection in the new-thread project picker
buildProjectActionGroupsto CommandPalette.logic.ts to group projects byenvironmentId, ordered by a provided environment label catalog, with each item searchable by its environment label.prioritizeProjectGroupItemto sort groups so the current project's environment group appears first, with the current project at the top.projectThreadItemslist with grouped output from these two functions in the 'New thread in...' submenu.Macroscope summarized 09a3483.