From da246c4c4e23c9ad976705f9a3fa80e0d75b4425 Mon Sep 17 00:00:00 2001 From: soryu Date: Wed, 21 Jan 2026 15:58:34 +0000 Subject: Update CLI to show repo suggestions --- makima/src/daemon/tui/event.rs | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) (limited to 'makima/src/daemon/tui/event.rs') diff --git a/makima/src/daemon/tui/event.rs b/makima/src/daemon/tui/event.rs index 2fed55a..d5ca569 100644 --- a/makima/src/daemon/tui/event.rs +++ b/makima/src/daemon/tui/event.rs @@ -194,6 +194,30 @@ fn handle_create_mode(app: &App, key: KeyEvent) -> Action { } let current_field = app.create_state.current_field(); + let has_suggestions = app.create_state.show_suggestions + && !app.create_state.repo_suggestions.is_empty(); + + // Allow Ctrl+N/Ctrl+P to navigate suggestions from any field + if has_suggestions && key.modifiers.contains(KeyModifiers::CONTROL) { + match key.code { + KeyCode::Char('n') => return Action::CreateNextSuggestion, + KeyCode::Char('p') => return Action::CreatePrevSuggestion, + _ => {} + } + } + + // Special handling when on Repository field with suggestions visible + let on_repo_field = current_field == CreateFormField::Repository; + if has_suggestions && on_repo_field { + match key.code { + // Up/Down navigate suggestions when on repo field + KeyCode::Up => return Action::CreatePrevSuggestion, + KeyCode::Down => return Action::CreateNextSuggestion, + // Enter applies suggestion instead of submitting form + KeyCode::Enter => return Action::CreateApplySuggestion, + _ => {} + } + } match key.code { // Submit form -- cgit v1.2.3