Repository navigation
feat(new-workspace): always offer "Add a new project" in Create worktree picker - #9251
Conversation
…ree picker
The Create worktree dialog's project picker now shows a pinned "Add a new
project" action at the bottom of the dropdown in every state — including when
the search yields "No projects match your search." Mirrors the existing
AutomationProjectCombobox footer and uses the shared FolderPlus icon; the
action opens the same add-project flow (openModal('add-repo')) used elsewhere.
Co-authored-by: Orca <[email protected]>
📝 WalkthroughWalkthroughProjectCombobox now accepts an optional 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
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 |
There was a problem hiding this comment.
Actionable comments posted: 1
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro
Run ID: ba8b91b3-2d52-42a7-882a-dade21ee260d
📒 Files selected for processing (8)
src/renderer/src/components/NewWorkspaceComposerCard.tsxsrc/renderer/src/components/new-workspace/ProjectCombobox.test.tsxsrc/renderer/src/components/new-workspace/ProjectCombobox.tsxsrc/renderer/src/i18n/locales/en.jsonsrc/renderer/src/i18n/locales/es.jsonsrc/renderer/src/i18n/locales/ja.jsonsrc/renderer/src/i18n/locales/ko.jsonsrc/renderer/src/i18n/locales/zh.json
👮 Files not reviewed due to content moderation or server errors (1)
- src/renderer/src/i18n/locales/ko.json
| value={selectedProjectId} | ||
| onValueChange={onProjectChange} | ||
| onValueSelected={focusNameInput} | ||
| onAddProject={handleAddRepo} |
There was a problem hiding this comment.
🎯 Functional Correctness | 🟠 Major | ⚡ Quick win
Conditionally pass handleAddRepo based on showAddProjectButton.
The showAddProjectButton prop controls whether the "Add project" affordance is available in this composer. Passing handleAddRepo unconditionally bypasses this restriction, making the "Add a new project" item inside the combobox always visible even when showAddProjectButton is false.
🐛 Proposed fix
- onAddProject={handleAddRepo}
+ onAddProject={showAddProjectButton ? handleAddRepo : undefined}📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| onAddProject={handleAddRepo} | |
| onAddProject={showAddProjectButton ? handleAddRepo : undefined} |
…ree picker (stablyai#9251) Co-authored-by: Orca <[email protected]>
Summary
The Create worktree dialog's project picker now always shows an "Add a new project" action pinned at the bottom of the dropdown — in every state, including when the search yields "No projects match your search."
Previously the only in-dialog affordance for adding a project was the small icon button next to the Project label. If you opened the picker, searched, and found nothing, there was no obvious way to add the project you were looking for without backing out. Now the action is always one click away, right where you're already looking.
What changed
ProjectComboboxgains an optionalonAddProjectcallback. When provided, it renders a pinned footer (FolderPlus+ "Add a new project") below the scrollableCommandList, so it stays visible regardless of the list/empty state.NewWorkspaceComposerCardwiresonAddProject={handleAddRepo}, so the footer opens the same add-project flow (openModal('add-repo')) used by the label-row icon and the sidebar.AutomationProjectComboboxfooter, and it uses the sharedFolderPlusicon used everywhere else for "add project".auto.components.new.workspace.ProjectCombobox.addProjectcatalog key ("Add a new project"), synced across all locales.The footer is a sibling after
CommandList, not aCommandItem— soCommandEmpty's "No projects match your search." still shows when the filter is empty, with the action pinned beneath it (exactly as requested).Screenshots
Dark
Dropdown open — "Add a new project" pinned below the project list

"No projects match your search." — the action still shows

Filtered results — footer stays pinned

Clicking it opens the shared add-project flow (

add-repo)Dialog on open

Light
Dropdown open

"No projects match your search." — the action still shows

Testing
ProjectCombobox.test.tsx: added coverage that the action shows (and firesonAddProject) even with an empty option list, and is omitted when no handler is passed. 6/6 pass.NewWorkspaceComposerCard.test.tsx: 12/12 pass.pnpm typecheck:web,oxlint,oxfmt, andverify:localization-catalogall clean.Made with Orca 🐋