feat(settings): make auto-inferred task names toggleable#1413
feat(settings): make auto-inferred task names toggleable#1413arnestrickmann merged 3 commits intogeneralaction:mainfrom
Conversation
|
@singhvibhanshu is attempting to deploy a commit to the General Action Team on Vercel. A member of the Team first needs to authorize it. |
Greptile SummaryThis PR adds a user-toggleable setting ( Key changes:
Issues found:
Confidence Score: 3/5
|
| Filename | Overview |
|---|---|
| src/main/settings.ts | Cleanly adds autoInferTaskNames: boolean to the AppSettings type, default settings, and normalizeSettings. Change is minimal and well-structured. |
| src/renderer/components/TaskModal.tsx | Adds autoInferTaskNames state and gates both context-based naming and the isNameGenerated flag behind it. Has a logic gap: isNameGenerated is not also gated by autoGenerateName, so with autoGenerateName: false + autoInferTaskNames: true an empty-name task can still be marked for post-creation rename. |
| src/renderer/components/ChatInterface.tsx | Reads autoInferTaskNames from useAppSettings context and correctly gates both handleFirstMessage and shouldCaptureFirstMessage behind it. Logic is sound. |
| src/renderer/components/TaskSettingsRows.tsx | Adds AutoInferTaskNamesRow following the existing pattern. The toggle lacks a visual dependency on autoGenerateName, which can be misleading when that setting is disabled. |
| src/renderer/hooks/useTaskSettings.ts | Straightforward addition of autoInferTaskNames to the model and a corresponding updateAutoInferTaskNames action. Follows existing patterns. |
| src/renderer/components/SettingsPage.tsx | Inserts AutoInferTaskNamesRow in the General Settings tab, positioned logically after AutoGenerateTaskNamesRow. No issues. |
| src/test/main/settings.test.ts | Good coverage of normalizeSettings for autoInferTaskNames: tests default, explicit true/false, and boolean coercion cases. |
| src/test/renderer/autoInferTaskNames.test.ts | Thorough tests for the toggle logic, name generation functions, and shouldCaptureFirstMessage gating. Tests inline logic directly rather than the component, which is fine for unit coverage. |
Flowchart
%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[User opens Task Modal] --> B{autoGenerateName?}
B -- No --> C[Empty name field shown]
B -- Yes --> D[Random name pre-filled]
C --> E[User types prompt / links issue]
D --> E
E --> F{autoGenerateName\nAND autoInferTaskNames?}
F -- Yes --> G[generateTaskNameFromContext runs\nname updated from context]
F -- No --> H[Name stays random / empty]
G --> I[User submits]
H --> I
I --> J{finalName empty\nOR not user-typed\nAND not from context?}
J -- Yes --> K[isNameGenerated = autoInferTaskNames\n⚠️ should also check autoGenerateName]
J -- No --> L[isNameGenerated = false]
K --> M[Task created with nameGenerated flag]
L --> M
M --> N[ChatInterface mounts]
N --> O{autoInferTaskNames\nAND nameGenerated?}
O -- Yes --> P[shouldCaptureFirstMessage = true\nFirst terminal msg triggers rename]
O -- No --> Q[No post-creation rename]
Last reviewed commit: 943daa1
| export const AutoInferTaskNamesRow: React.FC<RowProps> = ({ taskSettings }) => { | ||
| const showError = | ||
| Boolean(taskSettings.error) && | ||
| (taskSettings.errorScope === 'autoInferTaskNames' || taskSettings.errorScope === 'load'); | ||
|
|
||
| return ( | ||
| <div className="flex flex-col gap-1.5"> | ||
| <div className="flex items-center justify-between gap-4"> | ||
| <div className="flex flex-1 flex-col gap-0.5"> | ||
| <p className="text-sm font-medium text-foreground"> | ||
| Auto-infer task names from conversation | ||
| </p> | ||
| <p className="text-sm text-muted-foreground"> | ||
| Replaces the generated task name with one inferred from the conversation context. | ||
| </p> | ||
| </div> | ||
| <Switch | ||
| checked={taskSettings.autoInferTaskNames} | ||
| disabled={taskSettings.loading || taskSettings.saving} | ||
| onCheckedChange={taskSettings.updateAutoInferTaskNames} | ||
| /> | ||
| </div> | ||
| {showError ? <p className="text-xs text-destructive">{taskSettings.error}</p> : null} | ||
| </div> | ||
| ); | ||
| }; |
There was a problem hiding this comment.
AutoInferTaskNamesRow has no visual dependency on autoGenerateName
The AutoInferTaskNamesRow toggle is shown as fully interactive even when autoGenerateName is false. In that state the two places where autoInferTaskNames matters — the context-based name generation in TaskModal (if (!autoGenerateName || !autoInferTaskNames …)) and the isNameGenerated logic — are both gated on autoGenerateName as well. A user who enables this toggle while "Auto-generate task names" is off will see no effect at all.
Consider disabling the toggle (and adding an explanatory note) when taskSettings.autoGenerateName is false, e.g.:
const isDisabled = taskSettings.loading || taskSettings.saving || !taskSettings.autoGenerateName;
// …
<Switch
checked={taskSettings.autoInferTaskNames}
disabled={isDisabled}
onCheckedChange={taskSettings.updateAutoInferTaskNames}
/>
{!taskSettings.autoGenerateName && (
<p className="text-xs text-muted-foreground">
Requires "Auto-generate task names" to be enabled.
</p>
)}|
Thanks for taking this on! |
|
Small follow-up from my review: I think this setting should stay opt-out rather than opt-in. The existing auto-inferred naming behavior should be preserved for both new installs and upgrading users, with the new toggle serving as the explicit opt-out. Concretely, \ should default to , and the normalization fallback should also resolve missing values to . I made that adjustment locally while testing; the rest of the toggle wiring looks good. |
Summary
This PR introduces a user setting to toggle the auto-inferred task naming feature (originally from #1033) on and off.
By default, the setting is OFF (
autoInferTaskNames: false), meaning task names will instantly generate using the standard random name generator, providing a zero-latency experience. When toggled ON, the application will use the conversation context to auto-infer the task name after the initial prompt.The new toggle is located in the General Settings tab (
AutoInferTaskNamesRow), and the logic gates the existinggenerateTaskNameFromContextand post-creation auto-rename triggers behind this new JSON preference.Fixes
Fixes #1214
Type of change
Mandatory Tasks
Checklist
pnpm run format)pnpm run lint)