Repository navigation
feat(setup): implement tui for mithril setup signer command - #3732
Conversation
Test Results 5 files ± 0 211 suites ±0 56m 37s ⏱️ + 4m 6s Results for commit 89e7f48. ± Comparison against base commit e0537cb. This pull request removes 11 and adds 85 tests. Note that renamed tests count towards both.♻️ This comment has been updated with latest results. |
f746e74 to
8626979
Compare
There was a problem hiding this comment.
🟡 Changes recommended
Active moderate and critical findings remain for incomplete endpoint validation, inconsistent preview/mainnet defaults, and missing private-network magic enforcement.
3 open issues
What changed in this PR
This pull request expands the mithril-setup signer command into an interactive terminal workflow with review, validation, result, and failure screens connected through the orchestrator.
Changes:
- Added reusable TUI widgets, review-table navigation, editing, paste support, mouse-wheel handling, status indicators, validation feedback, and error popups.
- Added success and failure result screens with Back and Exit navigation.
- Expanded signer configuration fields and validation rules, added hardcoded discovery and guessing values, and documented the workflow.
| File | Description |
|---|---|
| mithril-setup/src/tui/widgets/wrapped_text.rs | Adds reusable width-aware text wrapping for descriptions and key help. |
| mithril-setup/src/tui/widgets/mod.rs | Exposes the shared TUI widgets. |
| mithril-setup/src/tui/widgets/button.rs | Adds reusable focused and unfocused button rendering. |
| mithril-setup/src/tui/terminal.rs | Handles review and result screen event loops and terminal modes. |
| mithril-setup/src/tui/setup_result/view.rs | Renders setup success and failure result screens. |
| mithril-setup/src/tui/setup_result/model.rs | Models result-screen state, outcomes, and navigation. |
| mithril-setup/src/tui/setup_result/mod.rs | Registers the result-screen modules. |
| mithril-setup/src/tui/setup_result/keys.rs | Maps result-screen keyboard input to actions. |
| mithril-setup/src/tui/review/view.rs | Renders the review table, footer, buttons, and validation-error popup. |
| mithril-setup/src/tui/review/model.rs | Adds review validation, button navigation, paste handling, and popup state. |
| mithril-setup/src/tui/review/mod.rs | Registers review columns and popup modules. |
| mithril-setup/src/tui/review/keys.rs | Maps keyboard, paste, and mouse-wheel events for review interactions. |
| mithril-setup/src/tui/review/errors_popup.rs | Renders the list of fields with validation errors. |
| mithril-setup/src/tui/review/columns.rs | Defines review-table columns and value truncation and editing behavior. |
| mithril-setup/src/tui/mod.rs | Exposes the result-screen and shared widget modules. |
| mithril-setup/src/setups/signer/schema.rs | Adds signer configuration fields, allowed values, and validation rules. |
| mithril-setup/src/setups/signer/effect_handler.rs | Adds hardcoded signer discovery and guessing values and result-screen effects. |
| mithril-setup/src/orchestrator/state_machine.rs | Adds result, failure, and back-navigation states and transitions. |
| mithril-setup/src/orchestrator/runner.rs | Executes result and failure display effects. |
| mithril-setup/src/config/rules.rs | Adds path, endpoint, IP, JSON, whitespace, and bounded-error validation rules. |
| mithril-setup/README.md | Documents the signer setup screens and keyboard controls. |
Review effort: Lite
There was a problem hiding this comment.
Looks good to me 👍 with some non-blocking suggestions and questions.
- I was asking myself if we want to track with screenshots (somewhere in ticket or PR ?) what the TUI looks like.
- and also keep track of what could be improved next (mouse support, JSON multi-lines editing)
dcf2dc7 to
f18d9d2
Compare
The setup script will provide the Cardano CLI path of the signer.
… result screen The only realistic failure of the script generation is an existing file with the same name, which does not justify the complexity of going back to the review. A save failure ends the setup with its reason, and the result screen only has an Exit button.
…face trait The review and the result screen move out of the EffectHandler into a UserInterface given to the runner. Its terminal implementation is built with the fields and the result of a setup, so the setups can share it.
…erminal modes guard and the missing status - Left and Right actions next to Up and Down - TerminalModes renamed TerminalModesGuard, it is a guard disabling the modes on drop - Missing status documented as a mandatory value left unset
… values The hardcoded guessed values were the mainnet ones while the guessed network and aggregator are pre-release-preview.
The http_url rule only checked the scheme prefix, so values without a valid host or port like 'https://?' or 'http://:bad' were accepted.
…and runs The errors popup absence while navigating, its highlighted field and the centering of the result screen text are checked by running the command.
…re the first review The guessing step now requests the validation of its values
* mithril-setup from `0.1.4` to `0.1.5`
13e1d64 to
89e7f48
Compare





Content
This PR implements more features for the terminal user interface of the
mithril-setup signercommand.It includes:
AbortandContinuebuttonsContinue…, footer wrapped on narrow terminalsExitbuttonUserInterfacetrait, apart from the setup work of theEffectHandlerurlcrate), with hardcoded values until the discovery and the guessing are wiredPre-submit checklist
Comments
The file
tui/setup_result/view.rsis modified several times, mostly for adding parts of the display, so it might be worth it to review only its final state.Issue(s)
Closes #3699