Skip to content

v0.2.4 — TUI update banner + end-to-end broadcast pipeline#4

Merged
ungaro merged 1 commit into
mainfrom
feat/v0.2.4-tui-banner-broadcast
May 28, 2026
Merged

v0.2.4 — TUI update banner + end-to-end broadcast pipeline#4
ungaro merged 1 commit into
mainfrom
feat/v0.2.4-tui-banner-broadcast

Conversation

@ungaro
Copy link
Copy Markdown
Member

@ungaro ungaro commented May 28, 2026

Two TUI additions. Backward-compatible — no CLI flag changes, no TxBundle shape changes.

Part A — Persistent TUI update banner

  • Reads version_check::cached_latest() once at App::new (no per-frame disk hit). When Some(latest), a thin yellow row renders above the tabs bar: ▲ nest v{latest} is available — run \nest update` (Esc to dismiss)`.
  • Top-level layout becomes a conditional 4-row vs 3-row split.
  • Esc dismisses 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:

  1. Enter on the Submit field → pre-flight (all fields, private key present) → spawn mint_build_tx / redeem_build_tx task → BuildingBundle.
  2. Bundle returned → AwaitingConfirm(bundle) → form body shows per-tx preview lines ([i/N] {label} to: {short} value: {decimal-wei or —}); confirm modal opens.
  3. Confirm modal: items are [Cancel, Broadcast]. Cancel is items[0] so Modal::new's default selection lands on it — single-press Enter is cancel; the user must then Enter to broadcast (deliberate, irreversible action).
  4. Broadcast chosen → spawn one task per bundle, run each BundleTx as its own single-tx execute_bundle so progress streams in real time. mpsc messages: DepositSubmitProgress(idx, TxProgress::{Pending|Confirmed(TxResult)|Failed(err)})drain_fetches mutates state.
  5. All-confirmed → Done{receipts} → form body replaced with one row per tx: ✓ [i/N] {label} {tx_hash} block N → {explorer_url} (explorer URL already populated by execute_bundle).
  6. Any failed → Failed{error} → form body replaced with red error message.
  7. Esc from Done/Failed → back to Idle, 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)

  • Withdraw Instant / Claim mode broadcast — they still print the CLI hint. v0.2.5.
  • Bridge broadcast from the TUI — Bridge has no tab today. Future.
  • Polling refresh of cached_latest() mid-session — the banner reflects the value at startup; new manifests show up next launch.

Verification

  • cargo test69 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_latest initial value.
  • cargo clippy --all-targets -- -D warnings clean.
  • cargo fmt -- --check clean.

@ungaro ungaro merged commit 266e9ca into main May 28, 2026
1 check passed
@ungaro ungaro deleted the feat/v0.2.4-tui-banner-broadcast branch May 28, 2026 23:41
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