Skip to content

WalletProvider's connect()/disconnect() never notify the user via the app's toast system, unlike every other mutating actionΒ #324

Description

@Jagadeeshftw

πŸ“Œ Description

Every other state-changing action in the app surfaces a toast via useToast's notify β€” registering/deactivating an anchor (AnchorsPanel, AnchorDetail), opening/executing/cancelling a settlement (SettlementsPanel, SettlementDetail). WalletProvider's connect() and disconnect() (src/components/WalletProvider.tsx), and ConnectButton (src/components/ConnectButton.tsx) which calls them, do neither β€” there is no useToast import or notify call anywhere in either file. Connecting or disconnecting the wallet only changes the header button's label, with no confirmation toast telling the user the action succeeded, unlike every other mutating action in the app which pairs a state change with an explicit, consistent success notification.

🧩 Requirements and context

  • Connecting and disconnecting the wallet should notify the user via the existing toast system (e.g. notify("success", "Wallet connected.") / notify("success", "Wallet disconnected.")), consistent with how every other mutating action in the app confirms itself.
  • The existing button-label change and the disconnect confirmation dialog must be unchanged.
  • Cross-tab sync (the storage event handler in WalletProvider) should not trigger a toast in the tab that didn't initiate the change, to avoid a confusing notification for an action the current tab's user didn't take.

πŸ› οΈ Suggested execution

  • Since WalletProvider/ConnectButton sit outside ToastProvider's typical consumer pattern only by omission (ToastProvider already wraps the whole tree in layout.tsx), add a useToast() call in ConnectButton (which already renders within the provider tree) and call notify("success", ...) after a successful connect()/disconnect() call, rather than inside WalletProvider itself (keeping the toast-triggering storage-sync distinction simple).
  • Extend src/components/ConnectButton.test.tsx with a test asserting a toast/notification appears after connecting and after confirming a disconnect.

βœ… Acceptance criteria

  • Connecting the wallet shows a success notification.
  • Confirming a disconnect shows a success notification.
  • A cross-tab sync (storage event) does not itself trigger a notification in the receiving tab.

πŸ”’ Security notes

No new attack surface; a client-side UX consistency enhancement using the app's existing notification system.

πŸ“‹ Guidelines

  • Minimum 95% test coverage
  • Clear documentation
  • Timeframe: 96 hours

Metadata

Metadata

Assignees

Labels

GrantFox OSSIssue tracked in GrantFox OSSMaybe RewardedIssue may be eligible for a GrantFox rewardOfficial Campaign | FWC26Campaign: Official Campaign | FWC26enhancementNew feature or improvementfrontendFrontend / UI work

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions