@@ -443,49 +443,25 @@ def _prompt_select_interactive(tests: list[DiscoveredTest]) -> list[DiscoveredTe
443443 else :
444444 return []
445445
446- # Enter-only selection UX with optional multi-select via repeat
447- remaining_indices = list (range (len (tests )))
448- selected_indices : list [int ] = []
449-
446+ # Single-select UX
450447 print ("\n " )
451- print ("Tip: Use ↑/↓ arrows to navigate and press ENTER to select." )
452- print (" After selecting one, you can choose to add more.\n " )
453-
454- while remaining_indices :
455- # Build choices from remaining
456- choices = []
457- for idx , test_idx in enumerate (remaining_indices , 1 ):
458- t = tests [test_idx ]
459- choice_text = _format_test_choice (t , idx )
460- choices .append ({"name" : choice_text , "value" : test_idx })
461-
462- selected = questionary .select (
463- "Select an evaluation test to upload:" , choices = choices , style = custom_style
464- ).ask ()
465-
466- if selected is None : # Ctrl+C
467- print ("\n Upload cancelled." )
468- return []
448+ print ("Tip: Use ↑/↓ arrows to navigate and press ENTER to select.\n " )
469449
470- if isinstance (selected , int ):
471- selected_indices .append (selected )
472- # Remove from remaining
473- if selected in remaining_indices :
474- remaining_indices .remove (selected )
450+ choices = []
451+ for idx , t in enumerate (tests , 1 ):
452+ choice_text = _format_test_choice (t , idx )
453+ choices .append ({"name" : choice_text , "value" : idx - 1 })
475454
476- # Ask whether to add another (ENTER to finish)
477- add_more = questionary .confirm ("Add another?" , default = False , style = custom_style ).ask ()
478- if not add_more :
479- break
480- else :
481- break
455+ selected = questionary .select (
456+ "Select an evaluation test to upload:" , choices = choices , style = custom_style
457+ ).ask ()
482458
483- if not selected_indices :
484- print ("\n ⚠️ No tests were selected ." )
459+ if selected is None : # Ctrl+C
460+ print ("\n Upload cancelled ." )
485461 return []
486462
487- print (f "\n ✓ Selected { len ( selected_indices ) } test(s) " )
488- return [tests [i ] for i in selected_indices ]
463+ print ("\n ✓ Selected 1 test" )
464+ return [tests [selected ] ]
489465
490466 except ImportError :
491467 # Fallback to simpler implementation
@@ -524,22 +500,19 @@ def _prompt_select_fallback(tests: list[DiscoveredTest]) -> list[DiscoveredTest]
524500
525501 print ("=" * 80 )
526502 try :
527- choice = input ("Enter numbers to upload (comma or space-separated), or 'all' : " ).strip ()
503+ choice = input ("Enter the number to upload: " ).strip ()
528504 except KeyboardInterrupt :
529505 print ("\n \n Upload cancelled." )
530506 return []
531507
532- if choice .lower () in ("all" , "a" , "*" ):
533- return tests
534-
535- indices : list [int ] = []
536- for token in re .split (r"[\s,]+" , choice ):
537- if token .isdigit ():
538- n = int (token )
539- if 1 <= n <= len (tests ):
540- indices .append (n - 1 )
541- indices = sorted (set (indices ))
542- return [tests [i ] for i in indices ]
508+ if not choice .isdigit ():
509+ print ("\n ⚠️ Invalid selection." )
510+ return []
511+ n = int (choice )
512+ if not (1 <= n <= len (tests )):
513+ print ("\n ⚠️ Selection out of range." )
514+ return []
515+ return [tests [n - 1 ]]
543516
544517
545518def _prompt_select (tests : list [DiscoveredTest ], non_interactive : bool ) -> list [DiscoveredTest ]:
0 commit comments