The best way to control Claude Code, Codex and more from any computer or phone
Mirrored from https://github.com/Camo67/t3code.git
Synced Nov 21, 03:37 UTC
feat(web): add a composerEmpty keybinding condition (#30644)
Co-authored-by: Julius Marminge <julius0216@outlook.com>
bfg14 committed
Nov 21, 2026 at 06:33 UTC
342b58a79ff0371149d6739ab32788dc93316fe4
3 files changed
+20
-2
apps/web/src/components/ChatView.tsx
+6
@@ -2785,6 +2785,12 @@ export default function ChatView(props: ChatViewProps) {
2785
isInSideChatPane(document.activeElement) === embedded,
2786
draftThreadRoute: routeKind === "draft",
2787
turnRunning: phase === "running" || phase === "connecting",
2788
+ // A queued-message edit or a question's answer owns the composer even when its text is empty.
2789
+ composerEmpty:
2790
+ !queuedRunEdit.isEditing &&
2791
+ pendingUserInputs.length === 0 &&
2792
+ !composerHasNonPromptContent &&
2793
+ promptRef.current.trim().length === 0,
2794
composerRequiresModifier: composerRequiresModifier(settings.sendShortcut, promptRef.current),
2795
isWeb: !isElectron,
2796
isDesktop: isElectron,
docs/user/composer.md
+11
-1
@@ -77,7 +77,17 @@ Use `Cmd+Shift+Enter` on macOS or `Ctrl+Shift+Enter` on Windows and Linux to sen
77
the oldest queued message as a steer. This leaves the current draft intact and
78
requires an active turn that supports steering. If that shortcut sends the opposite
79
action for your draft, move focus outside the composer to steer the queued message. Change
80
-`thread.steerQueuedMessage` in **Settings → Keybindings** to use another shortcut.
80
+`thread.steerQueuedMessage` in **Settings → Keybindings** to use another shortcut. To make
81
+`Cmd+Enter` or `Ctrl+Enter` steer the oldest queued message when the composer is empty, add
82
+this rule to your [keybindings file](keybindings.md#edit-the-configuration-file):
83
+
84
+```json
85
+{
86
+ "key": "mod+enter",
87
+ "command": "thread.steerQueuedMessage",
88
+ "when": "composerFocus && turnRunning && composerEmpty"
89
+}
90
+```
91
92
Press `Option+Up` on macOS or `Alt+Up` on Windows and Linux with the cursor at the
93
start of the composer to edit the most recently queued message. Change
docs/user/keybindings.md
+3
-1
@@ -128,10 +128,12 @@ Join modifiers and a key with `+`, such as `mod+shift+d` or `ctrl+l`.
128
129
Available context keys are `terminalFocus`, `terminalOpen`, `previewFocus`,
130
`previewOpen`, `rightPanelOpen`, `modelPickerOpen`, `usagePageOpen`, `composerFocus`,
131
-`draftThreadRoute`, `turnRunning`, `editableFocus`, `isWeb`, and `isDesktop`.
131
+`draftThreadRoute`, `turnRunning`, `composerEmpty`, `editableFocus`, `isWeb`, and `isDesktop`.
132
In a thread, `rightPanelOpen` is true while its right panel is open; the default
133
`mod+t` uses it to open the panel's new-tab menu.
134
`draftThreadRoute` is true on a draft thread, including a restored draft, until it is first sent.
135
+`composerEmpty` is true while the composer has no text, attachments, or context, and is not
136
+editing a queued message or answering a question.
137
`editableFocus` is true while a text field, the composer, or another editor has
138
the keyboard. `isWeb` is true in a browser tab. `isDesktop` is true in the
139
desktop app. Unknown keys evaluate to `false`.