Skip to content

Commit 802cb42

Browse files
bpmctclaude
andcommitted
feat: Add cmd+enter to submit tasks immediately
Implements cmd+enter (Mac) / ctrl+enter (Windows/Linux) keyboard shortcut for submitting new tasks on the tasks page. Regular enter still creates a new line in the textarea. Fixes #21179 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
1 parent 3a0e8af commit 802cb42

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

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

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -468,10 +468,27 @@ const PromptTextarea: FC<PromptTextareaProps> = ({
468468
isSubmitting,
469469
...props
470470
}) => {
471+
const handleKeyDown = (e: React.KeyboardEvent<HTMLTextAreaElement>) => {
472+
// Submit form on Cmd+Enter (Mac) or Ctrl+Enter (Windows/Linux)
473+
if (e.key === "Enter" && (e.metaKey || e.ctrlKey)) {
474+
e.preventDefault();
475+
// Trigger form submission by finding the closest form and submitting it
476+
const form = e.currentTarget.closest("form");
477+
if (form) {
478+
form.requestSubmit();
479+
}
480+
}
481+
// Call the original onKeyDown if it exists
482+
if (props.onKeyDown) {
483+
props.onKeyDown(e);
484+
}
485+
};
486+
471487
return (
472488
<div className="relative">
473489
<TextareaAutosize
474490
{...props}
491+
onKeyDown={handleKeyDown}
475492
required
476493
id="prompt"
477494
name="prompt"

0 commit comments

Comments
 (0)