diff options
| author | Ogulcan Celik <ogulcancelik@gmail.com> | 2026-05-24 02:57:03 +0300 |
|---|---|---|
| committer | Ogulcan Celik <ogulcancelik@gmail.com> | 2026-05-24 02:59:39 +0300 |
| commit | 80a314a9089b28c1bfdc2cdf5196e9a2eb9f11ba (patch) | |
| tree | fca593cafa027f4283adcec80c2f8908ef79708e /src/app/mod.rs | |
| parent | a132a7c3b9ade3ad4636e03b1f0930b5fa711766 (diff) | |
feat: add session navigator
refs #157
Diffstat (limited to 'src/app/mod.rs')
| -rw-r--r-- | src/app/mod.rs | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/src/app/mod.rs b/src/app/mod.rs index cfd5b5f8..8a981226 100644 --- a/src/app/mod.rs +++ b/src/app/mod.rs @@ -401,6 +401,7 @@ impl App { } }), keybind_help: state::KeybindHelpState { scroll: 0 }, + navigator: state::NavigatorState::default(), workspace_scroll: 0, agent_panel_scroll: 0, tab_scroll: 0, @@ -1224,6 +1225,9 @@ impl App { Mode::Settings => { self.handle_settings_key(key_event); } + Mode::Navigator => { + input::handle_navigator_key(&mut self.state, key_event); + } Mode::Terminal => { // Should not be called in terminal mode. } @@ -1473,7 +1477,7 @@ mod tests { std::fs::create_dir_all(path.parent().unwrap()).unwrap(); std::fs::write( &path, - "[terminal]\ndefault_shell = \"nu\"\nnew_cwd = \"home\"\n[keys]\nnew_workspace = \"prefix+g\"\nprefix = \"ctrl+a\"\n[ui]\nagent_panel_scope = \"current\"\n[ui.toast]\ndelivery = \"herdr\"\n", + "[terminal]\ndefault_shell = \"nu\"\nnew_cwd = \"home\"\n[keys]\nnew_workspace = \"prefix+m\"\nprefix = \"ctrl+a\"\n[ui]\nagent_panel_scope = \"current\"\n[ui.toast]\ndelivery = \"herdr\"\n", ) .unwrap(); std::env::set_var(crate::config::CONFIG_PATH_ENV_VAR, &path); @@ -1488,7 +1492,7 @@ mod tests { .state .keybinds .new_workspace - .matches_prefix(&KeyEvent::new(KeyCode::Char('g'), KeyModifiers::empty()))); + .matches_prefix(&KeyEvent::new(KeyCode::Char('m'), KeyModifiers::empty()))); assert_eq!( app.state.toast_config.delivery, crate::config::ToastDelivery::Herdr @@ -1703,7 +1707,7 @@ mod tests { std::fs::create_dir_all(path.parent().unwrap()).unwrap(); std::fs::write( &path, - "[keys]\nnew_workspace = \"prefix+g\"\n[ui.toast]\ndelivery = \"desktop\"\n", + "[keys]\nnew_workspace = \"prefix+m\"\n[ui.toast]\ndelivery = \"desktop\"\n", ) .unwrap(); std::env::set_var(crate::config::CONFIG_PATH_ENV_VAR, &path); @@ -1717,7 +1721,7 @@ mod tests { .state .keybinds .new_workspace - .matches_prefix(&KeyEvent::new(KeyCode::Char('g'), KeyModifiers::empty()))); + .matches_prefix(&KeyEvent::new(KeyCode::Char('m'), KeyModifiers::empty()))); assert_eq!( app.state.toast_config.delivery, crate::config::ToastDelivery::Herdr |
