This commit is contained in:
Timothy Jaeryang Baek 2026-10-16 03:28:17 +04:00
parent a8dd8dbf98
commit 9cf48f4fb0
4 changed files with 18 additions and 2 deletions

View file

@ -2278,7 +2278,10 @@
}
}
if (e.key === 'Escape') {
if (
$settings?.keyboardShortcuts !== false &&
matchKeybinding(e) === Shortcut.CLEAR_INPUT_SELECTIONS
) {
console.log('Escape');
atSelectedModel = undefined;
selectedToolIds = [];

View file

@ -76,7 +76,8 @@
};
const getConflict = (id: Shortcut, chord: string): Shortcut | null => {
if (!isConfigurableShortcut(id) || !chord) return null;
// Modals always close on Esc on their own, so sharing it is not a conflict
if (!isConfigurableShortcut(id) || !chord || chord === 'Escape') return null;
for (const [otherId, otherChord] of Object.entries($keybindings)) {
if (otherId !== id && otherChord === chord) return otherId as Shortcut;
}

View file

@ -3391,6 +3391,8 @@
"settings.personal.shortcuts.addPrompt.label": "Add Custom Prompt",
"settings.personal.shortcuts.allowToolCall.label": "Allow Tool Call",
"settings.personal.shortcuts.attachFile.label": "Attach File From Knowledge",
"settings.personal.shortcuts.clearInputSelections.description": "Remove the model override, deselect tools and filters, and turn off web search, image generation, and code interpreter. Only active when the chat input is in focus.",
"settings.personal.shortcuts.clearInputSelections.label": "Clear Input Selections",
"settings.personal.shortcuts.closeModal.label": "Close Modal",
"settings.personal.shortcuts.command.label": "Command",
"settings.personal.shortcuts.copyLastCodeBlock.label": "Copy Last Code Block",

View file

@ -36,6 +36,7 @@ export enum Shortcut {
//Input
FOCUS_INPUT = 'focusInput',
CLEAR_INPUT_SELECTIONS = 'clearInputSelections',
ACCEPT_AUTOCOMPLETE = 'acceptAutocomplete',
PREVENT_FILE_CREATION = 'preventFileCreation',
NAVIGATE_PROMPT_HISTORY_UP = 'navigatePromptHistoryUp',
@ -71,6 +72,7 @@ export const CONFIGURABLE_SHORTCUTS = [
Shortcut.TOGGLE_CONTROLS,
Shortcut.CLOSE_MODAL,
Shortcut.FOCUS_INPUT,
Shortcut.CLEAR_INPUT_SELECTIONS,
Shortcut.GENERATE_MESSAGE_PAIR,
Shortcut.REGENERATE_RESPONSE,
Shortcut.ALLOW_TOOL_CALL,
@ -97,6 +99,7 @@ export const DEFAULT_KEYBINDINGS: KeybindingsMap = {
[Shortcut.TOGGLE_CONTROLS]: '',
[Shortcut.CLOSE_MODAL]: 'Escape',
[Shortcut.FOCUS_INPUT]: 'Shift+Escape',
[Shortcut.CLEAR_INPUT_SELECTIONS]: 'Escape',
[Shortcut.GENERATE_MESSAGE_PAIR]: 'Cmd+Shift+Enter',
[Shortcut.REGENERATE_RESPONSE]: 'Cmd+R',
[Shortcut.ALLOW_TOOL_CALL]: 'Cmd+Alt+Enter',
@ -300,6 +303,13 @@ export const shortcuts: ShortcutRegistry = {
category: 'Input',
configurable: true
},
[Shortcut.CLEAR_INPUT_SELECTIONS]: {
name: (t) => t('settings.personal.shortcuts.clearInputSelections.label'),
keys: ['Escape'],
category: 'Input',
configurable: true,
tooltip: 'settings.personal.shortcuts.clearInputSelections.description'
},
[Shortcut.ACCEPT_AUTOCOMPLETE]: {
name: (t) => t('settings.personal.shortcuts.acceptAutocomplete.label'),
keys: ['Tab'],