Skip to content

refactor(tui): drop gum as a TUI backend (ADR-0024)#259

Merged
ycpss91255 merged 2 commits into
mainfrom
refactor/drop-gum-tui-backend
Jun 23, 2026
Merged

refactor(tui): drop gum as a TUI backend (ADR-0024)#259
ycpss91255 merged 2 commits into
mainfrom
refactor/drop-gum-tui-backend

Conversation

@ycpss91255

Copy link
Copy Markdown
Owner

Summary

Final step before 0.1.0-rc: remove gum as a TUI BACKEND per ADR-0024 (which
mandates remove-now: "gum is dropped entirely... a 0.1.0 blocker"). The TUI now
has exactly two tiers: fzf two-pane navigator (Rich) preferred, whiptail nested
drill-down (Fallback) guaranteed.

gum remains a fully supported INSTALLABLE TOOL: module/gum.module.sh and its
spec are untouched; setup_ubuntu install gum still works. Only gum's
dialog-backend role is gone.

Changes

  • lib/tui_backend.sh: deleted the _tui_{menu,checklist,msgbox,yesno,input}_gum
    adapter family, the pre-launch gum-install resolver, and gum-specific i18n;
    rewrote tier detection to fzf-preferred / whiptail-floor (no gum branch). All
    _tui_*_whiptail adapters, the fzf-tier seam, and the backend-agnostic
    tui_render_* dispatchers are preserved.
  • setup_ubuntu_tui.sh: --backend accepts fzf|whiptail only; gum (and any
    unknown value) exits 2 with a usage hint pointing at setup_ubuntu install gum.
  • Tests: removed gum-backend detection/adapter/prelaunch cases and the
    _make_mock_gum helper; deleted the gum expect fixtures (smoke_flow_gum.exp,
    real_install_flow_gum.exp) and their AC-10/AC-11 cases; scrubbed gum-backend
    mentions from the remaining TUI specs/harness. Added a --backend gum -> exit 2
    test and whiptail-family contract tests.
  • Added test/unit/tui_backend_branches_spec.bats covering the CLI-fork JSON
    guard, install/manage dry-run plan parsing, and broker error paths (recovers
    the genuinely-coverable lines after the gum deletion; the residual uncovered
    lines are jq-program-body kcov attribution artifacts).
  • Docs: CLAUDE.md / AGENTS.md describe fzf>whiptail (ADR-0024); architecture +
    design docs carry superseded-by-ADR-0024 banners. ADR-0023 already superseded.

Test plan

  • just -f justfile.ci test-unit (Docker) -- 4061 tests, 0 failures
  • just -f justfile.ci test-integration (Docker) -- 21 tests, 0 failures
    (the verify gum module-lifecycle test still passes; gum binary kept in
    the test image for that, with a clarifying comment -- it is no longer a
    backend)
  • shellcheck -x clean on all changed .sh / .bats / .bash
  • gum module + spec confirmed unchanged
  • CI sharded coverage-merge confirms AC-17 >= 80% (authoritative; local
    sharded-merge cannot run in-env, so this is the gate to watch)

Follow-up (not blocking this PR)

ycpss91255 and others added 2 commits June 23, 2026 06:49
Remove gum entirely as a TUI BACKEND per ADR-0024 (the Rich tier is the
fzf two-pane navigator, the Fallback tier is whiptail). gum remains a
fully supported INSTALLABLE TOOL via `setup_ubuntu install gum`
(module/gum.module.sh, archetype B) — only its dialog-backend role is gone.

lib/tui_backend.sh:
- delete the gum adapter family (_tui_menu/checklist/msgbox/yesno/input_gum)
- delete the pre-launch gum-install resolution (_tui_prelaunch_backend)
- drop gum-specific i18n (prompt_install_gum, gum_keys_*, help_gum, the gum
  press_enter footer)
- rewrite tui_backend_detect / tui_backend_init to whiptail-only; collapse
  _tui_backend_family + tui_help_text to the single whiptail family

setup_ubuntu_tui.sh:
- --backend accepts fzf|whiptail only; `gum` -> stderr usage + exit 2 with
  the hint "gum is no longer a TUI backend; install it as a tool via:
  setup_ubuntu install gum"; update help text + stale comments

tests:
- tui_backend_spec.bats: drop the gum detection/adapter/help/input tests and
  the prelaunch section + _make_mock_gum helper; add `--backend gum -> exit 2`
- delete smoke_flow_gum.exp / real_install_flow_gum.exp and the gum-backend
  AC-10/AC-11 cases; scrub gum-backend mentions from helpers/specs
- the github-release module-lifecycle specs (gum-the-module) are untouched

docs: AGENTS.md (CLAUDE.md symlink), architecture.md, design/tui-*.md,
module INDEX note, CHANGELOG [Unreleased] Removed entry.

Dockerfile.test-tools keeps the gum binary (comment clarified): the
github-release module-lifecycle `verify gum` -> `command -v gum` needs it.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NX5H2vuMTv4mBmjpPYoS3s
Recover per-file coverage on lib/tui_backend.sh after the gum backend was
dropped (ADR-0024), which deleted ~69 above-average-covered lines and pulled
the file from 71.94% to 68.76% single-run -- too close to the AC-17 80%
merged gate.

Adds test/unit/tui_backend_branches_spec.bats: focused in-process unit tests
for the genuinely-coverable error / dispatch branches the behavior-focused
tui specs never drive:
  - _tui_cli_json ADR-0019 non-JSON validation guard
  - tui_cli_install_plan / tui_cli_manage_plan fork-FAILED (rc != 0) paths,
    plus tui_cli_manage_plan's "returned no plan" path and a happy parse
  - the data-broker single error surface: _tui_broker_fail's msgbox branch
    (TUI_BACKEND set + stubbed widget) and the detect-cache accessor error
  - _tui_category_entry unknown-category defensive default

No runtime change -- lib/tui_backend.sh is byte-identical. Focused kcov over
all tui specs lifts lib/tui_backend.sh per-file coverage 295/429 (68.76%) ->
305/429 (71.10%); the remaining uncovered lines are jq-program string bodies
and multi-line command-sub continuations that kcov cannot attribute (an
artifact, not a real gap), plus the root-unreachable _tui_has_sudo non-root
arm. Full unit suite stays green (1203 ok, 0 fail).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NX5H2vuMTv4mBmjpPYoS3s
@ycpss91255 ycpss91255 enabled auto-merge (squash) June 23, 2026 00:05
@ycpss91255 ycpss91255 merged commit 42af1d4 into main Jun 23, 2026
53 checks passed
@ycpss91255 ycpss91255 mentioned this pull request Jun 23, 2026
3 tasks
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.

1 participant