fix(content): allow installed list navigation while filter panel is open
This commit is contained in:
1 parent
28c0731478
commit
cef09e32ad
2 files changed
+27
No files matched your search
@@ -168,6 +168,28 @@ fn sort_panel_keeps_results_navigation_available() {
|
||||
assert!(state.search_due());
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn local_mode_panel_does_not_consume_list_navigation() {
|
||||
let mut state = DiscoveryState::new(ContentKind::Mod);
|
||||
state.list.entries = vec![
|
||||
project_entry(project("one"), None),
|
||||
project_entry(project("two"), None),
|
||||
];
|
||||
state.list.list_state.selected = Some(0);
|
||||
state.set_local_mode(true);
|
||||
|
||||
assert!(handle_key(&KeyEvent::from(KeyCode::Char('f')), &mut state));
|
||||
assert!(state.sort_panel_open);
|
||||
assert!(state.sort_panel_focused);
|
||||
assert!(handle_key(&KeyEvent::from(KeyCode::Char('h')), &mut state));
|
||||
assert!(!state.sort_panel_focused);
|
||||
|
||||
// In local mode j/k must be passed through (return false) so the caller
|
||||
// can navigate its own installed list.
|
||||
assert!(!handle_key(&KeyEvent::from(KeyCode::Char('j')), &mut state));
|
||||
assert!(!handle_key(&KeyEvent::from(KeyCode::Char('k')), &mut state));
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn filter_panel_applies_version_environment_and_category_filters() {
|
||||
let mut state = DiscoveryState::new(ContentKind::Mod);
|
||||
|
||||
@@ -2915,6 +2915,11 @@ pub fn handle_key(key_event: &KeyEvent, state: &mut DiscoveryState) -> bool {
|
||||
state.search.activate();
|
||||
return true;
|
||||
}
|
||||
if state.local_mode {
|
||||
// In local (Installed) mode the caller owns the list; don't navigate
|
||||
// the shared discovery list.
|
||||
return false;
|
||||
}
|
||||
if let Some(next) = page_key_direction(key_event) {
|
||||
if next {
|
||||
state.list.next_page()
|
||||
|
||||
Reference in new issue
Block a user