Skip to content

feat: add wallet reconnect retry action in disconnect banner (Issue #…#201

Merged
Chucks1093 merged 1 commit into
accesslayerorg:mainfrom
godamongstmen897:feat/issue-158-wallet-reconnect
Apr 28, 2026
Merged

feat: add wallet reconnect retry action in disconnect banner (Issue #…#201
Chucks1093 merged 1 commit into
accesslayerorg:mainfrom
godamongstmen897:feat/issue-158-wallet-reconnect

Conversation

@godamongstmen897

Copy link
Copy Markdown
Contributor

This pull request updates the WalletConnectCalloutBanner component to improve the wallet connection and reconnection experience. The changes introduce a new reconnection flow with user feedback, replacing the previous wallet connect button with a custom reconnect button that provides clearer status updates and error handling.

Wallet connection and reconnection improvements:

  • Added logic to handle wallet reconnection using wagmi hooks (useAccount, useConnect, useReconnect), including asynchronous reconnection attempts and fallback to connecting if reconnection fails. User feedback is provided via toast notifications for success, loading, and error states. [1] [2]
  • Replaced the ConnectWalletButton with a custom "Reconnect Wallet" button that is disabled during reconnection and displays appropriate text based on the connection state.
  • Improved error handling and user messaging to guide users in case of connection issues, such as prompting them to unlock their wallet or install a wallet extension if no connector is available.

Closes #158

Copilot AI review requested due to automatic review settings April 27, 2026 09:56
@drips-wave

drips-wave Bot commented Apr 27, 2026

Copy link
Copy Markdown

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

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR enhances the disconnected-wallet banner by adding an explicit “Reconnect Wallet” retry action that attempts a wagmi reconnection first and falls back to a fresh connect, with user feedback surfaced via toast notifications.

Changes:

  • Added reconnect + fallback connect logic using useAccount, useReconnect, and useConnect.
  • Replaced ConnectWalletButton with a custom reconnect button and toast-based status/error messaging.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +1 to +5
import { useState } from 'react';
import { Wallet } from 'lucide-react';
import { useAccount, useConnect, useReconnect } from 'wagmi';
import { cn } from '@/lib/utils';
import ConnectWalletButton from '@/components/common/ConnectWalletButton';
import showToast from '@/utils/toast.util';

Copilot AI Apr 27, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ConnectWalletButton was removed from this banner, and a repo-wide search shows it’s no longer imported anywhere. To avoid dead/unused UI code drifting out of sync, consider deleting src/components/common/ConnectWalletButton.tsx (or reusing it here) so there’s a single, maintained wallet connect entry point.

Copilot uses AI. Check for mistakes.
Comment on lines +25 to +29
const handleReconnect = async () => {
if (isReconnecting) {
return;
}

Copilot AI Apr 27, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This introduces non-trivial reconnect + fallback-connect behavior (and user feedback via toasts) but there are no component tests covering it. Since the repo already uses Vitest/Testing Library for common components, add tests that mock wagmi hooks to assert: (1) clicking disables the button / shows “Reconnecting…”, (2) successful reconnectAsync triggers the success toast, and (3) failed reconnect falls back to connectAsync (or surfaces an error toast).

Copilot uses AI. Check for mistakes.
@Chucks1093 Chucks1093 merged commit 7cf8a95 into accesslayerorg:main Apr 28, 2026
4 of 5 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.

Add wallet reconnect retry action in disconnect banner

3 participants