Skip to content

feat: add standardized useActionToast hook for irreversible actions#466

Open
wagmiiii wants to merge 1 commit into
CredenceOrg:mainfrom
wagmiiii:feat/379-toast-feedback-irreversible-actions
Open

feat: add standardized useActionToast hook for irreversible actions#466
wagmiiii wants to merge 1 commit into
CredenceOrg:mainfrom
wagmiiii:feat/379-toast-feedback-irreversible-actions

Conversation

@wagmiiii

Copy link
Copy Markdown

Closes #379

Summary

Added a centralized standard for displaying success and failure toasts during irreversible actions (sign, send, approve, and delete).

What changed

  • src/config/toastMessages.ts: Landed the notification string constants in a single place to ensure consistency across the application.
  • src/hooks/useActionToast.ts: Added a new hook that wraps promises for these specific actions. It automatically unwraps the success result to fire a success toast, or catches failures to fire a danger toast before re-throwing the error so local UI state can be managed correctly.
  • docs/STATE_MANAGEMENT.md: Updated the Toast behavior guide to direct developers to use this hook instead of manual addToast calls for irreversible actions.

(Note: Because the UI features for these specific actions haven't been implemented yet, this PR focuses on fulfilling the issue's requirements at the infrastructure level so that they can be reused everywhere once those features land without enforcing manual try/catch workarounds.)

Acceptance Criteria Checklist

  • The change matches the summary above.
  • No regression in the existing test suite (added dedicated test suite for the new hook).
  • The change is documented where it is observable (docs/STATE_MANAGEMENT.md).
  • Lint, type-check, and tests all pass locally.
  • PR description references this issue with Closes #.

@drips-wave

drips-wave Bot commented Jun 28, 2026

Copy link
Copy Markdown

@wagmiiii 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

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.

Add toast feedback for every irreversible action

1 participant