v0.2.4 — TUI update banner + end-to-end broadcast pipeline#4
Merged
Conversation
…t/Withdraw (v0.2.4)
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.
Two TUI additions. Backward-compatible — no CLI flag changes, no
TxBundleshape changes.Part A — Persistent TUI update banner
version_check::cached_latest()once atApp::new(no per-frame disk hit). WhenSome(latest), a thin yellow row renders above the tabs bar:▲ nest v{latest} is available — run \nest update` (Esc to dismiss)`.Escdismisses the banner for the session (only as a fall-through — existing Esc handlers like "close modal" / "back to Vaults from Deposit/Withdraw" still take precedence).Part B — TUI broadcast pipeline (Deposit / Withdraw)
End-to-end submit flow with a safety-default confirm modal.
Submit-state machine (per form):
`Idle → BuildingBundle → AwaitingConfirm(TxBundle) → Broadcasting{bundle, progress: Vec} → Done{receipts: Vec} / Failed{error}`
Pipeline:
Enteron the Submit field → pre-flight (all fields, private key present) → spawnmint_build_tx/redeem_build_txtask →BuildingBundle.AwaitingConfirm(bundle)→ form body shows per-tx preview lines ([i/N] {label} to: {short} value: {decimal-wei or —}); confirm modal opens.[Cancel, Broadcast].Cancelisitems[0]soModal::new's default selection lands on it — single-pressEnteris cancel; the user must↑thenEnterto broadcast (deliberate, irreversible action).Broadcastchosen → spawn one task per bundle, run eachBundleTxas its own single-txexecute_bundleso progress streams in real time. mpsc messages:DepositSubmitProgress(idx, TxProgress::{Pending|Confirmed(TxResult)|Failed(err)})—drain_fetchesmutates state.Done{receipts}→ form body replaced with one row per tx:✓ [i/N] {label} {tx_hash} block N → {explorer_url}(explorer URL already populated byexecute_bundle).Failed{error}→ form body replaced with red error message.EscfromDone/Failed→ back toIdle, amount/shares cleared.Withdraw: same shape via
redeem_build_tx. Instant / Claim modes still emit the v0.2.3 CLI hint — wiring those is v0.2.5.What's NOT in this release (deliberate)
cached_latest()mid-session — the banner reflects the value at startup; new manifests show up next launch.Verification
cargo test— 69 passed (61 + 8 new): banner state, banner Esc fall-through, Cancel-first invariant, build→AwaitingConfirm + modal open, progress→Done transition, progress→Failed transition, formatted result line,cached_latestinitial value.cargo clippy --all-targets -- -D warningsclean.cargo fmt -- --checkclean.