Explorar o código

enh: esc to stop response

Timothy Jaeryang Baek hai 7 meses
pai
achega
01649fad64
Modificáronse 1 ficheiros con 7 adicións e 0 borrados
  1. 7 0
      src/lib/components/chat/MessageInput.svelte

+ 7 - 0
src/lib/components/chat/MessageInput.svelte

@@ -710,6 +710,10 @@
 													const commandsContainerElement =
 														document.getElementById('commands-container');
 
+													if (e.key === 'Escape') {
+														stopResponse();
+													}
+
 													// Command/Ctrl + Shift + Enter to submit a message pair
 													if (isCtrlPressed && e.key === 'Enter' && e.shiftKey) {
 														e.preventDefault();
@@ -893,6 +897,9 @@
 												const commandsContainerElement =
 													document.getElementById('commands-container');
 
+												if (e.key === 'Escape') {
+													stopResponse();
+												}
 												// Command/Ctrl + Shift + Enter to submit a message pair
 												if (isCtrlPressed && e.key === 'Enter' && e.shiftKey) {
 													e.preventDefault();