Skip to content

Latest commit

 

History

History
33 lines (25 loc) · 1.75 KB

File metadata and controls

33 lines (25 loc) · 1.75 KB

<- Back to Backlog

[SC-016d] Replace distro selection with Read-SpectreSelection

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.

Technical approach

  • Select-WslDistro: when no -Selection is pre-provided and not in CI, use Read-SpectreSelection with distro names as choices. Return $null on Esc/cancel.
  • Keep the -Selection parameter path unchanged for CLI and scripted use (number or name resolution)
  • Invoke-CreateDistro: replace the Read-Host numbered selection (lines 167-203) with Read-SpectreSelection using $availableDistros as choices
  • Update commands.Tests.ps1: mock Read-SpectreSelection for interactive paths, keep CLI path tests unchanged
  • Test: cancel/Esc returns $null, valid selection returns distro name

Acceptance Criteria:

  • Select-WslDistro uses Read-SpectreSelection for interactive distro picking
  • Invoke-CreateDistro uses Read-SpectreSelection for available distro selection
  • Pressing Esc at distro selection returns to main menu (returns $null)
  • CLI mode (-Selection / -Name provided) still works without Spectre prompts
  • Updated tests with mocked Read-SpectreSelection
  • All existing tests continue to pass

<- Back to Backlog