Skip to content

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

Merged
Junirezz merged 1 commit into
Junirezz:mainfrom
esthertitilayo-dev:feat/1038-network-mismatch-guided-fix
Jul 29, 2026
Merged

feat: add an interactive guided-fix flow for network mismatches#1100
Junirezz merged 1 commit into
Junirezz:mainfrom
esthertitilayo-dev:feat/1038-network-mismatch-guided-fix

Conversation

@esthertitilayo-dev

Copy link
Copy Markdown
Contributor

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 (Junirezz#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 Junirezz#1038, which duplicates #(network-mismatch-warning), already
resolved by Junirezz#608 for the detector/banner half of this.
@drips-wave

drips-wave Bot commented Jul 29, 2026

Copy link
Copy Markdown

@esthertitilayo-dev Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

@Junirezz
Junirezz merged commit 32dee6a into Junirezz:main Jul 29, 2026
18 of 24 checks passed
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