feat(tasks): add From Branch worktree default setting#1998
Conversation
fab226e to
b8ba5a0
Compare
|
This was fast @benjaminshoemaker |
Greptile SummaryThis PR adds a new app-level setting (
Confidence Score: 5/5Safe to merge — the change is additive, backwards-compatible, and well-scoped to the From Branch flow. All three callers of useBranchSelection are accounted for: From Branch now receives the setting value, while From Issue and From PR continue to use the true default via the parameter default. The override/fallback pattern in use-branch-selection is reactive and correct. Defaults across the schema, registry, and hook fallback all agree on true, so existing users see no behaviour change. No files require special attention.
|
| Filename | Overview |
|---|---|
| src/main/core/settings/schema.ts | Adds createBranchAndWorktree: z.boolean() to the task settings Zod schema — straightforward, no issues. |
| src/main/core/settings/settings-registry.ts | Adds createBranchAndWorktree: true to the task settings defaults — consistent with both the schema and the useTaskSettings fallback. |
| src/renderer/features/tasks/hooks/useTaskSettings.ts | Extends TaskSettingsModel with createBranchAndWorktree, its updater, and its reset — follows the exact same pattern as the two existing settings. |
| src/renderer/features/settings/components/TaskSettingsRows.tsx | New CreateBranchAndWorktreeRow component mirrors AutoTrustWorktreesRow exactly; correctly wires isFieldOverridden, reset, and toggle callbacks. |
| src/renderer/features/settings/components/SettingsPage.tsx | Imports and renders CreateBranchAndWorktreeRow between AutoTrustWorktreesRow and EnableTmuxRow — clean insertion, no issues. |
| src/renderer/features/tasks/create-task-modal/use-branch-selection.ts | Adds createBranchAndWorktreeByDefault parameter (default true) and refactors internal state to an override pattern so the prop drives the default while user in-modal toggling still works correctly. |
| src/renderer/features/tasks/create-task-modal/use-from-branch-mode.ts | Reads createBranchAndWorktree from useTaskSettings and forwards it as the default to useBranchSelection, scoping the new setting exclusively to the From Branch flow as intended. |
Reviews (1): Last reviewed commit: "feat(tasks): add From Branch worktree de..." | Re-trigger Greptile



Summary
Validation