From b78374e81444b44b425863de36101b4e35c830da Mon Sep 17 00:00:00 2001 From: Benny Chen Date: Thu, 2 Oct 2025 08:04:03 -0700 Subject: [PATCH] directly hit enter to select --- eval_protocol/cli_commands/upload.py | 20 +++++++------------- 1 file changed, 7 insertions(+), 13 deletions(-) diff --git a/eval_protocol/cli_commands/upload.py b/eval_protocol/cli_commands/upload.py index 44ff6607..455d6055 100644 --- a/eval_protocol/cli_commands/upload.py +++ b/eval_protocol/cli_commands/upload.py @@ -347,28 +347,22 @@ def _prompt_select_interactive(tests: list[DiscoveredTest]) -> list[DiscoveredTe choices = [] for idx, test in enumerate(tests, 1): choice_text = _format_test_choice(test, idx) - choices.append({"name": choice_text, "value": idx - 1, "checked": False}) + choices.append({"name": choice_text, "value": idx - 1}) print("\n") - print("šŸ’” Tip: Use ↑/↓ arrows to navigate, SPACE to select/deselect, ENTER when done") - print(" You can select multiple tests!\n") - selected_indices = questionary.checkbox( - "Select evaluation tests to upload:", + print("šŸ’” Tip: Use ↑/↓ arrows to navigate, press ENTER to select\n") + selected_index = questionary.select( + "Select evaluation test to upload:", choices=choices, style=custom_style, ).ask() - if selected_indices is None: # User pressed Ctrl+C + if selected_index is None: # User pressed Ctrl+C print("\nUpload cancelled.") return [] - if not selected_indices: - print("\nāš ļø No tests were selected.") - print(" Remember: Use SPACE bar to select tests, then press ENTER to confirm.") - return [] - - print(f"\nāœ“ Selected {len(selected_indices)} test(s)") - return [tests[i] for i in selected_indices] + print(f"\nāœ“ Selected: {_format_test_choice(tests[selected_index], selected_index + 1)}") + return [tests[selected_index]] except ImportError: # Fallback to simpler implementation