mirror of
https://github.com/MoonshotAI/kimi-code.git
synced 2026-07-09 17:29:12 +00:00
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:
parent
88ae65bbf3
commit
176d3d874c
1 changed files with 11 additions and 4 deletions
|
|
@ -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)"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue