working suggestions but position is wrong

This commit is contained in:
filipriec
2025-04-12 16:22:07 +02:00
parent f4d234089f
commit 7b27d00972
4 changed files with 22 additions and 58 deletions

View File

@@ -85,20 +85,17 @@ pub async fn handle_edit_event(
match action {
"suggestion_up" | "suggestion_down" => { // Mapped to Tab/Shift+Tab
if !register_state.in_suggestion_mode {
// Enter suggestion mode
register_state.update_role_suggestions(); // Populate suggestions
register_state.update_role_suggestions();
if !register_state.role_suggestions.is_empty() {
register_state.in_suggestion_mode = true;
register_state.show_role_suggestions = true;
register_state.selected_suggestion_index = Some(0); // Select first
return Ok("Suggestions shown".to_string()); // Consume the event
register_state.selected_suggestion_index = Some(0);
return Ok("Suggestions shown".to_string());
} else {
return Ok("No suggestions available".to_string()); // Consume, do nothing else
return Ok("No suggestions available".to_string());
}
}
// If already in suggestion mode, fall through to execute the action via auth_e
}
_ => {} // Other actions fall through
_ => {}
}
}
// --- End Special Handling ---