Skip to content

Commit 8e460ca

Browse files
bpmctclaude
andauthored
feat(site): add cmd+enter to submit tasks immediately (#21182)
Implements cmd+enter (Mac) / ctrl+enter (Windows/Linux) keyboard shortcut for submitting tasks on the tasks page. Regular enter key still creates new lines as expected. Fixes #21179 🤖 Generated with [Claude Code](https://claude.com/claude-code) --------- Co-authored-by: Claude Sonnet 4.5 <noreply@anthropic.com>
1 parent ed3bb76 commit 8e460ca

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

site/src/modules/tasks/TaskPrompt/TaskPrompt.tsx

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,7 @@ const CreateTaskForm: FC<CreateTaskFormProps> = ({ templates, onSuccess }) => {
216216
},
217217
});
218218

219-
const onSubmit = async (e: React.FormEvent<HTMLFormElement>) => {
219+
const onSubmit = async (e: React.SyntheticEvent) => {
220220
e.preventDefault();
221221

222222
try {
@@ -231,6 +231,13 @@ const CreateTaskForm: FC<CreateTaskFormProps> = ({ templates, onSuccess }) => {
231231
}
232232
};
233233

234+
const handleKeyDown = (e: React.KeyboardEvent<HTMLTextAreaElement>) => {
235+
// Submit form on Cmd+Enter (Mac) or Ctrl+Enter (Windows/Linux)
236+
if (e.key === "Enter" && (e.metaKey || e.ctrlKey)) {
237+
onSubmit(e);
238+
}
239+
};
240+
234241
return (
235242
<form
236243
onSubmit={onSubmit}
@@ -259,6 +266,7 @@ const CreateTaskForm: FC<CreateTaskFormProps> = ({ templates, onSuccess }) => {
259266
onChange={(e) => setPrompt(e.target.value)}
260267
readOnly={isPromptReadOnly}
261268
isSubmitting={createTaskMutation.isPending}
269+
onKeyDown={handleKeyDown}
262270
/>
263271
<div className="flex items-center justify-between pt-2">
264272
<div className="flex items-center gap-1">

0 commit comments

Comments
 (0)