fix: show project selector when creating new task#300
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: bf986800a0
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
src/components/new-task-button.tsx
Outdated
| useHotkey(hotkeys.newTask.keys, () => handleNewTask(), { enabled: hotkeyEnabled }); | ||
|
|
||
| function handleNewTask() { | ||
| const repoUrl = defaultProject?.repo_url; | ||
| if (creating || !defaultProject || !repoUrl) { | ||
| function handleNewTask(project = defaultProject) { |
There was a problem hiding this comment.
Require project choice when hotkey creates a new task
With multiple projects configured, pressing the newTask hotkey still calls handleNewTask() without an explicit project, and handleNewTask now defaults to defaultProject. This bypasses the new project-selection flow and can create tasks in the wrong repository (typically the oldest project) without user intent, which is a functional regression for multi-project users compared to the button path that forces selection.
Useful? React with 👍 / 👎.
This updates the New Task button to support multiple projects.\n\nWhen only one project exists, the button still creates a task immediately. When multiple projects exist, the button now opens a dropdown so the user can pick the target project, and task creation uses the selected project's id and repo URL.\n\nThe icon-only variant keeps tooltip and hotkey hints, and projects without a repo URL are disabled in the menu.