feat(tui): Bash checkbox menu (#495 Slice 2) - #505
Draft
primetimetank21 wants to merge 2 commits into
Draft
Conversation
Add scripts/linux/lib/tui.sh: interactive checkbox menu sourced by setup.sh. - Bash >=4.2: arrow-key navigation, Space toggle, Enter confirm, q/ESC cancel - Bash 3.2: numbered-toggle fallback (no fractional timeout, no mapfile, no local -n) - Version detection via BASH_VERSION; _TUI_ARROW_NAV_OVERRIDE seam for tests - Default tools pre-checked, opt-in tools unchecked and labeled - Cancel sets _MENU_CANCELLED=1, exits 0 with "Install cancelled." - Empty confirm exits 0 with "Nothing selected, exiting." - Selection feeds existing --only engine; order preserved by build_final_toolset Wire show_tool_menu into setup.sh main(): - --interactive + --selection-file: CI-testable seam, bypasses TTY guard - Headless/CI/default/--non-interactive paths unchanged (Slice 1 compat) Add tests/test_tui_bash.sh: - T_tui_sh_sources_clean, T_menu_resolve_defaults, T_menu_resolve_subset - T_menu_resolve_optin, T_menu_resolve_empty, T_menu_selection_file_e2e - T_menu_cancel_aborts, T_menu_noop_empty, T_numbered_render_runs - T_render_list_runs, T_noninteractive_compat - T_selection_file_no_noninteractive_conflict, T_help_no_selection_file Part of #495 Depends on merged #504 (Slice 1) Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…495) Add 'Run TUI bash menu tests' step to validate-linux and validate-macos jobs so all 13 Slice 2 tests gate CI on both platforms. No new jobs or dependencies. Corrects omission from Hardcase's Slice 2 commit. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Implements Slice 2 of #495: the Bash interactive checkbox menu for Linux/macOS/WSL.
Depends on merged #504 (Slice 1) — all non-interactive guards, TTY detection, and the
--selection-fileseam landed in Slice 1.Part of #495
What ships in this PR
scripts/linux/lib/tui.sh(new)Sourced by
setup.sh. Two navigation modes:_TUI_ARROW_NAV_OVERRIDE=0env var forces this path for testing without needing a real bash 3.2 environment.Default tools are pre-checked and labeled
(default); opt-in tools (available but not default) are unchecked and labeled(opt-in), sorted alphabetically.Cancel exits 0 with
Install cancelled.Empty confirm exits 0 with
Nothing selected, exiting.Selection feeds the existing
build_final_toolsetengine viaARG_ONLY; order is always preserved by DEFAULT_TOOLS sequence.scripts/linux/setup.sh(modified)lib/tui.shalongsidelib/log.sh.main()now callsshow_tool_menuwhen interactive, or reads from--selection-file(CI seam) without rendering the menu.tests/test_tui_bash.sh(new)13 tests covering:
Excluded from this PR
lib/tui.ps1,Resolve-FinalToolset). Separate branch.CI validation
ShellCheck passes locally via pre-commit hook and pre-push hook (both ran successfully on commit and push).
CI will run on Ubuntu (bash 5.x) and macOS (bash 3.2):
lint-shell-scriptsjob: shellcheck on setup.sh + tools;test_setup_flags.shvalidate-linux/validate-macos: existing install and flag teststest_tui_bash.shis wired intovalidate-linux(Ubuntu, bash 5.x) andvalidate-macos(macOS, bash 3.2) via a Run TUI bash menu tests step in.github/workflows/validate.yml. All 13 tests gate both jobs on every push and pull request.Manual verification required (not covered by automated tests)
The following cases require a live interactive TTY and are not verified by CI or this PR's automated tests:
a, Enter,q.These cases are documented here rather than claimed as tested.