Skip to content

Toast notification when auto-network-detect switches networks #93

Description

@Copexit

Follow-up from #91 (auto-detect network from txid on NOT_FOUND, merged as da32b55).

Context

When a user pastes a txid that doesn't exist on the currently-selected network, am-i.exposed now silently probes the other public mempool.space networks, switches the selector to the one that holds the tx, and re-runs the analysis. The only visible signal is the network selector chip changing.

PR #91's description flagged this as an open question:

The user is not told that an auto-switch happened beyond the network selector visibly changing. A small toast ("Switched to signet to find this transaction") would be a nice follow-up but feels separable from this fix.

Proposal

Surface a toast (or equivalent transient banner) when the auto-detection fires successfully, e.g.:

Switched to signet to find this transaction.

Notes

  • Only triggers on the auto-switch path inside the NOT_FOUND catch in src/hooks/useAnalysis.ts - the explicit user-driven network change should not trigger it.
  • Should be localized via i18next - reuse an existing toast component if one already lives in the project, otherwise scope is small enough that a transient inline status above the result card may be simpler than introducing a toast system.
  • i18n keys would land in public/locales/{lang}/common.json for all six locales.

Not blocking, polish only.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions