-
Notifications
You must be signed in to change notification settings - Fork 73
Description
UI: Refine wallet button filtering by platforms using the user’s actual environment
Summary
Wallet connection buttons in the desktop connection modal (and related UIs) are shown based on high-level categories (mobile / desktop / extension) and the presence of any compatible platform in a wallet’s platforms field. This leads to options being shown that aren’t actually available in the user’s current environment, even though platforms already lists precise targets (ios, android, windows, macos, linux, chrome, firefox, safari).
Incorrect cases
- Desktop case (hypothetical wallet)
- Env: Windows desktop, Chrome.
- Wallet: declares
macos/linuxbut notwindows. - Current: “Desktop app” button is still shown.
- Expected: Do not show “Desktop app” when the current OS isn’t in the wallet’s
platforms.
- Browser extension shown in Safari
- Env: Safari.
- Wallet: no
safariinplatforms, but a generic JS/extension path exists. - Current: “Browser extension” is shown and then fails.
- Expected: when the current browser is Safari, show “Browser extension” only if
safariis inplatforms.
- Mobile OS mismatch
- Env: iOS.
- Wallet: only
androidinplatforms. - Current: “Mobile” option is shown, leading to a broken flow.
- Expected: On mobile, show “Mobile” only if the wallet declares the current mobile OS (
ioson iPhone,androidon Android).
Fail-open, not fail-closed
When the runtime environment cannot be determined reliably, prefer to show the broader, previously available options rather than hiding potentially valid ones. In other words, apply strict platform matching only when we’re confident about the environment; otherwise, keep current behavior so we don’t remove valid options.
Acceptance criteria
- On Windows, “Desktop app” is not shown for wallets without
windowsinplatforms. - In Safari, “Browser extension” is not shown for wallets without
safariinplatforms. - On iOS, “Mobile” is shown only if
iosis inplatforms(and analogously for Android). - On desktop, a “Mobile (QR/Universal link)” path can still be shown if the wallet supports at least one mobile platform (
iosorandroid). - If the environment is uncertain, the UI does not regress by hiding valid options (fail-open behavior).
Test matrix
Cover the combinations below with wallets that declare only the listed platforms to validate inclusion/exclusion rules:
-
Desktop:
- Windows / Chrome
- macOS / Safari
- Linux / Chrome
-
Mobile:
- iOS / Safari
- Android / Chrome
For each environment, verify:
- Wallets with only
ios, onlyandroid, onlywindows, onlymacos, onlylinux, onlychrome, onlyfirefox, onlysafari. - Mixed cases (e.g.,
chrome+firefox,macos+windows,ios+android).
Post-implementation follow-up (important)
After landing this change, audit the platforms lists across all wallets to ensure they accurately reflect what each wallet supports (desktop OSes, mobile OSes, and specific browsers). Correct any discrepancies so that the refined filtering aligns with reality and avoids new false negatives/positives.