TUI: persistent menu with prompt header and ←/Esc navigation#2
Open
TUI: persistent menu with prompt header and ←/Esc navigation#2
Conversation
- Add a "Select what you want to do" prompt line above the option list, framed by separator lines (per apt look-and-feel spec § 1–§ 2). When an option is chosen, the prompt is replaced by the chosen action's name. - Make the TUI persistent: actions return to the main menu instead of exiting. Modules are re-scanned on every iteration. - Key bindings: ←/q go back one menu, Esc/Ctrl-C/Ctrl-D close the tool. - Refactor update_one_module / update_all_modules to return normally instead of -> !, so the loop can iterate. CLI mode still exits at the end of an action. - Add a CI workflow that builds the aarch64 binary on PRs (the existing build-package.yml only fires on v* tags / produces releases).
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
Reshapes the
go-modulesTUI per the apt look-and-feel spec (§ 1–§ 2) and adds a persistent menu loop.Layout — the menu is now framed by three separator lines:
When the user selects an option, the screen is cleared and redrawn as
banner / SEP / <chosen action> / SEP / <action output>.Persistent loop — actions return to the main menu instead of exiting. Modules are re-scanned at the top of every iteration so the table reflects post-update state. Services (
nodered,go-simulink) stay stopped for the duration of the session and are restarted only when the user actually quits.Key bindings
↑/↓— navigate optionsEnter— select←/q— back to parent menu (no effect at root)Esc/Ctrl-C/Ctrl-D— close the tool (services restart)CLI mode — preserved. When called with arguments (
go-modules scan,go-modules update all, etc.) the tool still runs once and exits.Behavioural regression to flag
In CLI mode,
update_one_moduleandupdate_all_modulespreviously callederr_n_dieon theFirmwareCorruptedpath (exits-1, services not restarted) anderr_n_restart_servicesonFirmwareUntouched/ no-update (exits-1, services restarted). After this refactor both paths print the error and return; the trailingsuccess(...)then restarts services and exits0. The TUI is the primary use case and it never exited anyway, but if scripts rely on the CLI exit code to detect a failed update this needs an enum-return + match in the CLI dispatch (see comment threads).CI
The existing
build-package.ymlonly fires onv*tags. Added.github/workflows/ci.ymlso this PR builds the aarch64 binary as an artifact on every push — needed for validation since rustc/cargo do not fit on the Moduline L4 rootfs.Test plan
ci.ymlproducesgo-modules-aarch64artifact).scan/update/overwrite/checkshows the chosen action between the two SEP bars and returns to the main menu after completion.←/qfrom any sub-menu returns to the parent; from the main menu it just re-renders.Escfrom the main menu cleanly closes the tool and restartsnodered/go-simulink.go-modules scanstill exits after one scan.