From 7cf0f7d42d7780c2af4b1bda0e31da4332699724 Mon Sep 17 00:00:00 2001 From: zhayujie Date: Mon, 8 Jun 2026 15:48:21 +0800 Subject: [PATCH] fix(web): self-heal stuck Cancel send button --- channel/web/static/js/console.js | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/channel/web/static/js/console.js b/channel/web/static/js/console.js index fef64b76..42179fb8 100644 --- a/channel/web/static/js/console.js +++ b/channel/web/static/js/console.js @@ -1298,8 +1298,15 @@ sendBtn.addEventListener('click', () => { function updateSendBtnState() { if (sendBtnMode === 'cancel') { - // Don't downgrade a Cancel button on input edits. - return; + // Self-heal a stuck Cancel button: if there's no live stream backing + // the current request, the cancel state leaked (e.g. a stream ended + // without resetting). Recover to Send so the input isn't blocked. + if (!activeRequestId || !activeStreams[activeRequestId]) { + resetSendBtnSendMode(); + } else { + // Don't downgrade a genuinely active Cancel button on input edits. + return; + } } sendBtn.disabled = uploadingCount > 0 || (!chatInput.value.trim() && pendingAttachments.length === 0); }