Feat/wallet payment failure states - #553
Merged
MaryammAli merged 2 commits intoAug 20, 2026
Merged
Conversation
Contributor
|
@IamOluwatoyin |
Contributor
Author
|
@MaryammAli apologies for that will look into that and rectify. |
IamOluwatoyin
force-pushed
the
feat/wallet-payment-failure-states
branch
from
August 19, 2026 13:33
c82ce84 to
5566b98
Compare
Wallet and payment pages handle disconnected, unsupported, or wrong-network states without broken UI, the transaction summary reflects the final status and recovery actions, and the client-side wallet state transitions are validated against a failure matrix. Reverted: The earlier broad implementation touched files outside the ticket scope (new modules wallet.ts, useWallet.ts, WalletGate.tsx, WalletStatusChip.tsx; edits to ActivePaymentState.tsx, PaymentPageClient.tsx; test-infra and marketplace fixes). All of it was reverted, and the branch was rewritten to contain ONLY the changes below. Scope (ticket's affected files only, plus two supporting files required by them): - app/pay/page.tsx: converted to a client component that gates the payment flow on wallet readiness and renders a recovery panel for unsupported, disconnected, or wrong-network states instead of broken UI. Local/mock mode keeps the existing demo flow working. - components/SigningSummary.tsx: final-status banner (pending/confirmed/rejected/expired/timeout) with recovery actions. - components/NetworkBadge.tsx: wallet-vs-app network mismatch chip (opt-in via walletNetwork/mismatch props). - components/QRPreview.tsx: accessible placeholder when no QR value is present. - components/Header.tsx: inline wallet status chip. - lib/api.ts: ApiNetworkError / isNetworkError / describeApiError; getProfile throws the typed error. - hooks/analyticsApi.ts: AnalyticsRequestError with status. - app/dashboard/page.tsx: bids/listings load errors + retry UI, wallet-gated withdraw; also fixes the pre-existing broken marketplaceApi imports so the page compiles. - app/settings/page.tsx: profile load error banner with retry. - Supporting files: src/lib/walletStatus.ts (pure wallet-state logic - Next.js forbids custom exports from a page file, so the matrix-tested logic lives here) and src/app/pay/__tests__/walletGate.test.ts (wallet failure matrix, 13 cases).
IamOluwatoyin
force-pushed
the
feat/wallet-payment-failure-states
branch
from
August 19, 2026 13:38
5566b98 to
14111b4
Compare
MaryammAli
approved these changes
Aug 20, 2026
MaryammAli
left a comment
Contributor
There was a problem hiding this comment.
LGTM
a job well don dev
Contributor
|
@IamOluwatoyin |
Contributor
Author
|
@MaryammAli done. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
62860a8 — feat(frontend): handle wallet & payment failure states
Pages can now recover gracefully when a wallet is unavailable, not connected, or on the wrong network, and the transaction summary no longer blocks on a missing signature.
Frontend:
Tests & infra:
Repairs pre-existing breakage on main so the frontend CI pipeline (eslint --max-warnings 0, tsc --noEmit, next build) is green again.
Verified locally: eslint clean, tsc --noEmit clean, next build succeeds (18 routes), vitest 142/142 passing.
Close #533