working perfectly well admin panel for admin

This commit is contained in:
filipriec
2025-04-22 18:17:41 +02:00
parent 097264040f
commit 6f22aad6f4
2 changed files with 9 additions and 28 deletions

View File

@@ -67,19 +67,9 @@ pub fn handle_admin_navigation(
*command_message = "Navigated profiles list".to_string();
}
}
AdminFocus::Tables => { // Navigate highlight when focus is on the block
// Updates table navigation state
if let Some(nav_profile_idx) = admin_state.profile_list_state.selected() {
if let Some(profile) = app_state.profile_tree.profiles.get(nav_profile_idx) {
let table_count = profile.tables.len();
if table_count > 0 {
admin_state.previous_table(table_count);
*command_message = "Navigated tables list".to_string();
} else {
*command_message = "No tables in selected profile".to_string();
}
}
}
AdminFocus::Tables => {
// Do nothing when focus is on the Tables pane itself
*command_message = "Press Enter to select and scroll tables".to_string();
}
AdminFocus::InsideTablesList => { // Scroll inside
if let Some(p_idx) = admin_state.profile_list_state.selected().or(admin_state.selected_profile_index) { // Use nav or persistent selection
@@ -100,18 +90,9 @@ pub fn handle_admin_navigation(
*command_message = "Navigated profiles list".to_string();
}
}
AdminFocus::Tables => { // Navigate highlight when focus is on the block
if let Some(nav_profile_idx) = admin_state.profile_list_state.selected() {
if let Some(profile) = app_state.profile_tree.profiles.get(nav_profile_idx) {
let table_count = profile.tables.len();
if table_count > 0 {
admin_state.next_table(table_count);
*command_message = "Navigated tables list".to_string();
}
} else {
*command_message = "No tables in selected profile".to_string();
}
}
AdminFocus::Tables => {
// Do nothing when focus is on the Tables pane itself
*command_message = "Press Enter to select and scroll tables".to_string();
}
AdminFocus::InsideTablesList => { // Scroll inside
if let Some(p_idx) = admin_state.profile_list_state.selected().or(admin_state.selected_profile_index) { // Use nav or persistent selection