diff options
| author | Ogulcan Celik <ogulcancelik@gmail.com> | 2026-05-05 18:32:14 +0300 |
|---|---|---|
| committer | Ogulcan Celik <ogulcancelik@gmail.com> | 2026-05-05 18:32:42 +0300 |
| commit | f7b0ee2f758440db3a3ff4cc727f879b420255d7 (patch) | |
| tree | 764149deada51f6196f3eecda46374ec45ff097a /src/app/input/navigate.rs | |
| parent | 6885c8873971d79332376137a14572f8440ef42e (diff) | |
feat: add mobile terminal layout
Diffstat (limited to 'src/app/input/navigate.rs')
| -rw-r--r-- | src/app/input/navigate.rs | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/src/app/input/navigate.rs b/src/app/input/navigate.rs index d55eedea..546228cc 100644 --- a/src/app/input/navigate.rs +++ b/src/app/input/navigate.rs @@ -650,6 +650,24 @@ mod tests { } #[test] + fn mobile_workspace_keyboard_navigation_keeps_selected_row_visible() { + let mut state = state_with_workspaces(&["a", "b", "c", "d"]); + state.active = Some(0); + state.selected = 0; + state.mode = Mode::Navigate; + crate::ui::compute_view(&mut state, ratatui::layout::Rect::new(0, 0, 44, 8)); + assert_eq!(state.mobile_switcher_scroll, 0); + + handle_navigate_key( + &mut state, + KeyEvent::new(KeyCode::Down, KeyModifiers::empty()), + ); + + assert_eq!(state.selected, 1); + assert_eq!(state.mobile_switcher_scroll, 1); + } + + #[test] fn terminal_direct_focus_pane_shortcut_maps_to_navigation_action() { let mut state = state_with_workspaces(&["test"]); state.keybinds.focus_pane_left = Some((KeyCode::Left, KeyModifiers::ALT)); |
