notedeck

One damus client to rule them all
git clone git://jb55.com/notedeck
Log | Files | Refs | README | LICENSE

commit 348454cb28d550b31d9a025c8be56f162ecb3253
parent 07ef281f75a0a5dad30a091f310b602b2d92e9a9
Author: William Casarin <jb55@jb55.com>
Date:   Mon, 26 Jan 2026 17:48:07 -0800

dave: add Escape key to interrupt AI operations

Escape now triggers interrupt even when text input has focus, allowing
users to stop AI operations at any time without needing to click the
Stop button.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

Diffstat:
Mcrates/notedeck_dave/src/lib.rs | 3+++
Mcrates/notedeck_dave/src/ui/keybindings.rs | 9++++++++-
2 files changed, 11 insertions(+), 1 deletion(-)

diff --git a/crates/notedeck_dave/src/lib.rs b/crates/notedeck_dave/src/lib.rs @@ -723,6 +723,9 @@ impl notedeck::App for Dave { KeyAction::NewAgent => { self.handle_new_chat(); } + KeyAction::Interrupt => { + self.handle_interrupt(ui); + } } } diff --git a/crates/notedeck_dave/src/ui/keybindings.rs b/crates/notedeck_dave/src/ui/keybindings.rs @@ -15,11 +15,18 @@ pub enum KeyAction { PreviousAgent, /// Spawn a new agent NewAgent, + /// Interrupt/stop the current AI operation + Interrupt, } /// Check for keybinding actions when no text input has focus pub fn check_keybindings(ctx: &egui::Context) -> Option<KeyAction> { - // Only process when no text input has focus + // Escape works even when text input has focus (to interrupt AI) + if ctx.input(|i| i.key_pressed(Key::Escape)) { + return Some(KeyAction::Interrupt); + } + + // Only process other keys when no text input has focus if ctx.wants_keyboard_input() { return None; }