Skip to content

Commit 589514c

Browse files
matt2eclaude
andauthored
feat(staged): add Cmd+Enter shortcut to submit commit from diff viewer (#631)
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 5ccde56 commit 589514c

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

apps/staged/src/lib/features/diff/DiffCommitSessionLauncher.svelte

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,14 @@
9999
syncTextareaHeight();
100100
}
101101
102+
function handleKeydown(e: KeyboardEvent) {
103+
// Cmd+Enter to submit
104+
if (e.key === 'Enter' && e.metaKey && draftPrompt.trim() && !starting) {
105+
e.preventDefault();
106+
handleSubmit();
107+
}
108+
}
109+
102110
function syncTextareaHeight() {
103111
if (!textareaElement) return;
104112
@@ -174,6 +182,7 @@
174182
rows="3"
175183
disabled={starting}
176184
oninput={handleInput}
185+
onkeydown={handleKeydown}
177186
items={hashtagItems}
178187
/>
179188
<div class="composer-footer">

0 commit comments

Comments
 (0)