feat(ui): add enter-to-submit toggle for prompt input

This commit is contained in:
Shantur Rathore
2026-02-07 19:18:39 +00:00
parent ca28f503b7
commit e0bb867948
11 changed files with 128 additions and 7 deletions

View File

@@ -31,6 +31,7 @@ export interface UseCommandsOptions {
toggleShowTimelineTools: () => void
toggleUsageMetrics: () => void
toggleAutoCleanupBlankSessions: () => void
togglePromptSubmitOnEnter: () => void
setDiffViewMode: (mode: "split" | "unified") => void
setToolOutputExpansion: (mode: ExpansionPreference) => void
setDiagnosticsExpansion: (mode: ExpansionPreference) => void
@@ -423,6 +424,18 @@ export function useCommands(options: UseCommandsOptions) {
},
})
commandRegistry.register({
id: "prompt-submit-shortcut",
label: () =>
options.preferences().promptSubmitOnEnter
? tGlobal("commands.promptSubmitShortcut.label.swapped")
: tGlobal("commands.promptSubmitShortcut.label.default"),
description: () => tGlobal("commands.promptSubmitShortcut.description"),
category: "Input & Focus",
keywords: () => splitKeywords("commands.promptSubmitShortcut.keywords"),
action: options.togglePromptSubmitOnEnter,
})
commandRegistry.register({
id: "thinking",
label: () => tGlobal(options.preferences().showThinkingBlocks ? "commands.thinkingBlocks.label.hide" : "commands.thinkingBlocks.label.show"),

View File

@@ -82,6 +82,11 @@ export const commandMessages = {
"commands.clearInput.description": "Clear the prompt textarea",
"commands.clearInput.keywords": "clear, reset",
"commands.promptSubmitShortcut.label.default": "Enter: New Line, Cmd/Ctrl+Enter: Submit Prompt",
"commands.promptSubmitShortcut.label.swapped": "Enter: Submit Prompt, Cmd/Ctrl+Enter: New Line",
"commands.promptSubmitShortcut.description": "Swap Enter and Cmd/Ctrl+Enter behavior in the prompt input",
"commands.promptSubmitShortcut.keywords": "enter, cmd, ctrl, submit, send, newline, shortcut, keybind, prompt",
"commands.thinkingBlocks.label.show": "Show Thinking",
"commands.thinkingBlocks.label.hide": "Hide Thinking",
"commands.thinkingBlocks.description": "Show or hide AI thinking sections",

View File

@@ -82,6 +82,11 @@ export const commandMessages = {
"commands.clearInput.description": "Borrar el área de texto del prompt",
"commands.clearInput.keywords": "limpiar, reiniciar",
"commands.promptSubmitShortcut.label.default": "Enter: Nueva linea, Cmd/Ctrl+Enter: Enviar prompt",
"commands.promptSubmitShortcut.label.swapped": "Enter: Enviar prompt, Cmd/Ctrl+Enter: Nueva linea",
"commands.promptSubmitShortcut.description": "Intercambiar el comportamiento de Enter y Cmd/Ctrl+Enter en la entrada de prompt",
"commands.promptSubmitShortcut.keywords": "enter, enviar, salto de linea, atajo, teclado, cmd, ctrl, prompt",
"commands.thinkingBlocks.label.show": "Mostrar pensamiento",
"commands.thinkingBlocks.label.hide": "Ocultar pensamiento",
"commands.thinkingBlocks.description": "Mostrar u ocultar secciones de pensamiento de IA",

View File

@@ -82,6 +82,11 @@ export const commandMessages = {
"commands.clearInput.description": "Effacer la zone de texte du prompt",
"commands.clearInput.keywords": "effacer, réinitialiser, prompt",
"commands.promptSubmitShortcut.label.default": "Entree: Nouvelle ligne, Cmd/Ctrl+Entree: Envoyer le prompt",
"commands.promptSubmitShortcut.label.swapped": "Entree: Envoyer le prompt, Cmd/Ctrl+Entree: Nouvelle ligne",
"commands.promptSubmitShortcut.description": "Echanger le comportement de Entree et Cmd/Ctrl+Entree dans la saisie du prompt",
"commands.promptSubmitShortcut.keywords": "entree, envoyer, nouvelle ligne, raccourci, cmd, ctrl, prompt",
"commands.thinkingBlocks.label.show": "Afficher la réflexion",
"commands.thinkingBlocks.label.hide": "Masquer la réflexion",
"commands.thinkingBlocks.description": "Afficher ou masquer les sections de réflexion de l'IA",

View File

@@ -82,6 +82,11 @@ export const commandMessages = {
"commands.clearInput.description": "プロンプト入力欄をクリア",
"commands.clearInput.keywords": "クリア, リセット, clear, reset",
"commands.promptSubmitShortcut.label.default": "Enter: 改行, Cmd/Ctrl+Enter: プロンプト送信",
"commands.promptSubmitShortcut.label.swapped": "Enter: プロンプト送信, Cmd/Ctrl+Enter: 改行",
"commands.promptSubmitShortcut.description": "プロンプト入力で Enter と Cmd/Ctrl+Enter の動作を入れ替え",
"commands.promptSubmitShortcut.keywords": "enter, 送信, 改行, ショートカット, cmd, ctrl, プロンプト",
"commands.thinkingBlocks.label.show": "思考を表示",
"commands.thinkingBlocks.label.hide": "思考を非表示",
"commands.thinkingBlocks.description": "AI の思考セクションを表示/非表示",

View File

@@ -82,6 +82,11 @@ export const commandMessages = {
"commands.clearInput.description": "Очистить поле prompt",
"commands.clearInput.keywords": "очистить, сброс",
"commands.promptSubmitShortcut.label.default": "Enter: Новая строка, Cmd/Ctrl+Enter: Отправить промпт",
"commands.promptSubmitShortcut.label.swapped": "Enter: Отправить промпт, Cmd/Ctrl+Enter: Новая строка",
"commands.promptSubmitShortcut.description": "Поменять местами Enter и Cmd/Ctrl+Enter в поле ввода промпта",
"commands.promptSubmitShortcut.keywords": "enter, отправить, новая строка, сочетание, cmd, ctrl, промпт",
"commands.thinkingBlocks.label.show": "Показать размышления",
"commands.thinkingBlocks.label.hide": "Скрыть размышления",
"commands.thinkingBlocks.description": "Показать или скрыть секции размышлений ИИ",

View File

@@ -82,6 +82,11 @@ export const commandMessages = {
"commands.clearInput.description": "清空 prompt 输入框",
"commands.clearInput.keywords": "clear, reset, 清空, 重置",
"commands.promptSubmitShortcut.label.default": "Enter: 换行, Cmd/Ctrl+Enter: 提交提示词",
"commands.promptSubmitShortcut.label.swapped": "Enter: 提交提示词, Cmd/Ctrl+Enter: 换行",
"commands.promptSubmitShortcut.description": "在提示词输入框中交换 Enter 与 Cmd/Ctrl+Enter 的行为",
"commands.promptSubmitShortcut.keywords": "enter, 换行, 提交, 发送, 快捷键, cmd, ctrl, 提示词",
"commands.thinkingBlocks.label.show": "显示思考",
"commands.thinkingBlocks.label.hide": "隐藏思考",
"commands.thinkingBlocks.description": "显示或隐藏 AI 思考部分",