Skip to content

feat: add an interactive guided-fix flow for network mismatches - #1097

Closed
Junirezz wants to merge 1 commit into
mainfrom
feat/1038-network-mismatch-guided-fix
Closed

feat: add an interactive guided-fix flow for network mismatches#1097
Junirezz wants to merge 1 commit into
mainfrom
feat/1038-network-mismatch-guided-fix

Conversation

@Junirezz

Copy link
Copy Markdown
Owner

Summary

Closes #1038.

Heads up for reviewers: #1038's title overlaps heavily with the already-merged "persistent network mismatch warning" PR (#608), which added the detector (useWalletNetwork) and the static warning banner (NetworkWarningBanner). This PR builds the piece that was still missing — the actual guided fix flow — rather than re-doing the detector/banner:

  • Added a "Show me how to fix this" action on the existing banner that opens a new NetworkMismatchGuideModal: numbered steps to switch networks in Freighter, plus a "check again" button.
  • Extended useWalletNetwork with a checkNow() escape hatch (and isChecking state) so "check again" re-reads the wallet's network immediately instead of waiting up to the existing 10s poll interval.
  • The modal reports back whether the switch worked and auto-closes once the mismatch is confirmed resolved, instead of the banner just silently disappearing on the next background poll.
  • Added i18n strings for the guide in both en and es, matching the existing catalog structure.

Test plan

  • Added useWalletNetwork.test.ts and NetworkMismatchGuideModal.test.tsx (neither existed before) — 12/12 passed
  • npx tsc -b — no new type errors (one pre-existing, unrelated ToastCenter.tsx error present on main before this change too)
  • Maintainer to manually verify the guided flow against a real Freighter network switch

🤖 Generated with Claude Code

The existing NetworkWarningBanner (#608) already detects a wallet/app
network mismatch and shows static switch instructions, but there was no
interactive way to act on it: the user had to manually switch networks in
Freighter and wait up to 10s for the next background poll to notice.

Add a "Show me how to fix this" action on the banner that opens a guided
NetworkMismatchGuideModal: numbered steps to switch networks in Freighter,
and a "check again" button that calls a new checkNow() escape hatch on
useWalletNetwork to re-read the network immediately instead of waiting for
the poll interval. The modal reports back whether the switch worked and
auto-closes once the mismatch is confirmed resolved, instead of just having
the banner silently disappear.

Adds i18n strings (en/es) for the guide, and test coverage for
useWalletNetwork and the new modal — neither had tests before.

Related to #1038, which duplicates #(network-mismatch-warning), already
resolved by #608 for the detector/banner half of this.
@esthertitilayo-dev

Copy link
Copy Markdown
Contributor

Closing — this was opened under the wrong GitHub account (repo owner's, not the assigned contributor's) due to a tooling mistake on my end. Re-opening correctly from a fork under the right account.

@Junirezz Junirezz closed this Jul 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Frontend: Implement network mismatch detector and guided fix flow

2 participants