Skip to content

feat(frontend): persist invoice form draft to localStorage - #185

Open
RawNuke wants to merge 1 commit into
Stellar-VaultLink:mainfrom
RawNuke:feat/frontend-invoice-draft-persistence
Open

feat(frontend): persist invoice form draft to localStorage#185
RawNuke wants to merge 1 commit into
Stellar-VaultLink:mainfrom
RawNuke:feat/frontend-invoice-draft-persistence

Conversation

@RawNuke

@RawNuke RawNuke commented Aug 11, 2026

Copy link
Copy Markdown

Pull Request

Summary

The invoice registration form now saves its values to localStorage while you type, restores them when you reload mid-form, and clears them after a successful submission.

Related issue

Closes #181

Type of change

  • New feature

Changes made

  • Debounced save of the amount, currency, and due date values to localStorage, reusing the existing useDebounce and useLocalStorage hooks.
  • Restore on mount. The stored draft is sanitized before restore: unknown fields are dropped, the currency must be a valid enum value, and wrong types are ignored.
  • The draft key is namespaced per user: invofi:invoice-draft:<wallet address> with an anonymous key when no wallet is connected.
  • The draft is cleared only after the invoice saves successfully.
  • A stale debounce timer cannot re-save the submitted values after the clear.

Testing

Ran inside invofi/apps/frontend with the placeholder environment from .github/workflows/ci.yml:

  • npm run type-check passes (if frontend or SDK changed)
  • npm run lint passes (if frontend changed)
  • Manually tested on Stellar testnet against the deployed contracts
  • Manually tested in browser with Freighter or Lobstr wallet (for frontend changes)

npm run build also passes. The frontend has no unit test runner, so the restore and clear transitions were verified by a line-by-line logic audit and a storage-sanitization simulation.

Screenshots (if UI changed)

No visual change.

Checklist

  • My branch is up to date with main
  • I followed the commit message format in CONTRIBUTING.md
  • I added tests for new behavior
  • I updated the relevant documentation
  • I have not introduced any hardcoded secrets or keys

If this helped, RawNuke welcomes sponsorship: https://github.com/sponsors/RawNuke

Debounce-save the amount, currency, and due date fields to localStorage
and restore them on reload. The draft key is namespaced per wallet
address. A successful submission clears the draft.

Closes Stellar-VaultLink#181

Signed-off-by: RawNuke <67506722+RawNuke@users.noreply.github.com>
@RawNuke
RawNuke requested a review from samjay8 as a code owner August 11, 2026 22:42
@vercel

vercel Bot commented Aug 11, 2026

Copy link
Copy Markdown

@RawNuke is attempting to deploy a commit to the Samuel Ojetunde 's projects Team on Vercel.

A member of the Team first needs to authorize it.

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.

feat(frontend): invoice form draft persistence (localStorage)

1 participant