fix(frontend): populate wallet groups when projectId empty (GitLab #203) #386

Merged
Brouie merged 1 commit from fix/glab-203-wallet-modal-empty-on-missing-projectid into main 2026-05-14 13:38:48 +00:00
Brouie commented 2026-05-14 03:58:58 +00:00 (Migrated from gitlab.com)

Closes #203.

Root cause

frontend/src/wagmi-config.ts had a 3-branch ternary:

  1. useE2EMockWallet === "1" → mock connector
  2. else if projectId set → getDefaultConfig with full rainbowKitWalletGroups
  3. else → createConfig({ connectors: [injected()] }) with no rainbowkit wallets

AppProviders.tsx:26 wraps the app in <RainbowKitProvider> regardless of branch. When branch 3 fired, the modal mounted and the static right-panel ("What is a Wallet?") rendered, but the left wallet-list was empty because no wallets groups were passed at config time. The "intermittent" feel came from EIP-6963 timing (announce delay after page load), but the root cause was deterministic: empty VITE_WALLETCONNECT_PROJECT_ID in .env.local triggers branch 3 every time.

Prod (yieldomega.com) is not affected — bundle has projectId baked in, hits branch 2.

Fix

Branch 3 now uses getDefaultConfig with:

  • A placeholder projectId string (never reaches a real WC server because walletConnectWallet is omitted from the wallets list)
  • A reduced wallets group: [safeWallet, metaMaskWallet, safepalWallet] only — dropped walletConnectWallet, rainbowWallet, baseAccount since they require a real WC project id to function

Also dropped the now-unused injected import from wagmi/connectors, and updated the console.info copy to accurately reflect the new behavior (injected-detection wallets, not raw injected-only fallback).

Tests

New frontend/src/wagmi-config.test.ts covers all 3 branches:

  • Branch 3 (empty projectId): config has connectors, length > 1 (asserts the original symptom — empty list — does NOT happen)
  • Branch 2 (real projectId): config has connectors, length > 1
  • Branch 1 (E2E mock): single mock connector

Suite delta: 325/325 → 328/328 across 59 → 60 files. Zero regressions.

Verification

Repro before fix: .env.local with no VITE_WALLETCONNECT_PROJECT_ID, open Connect Wallet modal cold → blank left panel matching nullvector's screenshot.

After fix: same setup, modal left panel shows Popular group with Safe / MetaMask / SafePal. WalletConnect option correctly absent. console.info still fires so dev sees the warning.

Closes #203. ## Root cause `frontend/src/wagmi-config.ts` had a 3-branch ternary: 1. `useE2EMockWallet === "1"` → mock connector 2. `else if projectId set` → `getDefaultConfig` with full `rainbowKitWalletGroups` 3. `else` → `createConfig({ connectors: [injected()] })` with no rainbowkit `wallets` `AppProviders.tsx:26` wraps the app in `<RainbowKitProvider>` regardless of branch. When branch 3 fired, the modal mounted and the static right-panel ("What is a Wallet?") rendered, but the left wallet-list was empty because no `wallets` groups were passed at config time. The "intermittent" feel came from EIP-6963 timing (announce delay after page load), but the root cause was deterministic: empty `VITE_WALLETCONNECT_PROJECT_ID` in `.env.local` triggers branch 3 every time. Prod (yieldomega.com) is not affected — bundle has projectId baked in, hits branch 2. ## Fix Branch 3 now uses `getDefaultConfig` with: - A placeholder `projectId` string (never reaches a real WC server because `walletConnectWallet` is omitted from the wallets list) - A reduced `wallets` group: `[safeWallet, metaMaskWallet, safepalWallet]` only — dropped `walletConnectWallet`, `rainbowWallet`, `baseAccount` since they require a real WC project id to function Also dropped the now-unused `injected` import from `wagmi/connectors`, and updated the console.info copy to accurately reflect the new behavior (injected-detection wallets, not raw injected-only fallback). ## Tests New `frontend/src/wagmi-config.test.ts` covers all 3 branches: - Branch 3 (empty projectId): config has connectors, length > 1 (asserts the original symptom — empty list — does NOT happen) - Branch 2 (real projectId): config has connectors, length > 1 - Branch 1 (E2E mock): single mock connector Suite delta: 325/325 → 328/328 across 59 → 60 files. Zero regressions. ## Verification Repro before fix: `.env.local` with no `VITE_WALLETCONNECT_PROJECT_ID`, open Connect Wallet modal cold → blank left panel matching nullvector's screenshot. After fix: same setup, modal left panel shows Popular group with Safe / MetaMask / SafePal. WalletConnect option correctly absent. console.info still fires so dev sees the warning.
Brouie commented 2026-05-14 03:59:49 +00:00 (Migrated from gitlab.com)

mentioned in issue #203

mentioned in issue #203
PlasticDigits commented 2026-05-14 13:38:49 +00:00 (Migrated from gitlab.com)

mentioned in commit 4ec2018fda

mentioned in commit 4ec2018fda14e329d64439d34563ceb941a4078d
PlasticDigits (Migrated from gitlab.com) merged commit 4ec2018fda into main 2026-05-14 13:38:49 +00:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
code/yieldomega!386
No description provided.