From 785b033cf4df43f98b245c22fb38422c652cda1e Mon Sep 17 00:00:00 2001 From: ethan Date: Tue, 9 Dec 2025 17:03:15 +1100 Subject: [PATCH] =?UTF-8?q?=F0=9F=A4=96=20fix:=20prevent=20escape=20from?= =?UTF-8?q?=20interrupting=20stream=20during=20message=20editing?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When editing a message while streaming, pressing Escape to cancel editing would also interrupt the active stream. This is the same issue fixed in PR #954 for workspace renaming. Added stopPropagation() in both code paths: - Non-vim mode: ChatInput's CANCEL_EDIT handler - Vim mode: VimTextArea's escapeInNormalMode handler This prevents the Escape keydown event from reaching the global stream interrupt handler in useAIViewKeybinds. _Generated with `mux`_ --- bun.lock | 1 + src/browser/components/ChatInput/index.tsx | 1 + src/browser/components/VimTextArea.tsx | 1 + 3 files changed, 3 insertions(+) diff --git a/bun.lock b/bun.lock index 2422a9d109..eedb7c1fbd 100644 --- a/bun.lock +++ b/bun.lock @@ -1,5 +1,6 @@ { "lockfileVersion": 1, + "configVersion": 0, "workspaces": { "": { "name": "mux", diff --git a/src/browser/components/ChatInput/index.tsx b/src/browser/components/ChatInput/index.tsx index 6def801975..97aba4f191 100644 --- a/src/browser/components/ChatInput/index.tsx +++ b/src/browser/components/ChatInput/index.tsx @@ -1231,6 +1231,7 @@ export const ChatInput: React.FC = (props) => { if (matchesKeybind(e, KEYBINDS.CANCEL_EDIT)) { if (variant === "workspace" && editingMessage && props.onCancelEdit && !vimEnabled) { e.preventDefault(); + e.stopPropagation(); // Prevent global handler from interrupting stream setDraft(preEditDraftRef.current); props.onCancelEdit(); const isFocused = document.activeElement === inputRef.current; diff --git a/src/browser/components/VimTextArea.tsx b/src/browser/components/VimTextArea.tsx index a7af5148a9..cd66819692 100644 --- a/src/browser/components/VimTextArea.tsx +++ b/src/browser/components/VimTextArea.tsx @@ -166,6 +166,7 @@ export const VimTextArea = React.forwardRef