Skip to content

feat(new-workspace): always offer "Add a new project" in Create worktree picker - #9251

Merged
nwparker merged 1 commit into
mainfrom
nwparker/create-worktree-dialog-add-project-option
Jul 18, 2026
Merged

nwparker merged 1 commit into
mainfrom
nwparker/create-worktree-dialog-add-project-option

Conversation

@nwparker

@nwparker nwparker commented Jul 18, 2026 •

Copy link
Copy Markdown
Contributor

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

  • ProjectCombobox gains an optional onAddProject callback. When provided, it renders a pinned footer (FolderPlus + "Add a new project") below the scrollable CommandList, so it stays visible regardless of the list/empty state.
  • NewWorkspaceComposerCard wires onAddProject={handleAddRepo}, so the footer opens the same add-project flow (openModal('add-repo')) used by the label-row icon and the sidebar.
  • Footer styling and placement mirror the existing AutomationProjectCombobox footer, and it uses the shared FolderPlus icon used everywhere else for "add project".
  • New auto.components.new.workspace.ProjectCombobox.addProject catalog key ("Add a new project"), synced across all locales.

The footer is a sibling after CommandList, not a CommandItem — so CommandEmpty'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
Dropdown open

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

Filtered results — footer stays pinned
Partial match

Clicking it opens the shared add-project flow (add-repo)
Add a project opened

Dialog on open
Dialog open

Light

Dropdown open
Light dropdown

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

Testing

  • ProjectCombobox.test.tsx: added coverage that the action shows (and fires onAddProject) 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, and verify:localization-catalog all clean.
  • Verified end-to-end in the running Electron app (screenshots above are from the dev build): populated list, empty-search state, filtered state, and the click-through to the add-project dialog.

Made with Orca 🐋

…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]>
@coderabbitai

coderabbitai Bot commented Jul 18, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

ProjectCombobox now accepts an optional onAddProject callback and conditionally renders an “Add a new project” button that resets its state, closes the popover, and invokes the callback. New tests cover rendering and callback behavior. New locale entries provide the action label, and NewWorkspaceComposerCard connects the control to its existing repository handler.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title is concise and accurately summarizes the main change: always showing the Add a new project action in the worktree picker.
Description check ✅ Passed It includes the main required sections and enough implementation/testing detail; the AI Review Report, Security Audit, and Notes sections are missing.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch

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.

@coderabbitai coderabbitai 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.

Actionable comments posted: 1


ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: ba8b91b3-2d52-42a7-882a-dade21ee260d

📥 Commits

Reviewing files that changed from the base of the PR and between 2668af0 and 634c49b.

📒 Files selected for processing (8)
  • src/renderer/src/components/NewWorkspaceComposerCard.tsx
  • src/renderer/src/components/new-workspace/ProjectCombobox.test.tsx
  • src/renderer/src/components/new-workspace/ProjectCombobox.tsx
  • src/renderer/src/i18n/locales/en.json
  • src/renderer/src/i18n/locales/es.json
  • src/renderer/src/i18n/locales/ja.json
  • src/renderer/src/i18n/locales/ko.json
  • src/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}

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.

🎯 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.

Suggested change
onAddProject={handleAddRepo}
onAddProject={showAddProjectButton ? handleAddRepo : undefined}

@nwparker
nwparker merged commit ed28dec into main Jul 18, 2026
2 checks passed
@nwparker
nwparker deleted the nwparker/create-worktree-dialog-add-project-option branch July 18, 2026 01:37
enrick-dev pushed a commit to enrick-dev/orca that referenced this pull request Oct 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant