From f7b0ee2f758440db3a3ff4cc727f879b420255d7 Mon Sep 17 00:00:00 2001 From: Ogulcan Celik Date: Tue, 5 May 2026 18:32:14 +0300 Subject: feat: add mobile terminal layout --- src/app/input/navigate.rs | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'src/app/input/navigate.rs') 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 @@ -649,6 +649,24 @@ mod tests { assert_eq!(state.mode, Mode::Navigate); } + #[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"]); -- cgit v1.2.3