Skip to content

v0.2.3 — update notifier + Modal/TUI overhaul + Windows update#3

Merged
ungaro merged 3 commits into
mainfrom
feat/v0.2.3-notifier-tui-overhaul
May 28, 2026
Merged

v0.2.3 — update notifier + Modal/TUI overhaul + Windows update#3
ungaro merged 3 commits into
mainfrom
feat/v0.2.3-notifier-tui-overhaul

Conversation

@ungaro
Copy link
Copy Markdown
Member

@ungaro ungaro commented May 28, 2026

Five additions, all in one release; backward-compatible — no CLI flag changes, no TxBundle shape changes, --dry-run -o json --address … flows produce identical bytes to v0.2.2.

Part 1 — Passive update notifier

  • New src/version_check.rs. Runs at the top of every invocation except update/dashboard and when NEST_NO_UPDATE_CHECK=1.
  • Reads ~/.cache/nest-cli/version-check.json. If cached latest_version > CARGO_PKG_VERSION (semver) → one-line stderr notice (yellow ▲ on TTY, plain ! otherwise).
  • If cache is missing or older than 24 h, spawns a detached thread that fetches nestagents.io/downloads/version.json (3 s timeout) and rewrites the file. On failure (network/HTTP/parse) we still bump checked_at so we don't hammer a broken endpoint.
  • nest update now writes the just-installed version into the cache so the very next invocation doesn't show a stale notice.
  • Exposed pub(crate) fn cached_latest() -> Option<Version> for the planned v0.2.4 TUI banner.
  • Replaces the old v0.2.1 OnceLock startup banner (which only fired on --version/--help) — single notification path, single cache file.

Part 2 — Modal picker primitive

  • New src/tui/widgets/modal.rs: generic Modal<T> with centered Clear/Block/List, / filter mode, ↑↓/Enter/Esc semantics. Returns ModalAction::{None, Selected(T), Cancelled}.
  • App gained pub modal: Option<(ModalKind, Modal<ModalItem>)>. Keys are trapped while a modal is open.
  • ModalKind variants: VaultPicker, ChainPicker, AssetPicker, WithdrawMode, WithdrawVaultPicker, HistoryVaultPicker. ModalItem boxes large variants (Vault/Asset) to keep the enum small.

Part 3 — Deposit & Withdraw form overhaul

  • DepositForm / WithdrawForm rewritten with Option<VaultDetailed> / Option<u64> (chainId) / Option<LiquidAsset> instead of typed strings; tui_input::Input for the amount/shares field (paste, cursor, MAX via Ctrl+M).
  • Async balance fetcher via tokio::sync::mpsc::UnboundedChannel: wallet ERC20 balance + native balance via on-chain multicall; vault share balance via Plume RPC; instant-redeem liquidity and claimable from the actions API. Throbber while loading.
  • Live deposit preview by calling EvmActionsClient::mint_build_tx under the hood (debounced 300 ms after the last keystroke) — shows the API-computed shareAmount / shareDecimals.
  • Withdraw mode picker (Request / Instant / Claim); Instant/Claim are omitted from the picker when their gating fetches resolve to zero. Withdraw vault picker filtered to vaults the user has positions in (app.positions); shows "No Nest positions — deposit first" if empty.
  • Inline ValidatedField + validate_amount(input, max, decimals) (Required / NotNumeric / ExceedsBalance / Other). Errors render in red below the field.
  • New deps: tui-input = "0.15", throbber-widgets-tui = "0.11".

Part 4 — History page redesign (Chart + axes)

  • Sparklineratatui::widgets::Chart + Axis per metric (APY %, TVL $K, Price $). X axis = unix timestamps formatted MMM DD (chrono); Y axis = min/mid/max ticks.
  • Always-visible header bar with vault identity + latest snapshot values (7d/30d APY, TVL, Price) and the current range/offset.
  • Always-visible footer hint with the new keybindings.
  • New keys: v opens a vault picker (HistoryVaultPicker), [ shifts the date window backward by half the current history_days, ] shifts forward.

Part 5 — Windows nest update self-replace (rename trick)

  • The v0.2.1 "Windows isn't supported, re-download manually" early-return is gone.
  • install_archive is now #[cfg]-gated:
    • Unix (unchanged): .tar.gz → stage alongside dest → rename (atomic).
    • Windows (new): .zip (via zip crate, deflate only) → rename current nest.exe to nest.exe.old (you can't overwrite a running .exe but you can rename it) → write new bytes as nest.exe.
  • On launch, version_check::cleanup_old_exe() sweeps any stale nest.exe.old. No-op on Unix.
  • Notifier wording stays platform-agnostic ("Run `nest update`") since Windows can now self-update on x86_64. ARM64 Windows is still uncovered — the installer script will gate on that.

Verification

  • cargo test — 61 passed (up from 32 before v0.2.3; new unit tests for the notifier cache/TTL/semver, Modal navigation/filter/commit, deposit/withdraw form validation, history offset).
  • cargo clippy --all-targets -- -D warnings clean.
  • cargo fmt -- --check clean.

Out of scope (per spec)

  • ARM64 Windows release artifact — install.ps1 will surface a clear "not yet supported" error; build target deferred.
  • Persistent TUI version banner — planned for v0.2.4. The cached_latest() getter is in place so v0.2.4 can read state without re-implementing parsing.
  • Publishing the actual version.json to nest-agents

@ungaro ungaro merged commit d9b058d into main May 28, 2026
1 check passed
@ungaro ungaro deleted the feat/v0.2.3-notifier-tui-overhaul branch May 28, 2026 22:49
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