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

@ -43,10 +43,17 @@ export async function connectWallet(page: Page): Promise<void> {
const screenWidth = await page.evaluate(() => window.screen.width);
console.log(`[wallet] screen.width = ${screenWidth}`);
// Check if wallet is already connected (e.g. wagmi auto-reconnected from storage)
const connectedButton = page.locator('.connect-button--connected').first();
if (await connectedButton.isVisible({ timeout: 1_000 }).catch(() => false)) {
console.log('[wallet] Wallet already connected (auto-reconnect)');
return;
}
let panelOpened = false;
const connectButton = page.locator('.connect-button--disconnected').first();
if (await connectButton.isVisible({ timeout: 5_000 })) {
if (await connectButton.isVisible({ timeout: 10_000 })) {
console.log('[wallet] Found desktop Connect button, clicking...');
await connectButton.click();
panelOpened = true;