Browse Source

enh: esc to stop response

Timothy Jaeryang Baek 4 months ago
parent
commit
01649fad64
1 changed files with 7 additions and 0 deletions
  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();