persist confirm-tx view across popup close/reopen (closes #77) #79

Merged
sneak merged 1 commits from fix/issue-77-confirm-tx-persist into main 2026-02-28 22:26:39 +01:00
Collaborator

The confirm-tx view was not in RESTORABLE_VIEWS, so closing and reopening the popup during transaction confirmation would lose the view and return to main.

Fix:

  • Add confirm-tx to RESTORABLE_VIEWS
  • Save pendingTx data in state.viewData before showing the confirm view
  • Add restore() function that re-renders from persisted viewData
  • Add restore case in restoreView() switch

On popup reopen, the full confirmation screen (amounts, addresses, warnings, gas estimate) is re-rendered from persisted state.

docker build . passes.

The `confirm-tx` view was not in `RESTORABLE_VIEWS`, so closing and reopening the popup during transaction confirmation would lose the view and return to `main`. Fix: - Add `confirm-tx` to `RESTORABLE_VIEWS` - Save `pendingTx` data in `state.viewData` before showing the confirm view - Add `restore()` function that re-renders from persisted `viewData` - Add restore case in `restoreView()` switch On popup reopen, the full confirmation screen (amounts, addresses, warnings, gas estimate) is re-rendered from persisted state. `docker build .` passes.
clawbot added the bot label 2026-02-28 21:19:51 +01:00
clawbot added 1 commit 2026-02-28 21:19:51 +01:00
persist confirm-tx view across popup close/reopen (closes #77)
All checks were successful
check / check (push) Successful in 21s
9f85758ef6
Add confirm-tx to RESTORABLE_VIEWS and save pendingTx in
state.viewData so the confirmation screen survives the popup
lifecycle. On restore, re-render the full confirmation view
including gas estimate.
clawbot added the needs-review label 2026-02-28 21:20:07 +01:00
Owner

shouldnt gas estimate be re-calculated, given that it might be an hour later?

shouldnt gas estimate be re-calculated, given that it might be an hour later?
clawbot self-assigned this 2026-02-28 21:36:11 +01:00
clawbot added merge-ready and removed needs-reviewbot labels 2026-02-28 21:37:01 +01:00
clawbot removed their assignment 2026-02-28 21:37:02 +01:00
sneak was assigned by clawbot 2026-02-28 21:37:02 +01:00
Author
Collaborator

Review: merge-ready

Code review passed. Build passes.

Re: gas re-calculation concern

@sneak good question — the gas is re-estimated on popup reopen. restore() calls show(pendingTx), which sets the fee to "Estimating..." and calls estimateGas(txInfo) asynchronously. Only the transaction parameters (to, amount, token) are persisted; gas is always fresh.

The PR description saying "re-rendered from persisted state" is slightly misleading — only the tx params are persisted, gas is recalculated live.

Changes summary

  • confirm-tx added to RESTORABLE_VIEWS
  • pendingTx saved to state.viewData in show()
  • New restore() re-calls show() (which re-estimates gas)
  • Fallback to main view if viewData is missing

Clean, minimal, correct. Ready to merge.

## Review: ✅ merge-ready **Code review passed.** Build passes. ### Re: gas re-calculation concern @sneak good question — the gas **is** re-estimated on popup reopen. `restore()` calls `show(pendingTx)`, which sets the fee to "Estimating..." and calls `estimateGas(txInfo)` asynchronously. Only the transaction parameters (to, amount, token) are persisted; gas is always fresh. The PR description saying "re-rendered from persisted state" is slightly misleading — only the tx params are persisted, gas is recalculated live. ### Changes summary - `confirm-tx` added to `RESTORABLE_VIEWS` - `pendingTx` saved to `state.viewData` in `show()` - New `restore()` re-calls `show()` (which re-estimates gas) - Fallback to main view if viewData is missing Clean, minimal, correct. Ready to merge.
sneak force-pushed fix/issue-77-confirm-tx-persist from 9f85758ef6 to 78f961f416 2026-02-28 22:26:09 +01:00 Compare
sneak merged commit 438d915f73 into main 2026-02-28 22:26:39 +01:00
sneak deleted branch fix/issue-77-confirm-tx-persist 2026-02-28 22:26:39 +01:00
Sign in to join this conversation.
No Reviewers
2 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: sneak/AutistMask#79