Status: Open
Priority: High
Component: lib/wsl/commands.ps1, lib/wsl/commands.Tests.ps1
Parent: SC-016
Depends on: SC-016a
Summary: As a user, I want to pick a distribution using arrow-key navigation so that I no longer need to type a number or name and press Enter.
Description:
Refactor Select-WslDistro and Invoke-CreateDistro's inline selection to use Read-SpectreSelection for interactive distro picking. The CLI path (pre-provided -Selection or -Name parameter) remains unchanged for non-interactive use.
Select-WslDistro: when no-Selectionis pre-provided and not in CI, useRead-SpectreSelectionwith distro names as choices. Return$nullon Esc/cancel.- Keep the
-Selectionparameter path unchanged for CLI and scripted use (number or name resolution) Invoke-CreateDistro: replace theRead-Hostnumbered selection (lines 167-203) withRead-SpectreSelectionusing$availableDistrosas choices- Update
commands.Tests.ps1: mockRead-SpectreSelectionfor interactive paths, keep CLI path tests unchanged - Test: cancel/Esc returns
$null, valid selection returns distro name
Acceptance Criteria:
-
Select-WslDistrousesRead-SpectreSelectionfor interactive distro picking -
Invoke-CreateDistrousesRead-SpectreSelectionfor available distro selection - Pressing Esc at distro selection returns to main menu (returns
$null) - CLI mode (
-Selection/-Nameprovided) still works without Spectre prompts - Updated tests with mocked
Read-SpectreSelection - All existing tests continue to pass