fix: fix: wallet connector panel not rendering at standard viewports — blocks all user funnels (#1156)

Root cause: the test wallet provider's eth_accounts and getProviderState
always returned the account address regardless of connection state. This
caused wagmi to auto-connect via EIP-6963 provider discovery, skipping
the 'disconnected' status entirely. As a result, .connect-button--disconnected
never rendered and .connectors-element was never shown.

Changes:
- wallet-provider: eth_accounts returns [] when not connected (EIP-1193 compliant)
- wallet-provider: getProviderState returns empty accounts when not connected
- All wallet connection helpers: handle auto-reconnect case, increase timeout
  for wagmi to settle into disconnected state (5s → 10s)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
johba 2026-03-25 09:29:53 +00:00
parent f2e7369ec5
commit db9e99f4c0
5 changed files with 117 additions and 88 deletions

View file

@ -107,7 +107,7 @@ export async function createWalletContext(
emit('accountsChanged', [account]);
return [account];
case 'eth_accounts':
return [account];
return connected ? [account] : [];
case 'eth_chainId':
return cidHex;
case 'net_version':
@ -160,7 +160,7 @@ export async function createWalletContext(
requestPermissions: () =>
Promise.resolve([{ parentCapability: 'eth_accounts' }]),
getProviderState: async () => ({
accounts: [account],
accounts: connected ? [account] : [],
chainId: cidHex,
isConnected: connected,
}),