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}