agent: Add use_modifier_to_send setting (#34709)

When `use_modifier_to_send` is turned on, holding `cmd`/`ctrl` is
necessary to send a message in the agent panel. Text threads already use
`cmd-enter` by default to submit a message, and it was done this way to
have the usual text editing bindings not taken over when writing a
prompt, sort of stimulating more thoughtful writing. While `enter` to
send is still somewhat a huge pattern in chat-like LLM UIs, it still
makes sense to allow this for the new agent panel... hence the existence
of this setting now!

Release Notes:

- agent: Added the `use_modifier_to_send` setting, which makes holding a
modifier (`cmd`/`ctrl`), together with `enter`, required to send a new
message.
This commit is contained in:
Danilo Leal 2025-07-18 15:03:31 -03:00 committed by GitHub
parent 64ce696aae
commit e1d28ff957
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 66 additions and 4 deletions

View file

@ -277,7 +277,7 @@
}
},
{
"context": "MessageEditor > Editor",
"context": "MessageEditor > Editor && !use_modifier_to_send",
"bindings": {
"enter": "agent::Chat",
"ctrl-enter": "agent::ChatWithFollow",
@ -287,6 +287,17 @@
"ctrl-shift-n": "agent::RejectAll"
}
},
{
"context": "MessageEditor > Editor && use_modifier_to_send",
"bindings": {
"ctrl-enter": "agent::Chat",
"enter": "editor::Newline",
"ctrl-i": "agent::ToggleProfileSelector",
"shift-ctrl-r": "agent::OpenAgentDiff",
"ctrl-shift-y": "agent::KeepAll",
"ctrl-shift-n": "agent::RejectAll"
}
},
{
"context": "EditMessageEditor > Editor",
"bindings": {

View file

@ -318,7 +318,7 @@
}
},
{
"context": "MessageEditor > Editor",
"context": "MessageEditor > Editor && !use_modifier_to_send",
"use_key_equivalents": true,
"bindings": {
"enter": "agent::Chat",
@ -329,6 +329,18 @@
"cmd-shift-n": "agent::RejectAll"
}
},
{
"context": "MessageEditor > Editor && use_modifier_to_send",
"use_key_equivalents": true,
"bindings": {
"cmd-enter": "agent::Chat",
"enter": "editor::Newline",
"cmd-i": "agent::ToggleProfileSelector",
"shift-ctrl-r": "agent::OpenAgentDiff",
"cmd-shift-y": "agent::KeepAll",
"cmd-shift-n": "agent::RejectAll"
}
},
{
"context": "EditMessageEditor > Editor",
"use_key_equivalents": true,