better movement

This commit is contained in:
filipriec
2025-04-16 16:30:11 +02:00
parent d0e2f31ce8
commit 04a7d86636
5 changed files with 224 additions and 66 deletions

View File

@@ -39,6 +39,7 @@ use crate::modes::{
highlight::highlight,
general::{navigation, dialog},
};
use crate::functions::modes::navigation::admin_nav;
use crate::config::binds::key_sequences::KeySequenceTracker;
#[derive(Debug, Clone, PartialEq, Eq)]
@@ -159,6 +160,19 @@ impl EventHandler {
match current_mode {
AppMode::General => {
// Prioritize Admin Panel navigation if it's visible
if app_state.ui.show_admin {
if admin_nav::handle_admin_navigation(
key,
config,
app_state,
admin_state,
&mut self.command_message,
) {
return Ok(EventOutcome::Ok(self.command_message.clone()));
}
}
let nav_outcome = navigation::handle_navigation_event(
key,
config,
@@ -179,10 +193,9 @@ impl EventHandler {
UiContext::Intro => {
intro::handle_intro_selection(app_state, buffer_state, index);
if app_state.ui.show_admin {
let profile_names = app_state.profile_tree.profiles.iter()
.map(|p| p.name.clone())
.collect();
admin_state.set_profiles(profile_names);
if !app_state.profile_tree.profiles.is_empty() {
admin_state.profile_list_state.select(Some(0));
}
}
message = format!("Intro Option {} selected", index);
}