notedeck

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

commit e064961ad518a31df01af79ba0605cf9d4ef9436
parent 67ec29b1febcbf786c4d77700ed976adca5e01bf
Author: William Casarin <jb55@jb55.com>
Date:   Mon,  9 Feb 2026 11:25:56 -0800

dave: require Ctrl modifier for picker keyboard shortcuts

Keyboard shortcuts (1-9, B, N) now require Ctrl to be held, preventing
them from intercepting keystrokes intended for the path TextEdit input.
This matches the existing UI behavior where keybind hints only appear
when Ctrl is held.

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

Diffstat:
Mcrates/notedeck_dave/src/ui/directory_picker.rs | 40++++++++++++++++++++++------------------
Mcrates/notedeck_dave/src/ui/session_picker.rs | 53+++++++++++++++++++++++++++++------------------------
2 files changed, 51 insertions(+), 42 deletions(-)

diff --git a/crates/notedeck_dave/src/ui/directory_picker.rs b/crates/notedeck_dave/src/ui/directory_picker.rs @@ -105,28 +105,32 @@ impl DirectoryPicker { let is_narrow = notedeck::ui::is_narrow(ui.ctx()); let ctrl_held = ui.input(|i| i.modifiers.ctrl); - // Handle keyboard shortcuts for recent directories (1-9) - for (idx, path) in self.recent_directories.iter().take(9).enumerate() { - let key = match idx { - 0 => egui::Key::Num1, - 1 => egui::Key::Num2, - 2 => egui::Key::Num3, - 3 => egui::Key::Num4, - 4 => egui::Key::Num5, - 5 => egui::Key::Num6, - 6 => egui::Key::Num7, - 7 => egui::Key::Num8, - 8 => egui::Key::Num9, - _ => continue, - }; - if ui.input(|i| i.key_pressed(key)) { - return Some(DirectoryPickerAction::DirectorySelected(path.clone())); + // Handle keyboard shortcuts for recent directories (Ctrl+1-9) + // Only trigger when Ctrl is held to avoid intercepting TextEdit input + if ctrl_held { + for (idx, path) in self.recent_directories.iter().take(9).enumerate() { + let key = match idx { + 0 => egui::Key::Num1, + 1 => egui::Key::Num2, + 2 => egui::Key::Num3, + 3 => egui::Key::Num4, + 4 => egui::Key::Num5, + 5 => egui::Key::Num6, + 6 => egui::Key::Num7, + 7 => egui::Key::Num8, + 8 => egui::Key::Num9, + _ => continue, + }; + if ui.input(|i| i.key_pressed(key)) { + return Some(DirectoryPickerAction::DirectorySelected(path.clone())); + } } } - // Handle B key for browse (track whether we need to trigger it) + // Handle Ctrl+B key for browse (track whether we need to trigger it) + // Only trigger when Ctrl is held to avoid intercepting TextEdit input let trigger_browse = - ui.input(|i| i.key_pressed(egui::Key::B)) && self.pending_folder_pick.is_none(); + ctrl_held && ui.input(|i| i.key_pressed(egui::Key::B)) && self.pending_folder_pick.is_none(); // Full panel frame egui::Frame::new() diff --git a/crates/notedeck_dave/src/ui/session_picker.rs b/crates/notedeck_dave/src/ui/session_picker.rs @@ -80,36 +80,41 @@ impl SessionPicker { let is_narrow = notedeck::ui::is_narrow(ui.ctx()); let ctrl_held = ui.input(|i| i.modifiers.ctrl); - // Handle keyboard shortcuts for sessions (1-9) - for (idx, session) in self.sessions.iter().take(9).enumerate() { - let key = match idx { - 0 => egui::Key::Num1, - 1 => egui::Key::Num2, - 2 => egui::Key::Num3, - 3 => egui::Key::Num4, - 4 => egui::Key::Num5, - 5 => egui::Key::Num6, - 6 => egui::Key::Num7, - 7 => egui::Key::Num8, - 8 => egui::Key::Num9, - _ => continue, - }; - if ui.input(|i| i.key_pressed(key)) { - return Some(SessionPickerAction::ResumeSession { - cwd, - session_id: session.session_id.clone(), - title: session.summary.clone(), - }); + // Handle keyboard shortcuts for sessions (Ctrl+1-9) + // Only trigger when Ctrl is held to avoid intercepting TextEdit input + if ctrl_held { + for (idx, session) in self.sessions.iter().take(9).enumerate() { + let key = match idx { + 0 => egui::Key::Num1, + 1 => egui::Key::Num2, + 2 => egui::Key::Num3, + 3 => egui::Key::Num4, + 4 => egui::Key::Num5, + 5 => egui::Key::Num6, + 6 => egui::Key::Num7, + 7 => egui::Key::Num8, + 8 => egui::Key::Num9, + _ => continue, + }; + if ui.input(|i| i.key_pressed(key)) { + return Some(SessionPickerAction::ResumeSession { + cwd, + session_id: session.session_id.clone(), + title: session.summary.clone(), + }); + } } } - // Handle N key for new session - if ui.input(|i| i.key_pressed(egui::Key::N)) { + // Handle Ctrl+N key for new session + // Only trigger when Ctrl is held to avoid intercepting TextEdit input + if ctrl_held && ui.input(|i| i.key_pressed(egui::Key::N)) { return Some(SessionPickerAction::NewSession { cwd }); } - // Handle Escape/B key to go back - if ui.input(|i| i.key_pressed(egui::Key::Escape) || i.key_pressed(egui::Key::B)) { + // Handle Escape key or Ctrl+B to go back + // B key requires Ctrl to avoid intercepting TextEdit input + if ui.input(|i| i.key_pressed(egui::Key::Escape)) || (ctrl_held && ui.input(|i| i.key_pressed(egui::Key::B))) { return Some(SessionPickerAction::BackToDirectoryPicker); }