diff options
| author | corrius <alvaro.correa@taxdown.es> | 2026-07-24 21:52:17 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-07-24 22:52:17 +0300 |
| commit | 38d2b0780c50e4773d6948660873386261cde71d (patch) | |
| tree | b899dd7ce1dfd1a70650be0209a48132c1539a25 /src/app/input/overlays.rs | |
| parent | e9b22084e03880f43d1f1daaf5d9f45c717b77c4 (diff) | |
feat: filter keybind help (#1832)
* feat: filter keybind help
refs #1825
* fix: recognize shifted slash in keybind help
---------
Co-authored-by: Ogulcan Celik <ogulcancelik@gmail.com>
Diffstat (limited to 'src/app/input/overlays.rs')
| -rw-r--r-- | src/app/input/overlays.rs | 31 |
1 files changed, 29 insertions, 2 deletions
diff --git a/src/app/input/overlays.rs b/src/app/input/overlays.rs index e9cf3139..58f2ef71 100644 --- a/src/app/input/overlays.rs +++ b/src/app/input/overlays.rs @@ -10,7 +10,7 @@ use crate::app::{ }; use super::{ - modal::{leave_modal, modal_action_from_buttons, ModalAction}, + modal::{keybind_help_back, leave_modal, modal_action_from_buttons, ModalAction}, ScrollbarClickTarget, }; @@ -197,7 +197,7 @@ impl App { .state .keybind_help_close_button_at(mouse.column, mouse.row) => { - leave_modal(&mut self.state); + keybind_help_back(&mut self.state); } MouseEventKind::Down(MouseButton::Left) => { if let Some(target) = self @@ -739,6 +739,33 @@ mod tests { } #[test] + fn clicking_keybind_help_back_button_leaves_help_open() { + let mut app = app_for_mouse_test(); + app.state.mode = Mode::KeybindHelp; + app.state.keybind_help.search_focused = true; + app.state.keybind_help.query = "work".into(); + + let rect = app.state.keybind_help_popup_rect(); + let inner = Rect::new( + rect.x + 1, + rect.y + 1, + rect.width.saturating_sub(2), + rect.height.saturating_sub(2), + ); + let back = + crate::ui::release_notes_close_button_rect(Rect::new(inner.x, inner.y, inner.width, 1)); + app.handle_mouse(mouse( + MouseEventKind::Down(MouseButton::Left), + back.x, + back.y, + )); + + assert_eq!(app.state.mode, Mode::KeybindHelp); + assert!(!app.state.keybind_help.search_focused); + assert!(app.state.keybind_help.query.is_empty()); + } + + #[test] fn onboarding_hover_does_not_change_selection() { let mut app = app_for_mouse_test(); app.state.mode = Mode::Onboarding; |
