Skip to content

Add gum TUI with auto-install, preflight checks, and beautiful interactive menu#2

Draft
Copilot wants to merge 1 commit into
mainfrom
copilot/add-gum-terminal-tui-installation
Draft

Add gum TUI with auto-install, preflight checks, and beautiful interactive menu#2
Copilot wants to merge 1 commit into
mainfrom
copilot/add-gum-terminal-tui-installation

Conversation

Copilot AI commented Apr 21, 2026

Copy link
Copy Markdown

Replaces the plain read-based menu with a charmbracelet/gum TUI while keeping all distro ASCII art and installation logic intact. Falls back to the original terminal UI if gum cannot be installed.

Auto-install gum

  • ensure_gum() installs gum via pacman -S gum (Arch extra repo) with AUR helper fallback (yay/paru)
  • Sets GUM_AVAILABLE flag; all gum paths degrade gracefully when unavailable

Per-distro accent colours

  • GUM_DISTRO_COLOR (256-colour index) added to detect_system() alongside existing DISTRO_STYLE
  • Used consistently across gum borders and styled text throughout the TUI

Preflight checks

  • run_preflight_checks() runs before the menu and shows live ✓/✗/⚠ status for: root, internet (gum spin spinner), disk space (< 10 GB warns), and pacman availability
  • Extracted _has_internet() as a shared silent helper used by both check_internet() (fallback mode) and run_preflight_checks() — eliminates the duplicated scoring logic

Interactive multi-select menu

  • gum choose --no-limit — all 20 options with emoji + [Category] prefix; ↑/↓ navigate, x/space toggle, Enter confirm
  • Distro ASCII art + system info panel (distro-accent bordered) shown above the menu
  • mapfile used for array deduplication to avoid word-splitting edge cases

Confirmation & install flow

  • confirm_selections_gum() renders selected components in a green rounded-border checklist, confirmed via gum confirm with Install / Cancel
  • gum_section() helper provides styled section headers during installation; success/failure banners updated to use gum style
  • Post-install prompt offers Return to Menu / Exit via gum confirm
  • Ctrl+C (exit 130) and empty selection (exit 1) handled distinctly in main()

…interactive menu

Agent-Logs-Url: https://github.com/xi-Rick/archgaming/sessions/a75ef89f-a5ce-4409-93b3-ebae4d1793be

Co-authored-by: xi-Rick <55861950+xi-Rick@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants