Skip to content

Unify transaction toast notifications (issue #5) - #120

Merged
Lakes41 merged 1 commit into
Adamantine-guild:mainfrom
DingiDinigi:feature/unified-transaction-toast
Jul 30, 2026
Merged

Unify transaction toast notifications (issue #5)#120
Lakes41 merged 1 commit into
Adamantine-guild:mainfrom
DingiDinigi:feature/unified-transaction-toast

Conversation

@DingiDinigi

Copy link
Copy Markdown
Contributor

Problem

Transaction toasts (PENDING, SUCCESS, ERROR) were implemented inconsistently across the codebase — some success toasts linked to the block explorer, others didn't; error toasts had inconsistent dismiss behavior; and at least one component (SwapCard.tsx) bypassed the shared toast system entirely with raw sonner calls.

Changes

  • components/TxToasts.tsx
    • Fixed a bug where error toasts (notifyTxError and the error branch of notifyTx) were missing duration: Infinity, causing them to auto-dismiss instead of requiring manual dismissal as required by the acceptance criteria.
    • Added notifyTxSuccessLocal(message) — a success toast with the same unified styling/duration as notifyTxSuccess, for actions that succeed without producing a real on-chain transaction hash (so we don't fabricate an explorer link where none exists).
  • components/swap/SwapCard.tsx
    • Migrated off raw toast.error / toast.success (from sonner) to the shared notifyTxError / notifyTxSuccessLocal helpers, so styling and dismiss behavior match the rest of the app.
  • components/TxToasts.test.tsx
    • Added a regression test asserting notifyTxError sets duration: Infinity.

Notes

  • SwapCard's swap action doesn't currently submit a real on-chain transaction (no wallet/contract call, no tx hash produced), so its success toast intentionally has no explorer link — adding one would mean fabricating a link with no real destination. notifyTxSuccess (with explorer link) remains the canonical path once real execution is wired up here.
  • One unrelated pre-existing test failure (components/swap/SwapRouteDisplay.test.tsx) was confirmed to fail on main as well (verified via git stash), so it's out of scope for this PR.

Testing

  • npm test — all tests pass except the pre-existing unrelated failure noted above.

- Fix error toasts auto-dismissing; now require manual dismissal per acceptance criteria
- Add notifyTxSuccessLocal for success states without a real tx hash
- Migrate SwapCard.tsx off raw sonner calls to unified TxToasts helpers
@Lakes41
Lakes41 merged commit ebb8cfc into Adamantine-guild:main Jul 30, 2026
1 check 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