This commit is contained in:
Taras Lukavyi 2026-01-30 13:57:27 +01:00 committed by GitHub
commit 6b9f0cdaec
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -240,7 +240,16 @@ export function renderChat(props: ChatProps) {
`;
return html`
<section class="card chat">
<section
class="card chat"
tabindex="-1"
@keydown=${(e: KeyboardEvent) => {
if (e.key === "Escape" && canAbort && props.onAbort) {
e.preventDefault();
props.onAbort();
}
}}
>
${props.disabledReason
? html`<div class="callout">${props.disabledReason}</div>`
: 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`<kbd class="btn-kbd">Esc</kbd>`
: nothing}
</button>
<button
class="btn primary"