feat(rotatui): double-ruled gum UI, failure-resilient rituals, CI lint - #320
Conversation
Bug fix: rotatui sets `set -euo pipefail`, so any ritual that failed aborted the whole TUI before its own "RITUAL FAILED" panel could render. Guard every capture site (`spooky_spin ... || code=$?`), have run_with_spin report via RITUAL_STATUS and return 0, and wrap the menu case in `esac || true` so a stray failure returns to the menu. UI: unify every panel/table/section on one double-ruled border via panel()/section_header() helpers, and normalize the main menu to a consistent emoji gutter + fixed-width label column so descriptions align. Leverage more of Gum: - gum spin replaces the hand-rolled braille spinner - gum log for the Charm stack notice and inline diagnostics - gum format --type markdown as the Tomb Peek fallback when glow is absent - gum choose --no-limit for multi-target Book Binders - gum filter --select-if-one --fuzzy for template selection - themed confirm affirmative/negative labels throughout - gum table --columns with a double border - add init and help rituals to the menu; derive Showcase theme count Also add rotatui.sh to the CI ShellCheck step.
…tatus cards More Gum surfaced through the CLI: - Status: two double-ruled cards via `gum join --horizontal`, and the freshness line via `gum format --type template` (colored by status) - Status: the script-health table is now interactive (`--return-column`) and opens the selected script's doc page (or source) in `gum pager` - Peek: glow/gum-format style is chosen from the tomb's `template:` frontmatter (falling back to `default_template`), so previews match the page's theme - spin: per-ritual spinner selection, overridable with `RK_SPINNER` - panel(): accepts an optional numeric width so cards can sit side by side
|
Added a follow-up commit (2159283) with the Gum wins: theme-matched peek, interactive script-health table → doc/source pager, |
gum 2.0 (Bubble Tea v2) probes terminal capabilities on startup; because `gum spin` is short-lived, the terminal's reply can arrive after gum restores echo and print as junk like ^[[?1u (bubbletea #1627/#1749). Add settle_terminal(): briefly disable echo on the controlling tty and drain, so late replies are swallowed. Runs after every spin, restores the saved termios via an EXIT/INT/TERM trap, and is a no-op when no tty is available.
|
Added |
…lies The previous post-spin drain was too late: Bubble Tea v2 sends its capability probes before it settles into raw mode, so the terminal's replies (^[[?2026;2$y, ^[[?2027;4$y, ^[[?1u) land while echo is still on and get echoed as junk at spin startup. iTerm and Ghostty both show it. Instead, disable echo before launching gum spin and keep it off through the spin and a short drain, then restore the saved termios via an EXIT/INT/TERM trap. No-op when there is no controlling tty. This removes the window in which the replies could echo. Replaces settle_terminal (post-spin only).
|
Reworked the leak mitigation (commit faf211d). The post-spin drain was too late — Bubble Tea v2 sends its capability probes before entering raw mode, so replies like |
Summary
Follow-up to the Rotatui charm-stack work (#319). Fixes a latent bug where any failing ritual killed the whole TUI, unifies the visual language on a double-ruled border, and leans harder on the Gum feature set.
Bug fix — failed rituals aborted the TUI
rotatui.shsetsset -euo pipefail, but everyspooky_spin/run_with_spincall site captured$?on the next line. Underset -ea non-zero return aborts before that line, so the❌ RITUAL FAILEDpanel / log / pager never rendered and the process exited. It only ever looked fine because success paths never tripped it.spooky_spin ... || code=$?run_with_spinnow stores status inRITUAL_STATUSand returns 0 (it already reports pass/fail)case ... esac || trueso a stray failure returns to the menuUI — consistent double-ruled framing
panel()/section_header()helpers; every panel, table, and header now shares one double-ruled border (noroundedborders remain)⚙️ Initialize Env/🏷️ Version Bumpdrift)More Gum
gum spinreplaces the hand-rolled braille spinner; spinner varies per ritual, overridable withRK_SPINNERgum logfor the Charm stack notice and inline diagnosticsgum format --type markdownas the Tomb Peek fallback whenglowis absenttemplate:frontmatter (ordefault_template): light→light, pride/kawaii/flash/daisy→pink, spooky/necropolis/dark→draculagum choose --no-limitfor multi-target Book Bindersgum filter --select-if-one --fuzzyfor template selection--affirmative/--negativelabels throughoutgum table --columnswith a double bordergum join --horizontalfor two-up status cards, andgum format --type templatefor the colored freshness linegum table --return-column) and opens the selected script's doc page (or source) ingum pagerinitandhelprituals to the menu; Showcase derives its theme countCI
shellcheck rotatui.shto the lint step (it wasn't covered before)Validation
bash -n rotatui.sh+shellcheck rotatui.shclean (one targetedSC2016disable for the intentional inner-bash expansion)bash rotkeeper.sh statusbash rotkeeper.sh test— 3/3 layouts + contract/DIP/regression suites passedgum table --return-columnreturns the selected script under a pty; a ritual runs throughgum spin+ panel + return to menuNotes
gum joinis now used; no Gum subcommands remain unused.