feat(web): consistent feedback for manual agent interrupt

Manual interrupt already worked (Esc key + the composer's stop button, both
wired to abortCurrentPrompt), but only the Esc path showed the 'aborted' toast —
clicking stop aborted silently. Route both paths through a single handleInterrupt
so the stop button gives the same toast feedback as Esc.
This commit is contained in:
qer 2026-06-13 12:01:18 +08:00
parent 88ae65bbf3
commit 176d3d874c

View file

@ -512,11 +512,18 @@ function showAbortToast(): void {
}, ABORT_TOAST_DURATION);
}
// Single entry point for manual interrupt so the Escape key and the composer's
// stop button give the SAME feedback (the toast). Previously only Escape showed
// it, so clicking stop aborted silently.
function handleInterrupt(): void {
showAbortToast();
emit('interrupt');
}
function onKeyDown(event: KeyboardEvent): void {
if (event.key === 'Escape' && (props.running || props.sending)) {
event.preventDefault();
showAbortToast();
emit('interrupt');
handleInterrupt();
}
}
@ -615,7 +622,7 @@ onUnmounted(() => {
@submit="handleComposerSubmit"
@steer="emit('steer', $event)"
@command="emit('command', $event)"
@interrupt="emit('interrupt')"
@interrupt="handleInterrupt"
@unqueue="emit('unqueue', $event)"
@edit-queued="emit('editQueued', $event)"
@set-permission="emit('setPermission', $event)"
@ -802,7 +809,7 @@ onUnmounted(() => {
@submit="handleComposerSubmit"
@steer="emit('steer', $event)"
@command="emit('command', $event)"
@interrupt="emit('interrupt')"
@interrupt="handleInterrupt"
@unqueue="emit('unqueue', $event)"
@edit-queued="emit('editQueued', $event)"
@set-permission="emit('setPermission', $event)"