Add transaction-state persistence across reloads to TransactionProgressModal#1195
Open
greatest0fallt1me wants to merge 1 commit into
Open
Add transaction-state persistence across reloads to TransactionProgressModal#1195greatest0fallt1me wants to merge 1 commit into
greatest0fallt1me wants to merge 1 commit into
Conversation
…ProgressModal Introduces useTransactionPersistence hook that writes in-flight transaction state (step, hash, errorCode, actionName) to localStorage on each state change and rehydrates it on mount so the modal re-opens at the correct step after a page reload. Terminal states (SUCCESS/IDLE) and explicit user close actions clear the stored entry. Storage errors are swallowed to ensure a safe no-op when localStorage is unavailable. Adds focused tests and docs. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
@greatest0fallt1me is attempting to deploy a commit to the 1nonly's projects Team on Vercel. A member of the Team first needs to authorize it. |
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.
Fixes #950
Summary
useTransactionPersistencehook that persists in-flight transaction state (step, hash, errorCode, actionName) tolocalStorageon each state changeTransactionProgressModalrehydrates persisted state on mount and re-opens at the correct step after a page reload, preserving copy-hash and retry affordancesSUCCESS/IDLE) and explicit user close actions clear the stored entry; storage errors are swallowed for a safe no-op whenlocalStorageis unavailableChanges
src/hooks/useTransactionPersistence.ts— new hook with versioned schema, 30-min TTL, and safe storage accesssrc/app/TransactionProgressModal.tsx— integrates persistence hook; uses effective state derived from live props or rehydrated fallbacksrc/app/TransactionModalPersist.test.tsx— tests covering reload re-open, hash preservation, terminal-state cleanup, storage-unavailable no-op, live-props precedence, and idle/empty renderdocs/TRANSACTION_PERSIST.md— feature documentation with API reference, accessibility notes, and usage example