Skip to content

fix(web): fix #1063 add confirmation dialog for auto top up transfer - #1167

Merged
vjuliaife merged 1 commit into
vjuliaife:mainfrom
Owolabenjade:fix/issue-1063-auto-top-up-confirmation
Aug 27, 2026
Merged

fix(web): fix #1063 add confirmation dialog for auto top up transfer#1167
vjuliaife merged 1 commit into
vjuliaife:mainfrom
Owolabenjade:fix/issue-1063-auto-top-up-confirmation

Conversation

@Owolabenjade

Copy link
Copy Markdown
Contributor

Close issue #1063

This PR addresses issue #1063 where the auto_top_up dashboard button (apps/web/app/app/page.tsx) executed an on-chain fund transfer moving collateral shortfall from reserve to collateral escrow immediately upon a single click, with no preview or confirmation step.

Unlike DepositWizard which provides preview and confirmation steps before executing financial transactions, the auto_top_up button previously lacked any confirmation safeguard. This created a security and usability risk where importers could accidentally execute an irrevocable on-chain fund transfer without reviewing the exact transfer amount or confirming their intent.

Solution & Flow

  • Modified apps/web/app/app/page.tsx to introduce a local showTopUpConfirm state (useState(false)).
  • Intercepted the primary auto_top_up button onClick handler to trigger setShowTopUpConfirm(true) instead of invoking handleTopUp() directly.
  • Added a lightweight modal dialog (fixed inset-0 z-50 bg-black/60 backdrop-blur-sm) that displays:
    • Transfer Amount: Exact amount in XLM (stroopsToXlm(shortfall.toString())).
    • Account Balances Preview: Source bucket (Reserve Pool balance) and target bucket (Collateral Escrow).
    • Cancel Action: Dismisses the modal (setShowTopUpConfirm(false)), leaving balances completely unchanged without executing api.autoTopUp.
    • Confirm & Transfer Action: Dismisses the modal and invokes handleTopUp().
  • Maintained the existing disabled state (disabled={busy !== null || shortfall === 0n}) on the primary trigger button.

Value & Impact

This change resolves financial transaction safety concerns for issue #1063, ensuring importers preview exact transfer amounts and confirm intent before initiating on-chain transfers.

Changed

Testing

The component modifications were verified using the following static analysis scripts:

# Verify TypeScript compilation and type safety
npm run typecheck --workspace=apps/web

# Verify zero ESLint warnings or code style issues
npm run lint --workspace=apps/web

@drips-wave

drips-wave Bot commented Aug 27, 2026

Copy link
Copy Markdown

@Owolabenjade Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

@vercel

vercel Bot commented Aug 27, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
tariff-shield-web Error Error Aug 27, 2026 5:59pm

@vjuliaife
vjuliaife merged commit 9d1a581 into vjuliaife:main Aug 27, 2026
9 of 26 checks passed
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.

2 participants