making select from the find file to work, not yet working, needs more redesign in how select is working

This commit is contained in:
filipriec
2025-06-06 23:44:29 +02:00
parent d0722fbbbe
commit 02c62213c3
4 changed files with 268 additions and 251 deletions

View File

@@ -340,12 +340,16 @@ pub async fn handle_command_navigation_event(
}
KeyCode::Enter => {
if let Some(selected_value) = navigation_state.get_selected_value() {
let message = match navigation_state.navigation_type {
NavigationType::FindFile => format!("Selected file: {}", selected_value),
NavigationType::TableTree => format!("Selected table: {}", selected_value),
let outcome = match navigation_state.navigation_type {
NavigationType::FindFile => {
EventOutcome::Ok(format!("Selected file: {}", selected_value))
}
NavigationType::TableTree => {
EventOutcome::TableSelected { path: selected_value }
}
};
navigation_state.deactivate();
Ok(EventOutcome::Ok(message))
Ok(outcome)
} else {
// Enhanced Enter behavior for TableTree: if input is a valid partial path, try to navigate
if navigation_state.navigation_type == NavigationType::TableTree && !navigation_state.input.is_empty() {