From b89554b08135bed454f479d2770ab6b7b762ed21 Mon Sep 17 00:00:00 2001 From: Clawdbot Date: Wed, 28 Jan 2026 15:42:01 +0100 Subject: [PATCH] feat(ui): Escape key to stop generation in Chat tab Press Escape while generation is running to stop it (same as clicking Stop). Also shows 'Esc' keyboard hint on the Stop button. Changes: - ui/src/ui/views/chat.ts: Add keydown handler for Escape, show kbd hint --- ui/src/ui/views/chat.ts | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/ui/src/ui/views/chat.ts b/ui/src/ui/views/chat.ts index f5fb6e80b..9129717e5 100644 --- a/ui/src/ui/views/chat.ts +++ b/ui/src/ui/views/chat.ts @@ -240,7 +240,16 @@ export function renderChat(props: ChatProps) { `; return html` -
+
{ + if (e.key === "Escape" && canAbort && props.onAbort) { + e.preventDefault(); + props.onAbort(); + } + }} + > ${props.disabledReason ? html`
${props.disabledReason}
` : nothing} @@ -359,7 +368,9 @@ export function renderChat(props: ChatProps) { ?disabled=${!props.connected || (!canAbort && props.sending)} @click=${canAbort ? props.onAbort : props.onNewSession} > - ${canAbort ? "Stop" : "New session"} + ${canAbort ? "Stop" : "New session"}${canAbort + ? html`Esc` + : nothing}