Skip to content

Refine wallet button filtering by exact platforms #97

@mois-ilya

Description

@mois-ilya

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

  1. Desktop case (hypothetical wallet)
  • Env: Windows desktop, Chrome.
  • Wallet: declares macos/linux but not windows.
  • Current: “Desktop app” button is still shown.
  • Expected: Do not show “Desktop app” when the current OS isn’t in the wallet’s platforms.
  1. Browser extension shown in Safari
  • Env: Safari.
  • Wallet: no safari in platforms, 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 safari is in platforms.
  1. Mobile OS mismatch
  • Env: iOS.
  • Wallet: only android in platforms.
  • Current: “Mobile” option is shown, leading to a broken flow.
  • Expected: On mobile, show “Mobile” only if the wallet declares the current mobile OS (ios on iPhone, android on 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 windows in platforms.
  • In Safari, “Browser extension” is not shown for wallets without safari in platforms.
  • On iOS, “Mobile” is shown only if ios is in platforms (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 (ios or android).
  • 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, only android, only windows, only macos, only linux, only chrome, only firefox, only safari.
  • 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions