Refactor shortcut handling for regenerate response

This commit is contained in:
Zyfax 2025-12-11 10:51:56 +01:00 committed by GitHub
parent 64194f255c
commit a4ad6bead6
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -246,7 +246,10 @@
console.log('Shortcut triggered: GENERATE_MESSAGE_PAIR');
event.preventDefault();
document.getElementById('generate-message-pair-button')?.click();
} else if (isShortcutMatch(event, shortcuts[Shortcut.REGENERATE_RESPONSE]) && document.activeElement?.id === 'chat-input') {
} else if (
isShortcutMatch(event, shortcuts[Shortcut.REGENERATE_RESPONSE]) &&
document.activeElement?.id === 'chat-input'
) {
console.log('Shortcut triggered: REGENERATE_RESPONSE');
event.preventDefault();
[...document.getElementsByClassName('regenerate-response-button')]?.at(-1)?.click();