commit 4467bf09202999078f23c100073ad357dfff6640
parent be140bc70563f6eeb6d30a90d48e3f092ce6535a
Author: William Casarin <jb55@jb55.com>
Date: Mon, 16 Feb 2026 15:40:48 -0800
suppress auto-steal focus while user is typing
Prevent jarring session switches by checking if the active session
has non-empty input. Auto-steal resumes after the message is sent.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Diffstat:
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/crates/notedeck_dave/src/lib.rs b/crates/notedeck_dave/src/lib.rs
@@ -1382,13 +1382,19 @@ impl notedeck::App for Dave {
let status_iter = self.session_manager.iter().map(|s| (s.id, s.status()));
self.focus_queue.update_from_statuses(status_iter);
+ // Suppress auto-steal while the user is typing (non-empty input)
+ let user_is_typing = self
+ .session_manager
+ .get_active()
+ .is_some_and(|s| !s.input.is_empty());
+
// Process auto-steal focus mode
let stole_focus = update::process_auto_steal_focus(
&mut self.session_manager,
&mut self.focus_queue,
&mut self.scene,
self.show_scene,
- self.auto_steal_focus,
+ self.auto_steal_focus && !user_is_typing,
&mut self.home_session,
);