feat: improve create task modal#2194
Conversation
Greptile SummaryThis PR refactors the create-task modal into a single unified layout — replacing the three-tab strategy switcher (From Branch / From Issue / From Pull Request) with a compact "Based on" toggle (Issue | Pull Request) and a separate Workspace Settings tab for branch/checkout configuration. Three separate mode hooks (
Confidence Score: 3/5The modal restructure and hook consolidation are logically sound, but the initial-conversation toolbar ships two buttons that do nothing on click — a visible regression that reaches users directly. The core task-creation path (state management, strategy dispatch, isValid gating) looks correct after the refactor. The problem is in initial-conversation-section.tsx: two toolbar buttons with empty onClick handlers are rendered as fully interactive UI elements with no action, and the auto-approve Switch was dropped with no replacement. These are observable regressions in the conversation tab that users will encounter on every task creation. src/renderer/features/tasks/create-task-modal/initial-conversation-section.tsx — the no-op buttons and dead hook/import cleanup both need attention before merge.
|
| Filename | Overview |
|---|---|
| src/renderer/features/tasks/create-task-modal/initial-conversation-section.tsx | Redesigned toolbar area ships two no-op buttons (onClick={() => {}}) and retains dead code from the removed ModalContextBar and auto-approve Switch. |
| src/renderer/features/tasks/create-task-modal/use-create-task-state.ts | New unified hook replaces three separate mode hooks; consolidates branch/issue/PR selection and task name generation with correct per-project reset and isValid derivation. |
| src/renderer/features/tasks/create-task-modal/create-task-modal.tsx | Significant restructure removes the three-tab strategy switcher in favour of a "Based on" toggle (issue/PR) plus a separate Workspace Settings section; handleCreateTask correctly dispatches PR vs. branch-based creation. |
| src/renderer/features/tasks/create-task-modal/use-task-name.ts | Reworked to use placeholder/effectiveTaskName pattern; user input is kept separate from the generated name and merged only at submission time. |
| src/renderer/features/tasks/create-task-modal/workspace-settings-section.tsx | New component that surfaces branch picker or checkout-mode group depending on linked type; "Select existing workspace" radio item is permanently disabled. |
| src/renderer/features/tasks/create-task-modal/issue-combobox-field.tsx | New popover-based issue combobox replacing the inline selector; auto-closes on selection. |
| src/renderer/features/tasks/create-task-modal/pr-combobox-field.tsx | New popover-based PR combobox replacing the inline selector + selected-PR-card pattern; auto-closes on selection. |
Flowchart
%%{init: {'theme': 'neutral'}}%%
flowchart TD
A([Open CreateTaskModal]) --> B[useCreateTaskState\ninitialPR? → linkedType='pr' : 'issue']
B --> C{initialStrategy?}
C -- from-issue --> D[setLinkedType 'issue']
C -- from-pull-request --> E[setLinkedType 'pr']
C -- from-branch --> F[default: linkedType='issue']
subgraph Modal UI
G[TaskNameField\nplaceholder = generatedName]
H{Based-on toggle}
H -- Issue --> I[IssueComboboxField\noptional]
H -- Pull Request --> J[PrComboboxField\ndisabled when no repositoryUrl]
K{Section tab}
K -- conversation --> L[InitialConversationField\nAgentSelector + Textarea]
K -- workspace --> M[WorkspaceSettingsSection]
M --> N{linkedType=pr && linkedPR?}
N -- yes --> O[CheckoutModeGroup]
N -- no --> P[BranchPickerField]
end
B --> G
G --> H
subgraph handleCreateTask
Q{linkedType=pr && linkedPR?}
Q -- yes --> R[resolvePullRequestTaskStrategy\ncreateTask PR-based]
Q -- no --> S[resolveBranchLikeTaskStrategy\ncreateTask branch-based\nlinkedIssue if type=issue]
end
H --> K
K --> Q
Comments Outside Diff (2)
-
src/renderer/features/tasks/create-task-modal/initial-conversation-section.tsx, line 49-60 (link)Dead code left over from removed UI elements
autoApproveDefaults,contextActions, andhandleActionClickare computed on every render but none of them are referenced in the JSX anymore — theSwitchandModalContextBarthat consumed them were removed in this PR. The associated imports (Switch,ModalContextBar,buildContextActionText,buildTaskContextActions,ContextAction,useAgentAutoApproveDefaults) are similarly unused. This also causes unnecessary hook calls (useAgentAutoApproveDefaults,useMemofor context actions) on each render.Prompt To Fix With AI
This is a comment left during a code review. Path: src/renderer/features/tasks/create-task-modal/initial-conversation-section.tsx Line: 49-60 Comment: **Dead code left over from removed UI elements** `autoApproveDefaults`, `contextActions`, and `handleActionClick` are computed on every render but none of them are referenced in the JSX anymore — the `Switch` and `ModalContextBar` that consumed them were removed in this PR. The associated imports (`Switch`, `ModalContextBar`, `buildContextActionText`, `buildTaskContextActions`, `ContextAction`, `useAgentAutoApproveDefaults`) are similarly unused. This also causes unnecessary hook calls (`useAgentAutoApproveDefaults`, `useMemo` for context actions) on each render. How can I resolve this? If you propose a fix, please make it concise.
-
src/renderer/features/tasks/create-task-modal/initial-conversation-section.tsx, line 62-92 (link)Auto-approve switch silently removed
The
Switchfor "Auto-approve permissions" was removed fromInitialConversationFieldwith no replacement. In the previous UI it was the only surface where users could toggle per-agent auto-approve defaults from the create task modal. TheautoApproveDefaultshook is still called and the setting is still read inhandleCreateTaskwhen buildingbuiltInitialConversation, so the last-saved default continues to apply — but users can no longer change it from here. Was removing the auto-approve switch intentional? If so, is there another surface where users can update their auto-approve preference?Prompt To Fix With AI
This is a comment left during a code review. Path: src/renderer/features/tasks/create-task-modal/initial-conversation-section.tsx Line: 62-92 Comment: **Auto-approve switch silently removed** The `Switch` for "Auto-approve permissions" was removed from `InitialConversationField` with no replacement. In the previous UI it was the only surface where users could toggle per-agent auto-approve defaults from the create task modal. The `autoApproveDefaults` hook is still called and the setting is still read in `handleCreateTask` when building `builtInitialConversation`, so the last-saved default continues to apply — but users can no longer change it from here. Was removing the auto-approve switch intentional? If so, is there another surface where users can update their auto-approve preference? How can I resolve this? If you propose a fix, please make it concise.
Prompt To Fix All With AI
Fix the following 3 code review issues. Work through them one at a time, proposing concise fixes.
---
### Issue 1 of 3
src/renderer/features/tasks/create-task-modal/initial-conversation-section.tsx:80-85
**No-op button handlers ship non-functional UI**
Both the `PlusIcon` and `CheckCheckIcon` buttons use `onClick={() => {}}`, so clicking them produces no effect. Because the old `ModalContextBar` was removed from this component in this PR, these buttons appear to be intended replacements for it — but they are unimplemented. A user who clicks either button will see no response, with no indication that the action is pending.
### Issue 2 of 3
src/renderer/features/tasks/create-task-modal/initial-conversation-section.tsx:49-60
**Dead code left over from removed UI elements**
`autoApproveDefaults`, `contextActions`, and `handleActionClick` are computed on every render but none of them are referenced in the JSX anymore — the `Switch` and `ModalContextBar` that consumed them were removed in this PR. The associated imports (`Switch`, `ModalContextBar`, `buildContextActionText`, `buildTaskContextActions`, `ContextAction`, `useAgentAutoApproveDefaults`) are similarly unused. This also causes unnecessary hook calls (`useAgentAutoApproveDefaults`, `useMemo` for context actions) on each render.
### Issue 3 of 3
src/renderer/features/tasks/create-task-modal/initial-conversation-section.tsx:62-92
**Auto-approve switch silently removed**
The `Switch` for "Auto-approve permissions" was removed from `InitialConversationField` with no replacement. In the previous UI it was the only surface where users could toggle per-agent auto-approve defaults from the create task modal. The `autoApproveDefaults` hook is still called and the setting is still read in `handleCreateTask` when building `builtInitialConversation`, so the last-saved default continues to apply — but users can no longer change it from here.
Reviews (1): Last reviewed commit: "feat: task modal improvmeents" | Re-trigger Greptile
| <Button variant="ghost" size="icon-xs" onClick={() => {}}> | ||
| <PlusIcon className="size-4" /> | ||
| </Button> | ||
| <Button variant="ghost" size="icon-xs" onClick={() => {}}> | ||
| <CheckCheckIcon className="size-4" /> | ||
| </Button> |
There was a problem hiding this comment.
No-op button handlers ship non-functional UI
Both the PlusIcon and CheckCheckIcon buttons use onClick={() => {}}, so clicking them produces no effect. Because the old ModalContextBar was removed from this component in this PR, these buttons appear to be intended replacements for it — but they are unimplemented. A user who clicks either button will see no response, with no indication that the action is pending.
Prompt To Fix With AI
This is a comment left during a code review.
Path: src/renderer/features/tasks/create-task-modal/initial-conversation-section.tsx
Line: 80-85
Comment:
**No-op button handlers ship non-functional UI**
Both the `PlusIcon` and `CheckCheckIcon` buttons use `onClick={() => {}}`, so clicking them produces no effect. Because the old `ModalContextBar` was removed from this component in this PR, these buttons appear to be intended replacements for it — but they are unimplemented. A user who clicks either button will see no response, with no indication that the action is pending.
How can I resolve this? If you propose a fix, please make it concise.
No description provided.