Skip to content

fix(connect-a-wallet-widget): harden wallet flows and QA (#245) - #249

Merged
L03TJ3 merged 3 commits into
GoodDollar:plan/connect-a-wallet-widgetfrom
edehvictor:fix/connect-a-wallet-follow-up-245
Oct 20, 2026
Merged

L03TJ3 merged 3 commits into
GoodDollar:plan/connect-a-wallet-widgetfrom
edehvictor:fix/connect-a-wallet-follow-up-245

Conversation

@edehvictor

@edehvictor edehvictor commented Oct 13, 2026 •

Copy link
Copy Markdown
Collaborator

Closes #245. Follow-up to #116, targeting plan/connect-a-wallet-widget.

Changes

  • Use independent HTTP clients for Fuse, Celo and XDC status reads; keep signing on the host wallet provider.
  • Show invalid-address feedback that clears on edit, and guard competing chain actions/address changes until the current request settles.
  • Cover cancellation, wallet rejection, reverted receipts, wallet changes and RPC failures with SDK-backed mocked interactions.
  • Keep only test-generated widget screenshots tracked; remove the manual Celo capture and update its QA references. No SDK, dependency or lockfile changes.
  • Guard dialog cleanup against stale wallet sessions and unmounted widgets.
  • Delegate wallet connection to core so host selectors can open before a provider exists. The small shared-core change preserves missing-provider feedback when neither a host connector nor a provider exists.

Verification

  • Install passed using pinned pnpm 9.15.0 and a local Windows store.
  • Targeted core and widget builds, scoped lint, and 17 existing core tests passed on October 15. The targeted builds used locally emitted dependency declarations because the clean workspace build is blocked below.
  • pnpm test:demo tests/widgets/connect-a-wallet-widget --workers=1 --retries=0: 31/31 passed, exit 0, on October 15, including the review regression cases.
  • Contributor-operated GoodWallet QA covered Celo link/unlink, cancellation, wallet rejection and persistence after refresh. The unlink receipt independently returned success.
  • pnpm build and pnpm lint remain blocked by the existing UI Select.tsx:7 Role type error, reproduced from unchanged base commit 3ce69ab6.

Evidence And Limits

Details: QA report.
Evidence: screenshots, 19 test-generated screenshots covering desktop/mobile states. Manual captures are not tracked; live-wallet observations and the public unlink receipt remain documented in the QA report.

  • Live Fuse/XDC transactions and physical-phone wallet flows were not tested.
  • GoodWallet QA used an ignored local WalletConnect chain-ID normalizer: UniversalProvider returned numeric 42220, which shared core parsed as hexadecimal. The chain-ID parsing correction is not included; it is separate from the connection-availability change above. These results do not establish unmodified WalletConnect compatibility.
  • No private keys, local connection configuration or debug logs are included.

Commits: initial implementation 074b5479, review fixes f42bc703, and screenshot cleanup 7c36eb25.

The October 19 cleanup changes only QA documentation and removes the manual PNG. Whitespace/reference checks passed, and all 19 remaining PNG names match test-script outputs. Runtime tests were not rerun for this documentation-only cleanup.

@edehvictor

Copy link
Copy Markdown
Collaborator Author

@L03TJ3 please review

@L03TJ3
L03TJ3 requested a balanced review from Copilot October 15, 2026 06:58

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

Deferred host connections are blocked, and stale transaction failures can dismiss another widget’s confirmation and leave it busy.

2 open findings
What changed in this PR

Hardens the existing Connect-a-wallet widget for #245, following #116, with independent chain reads, guarded wallet actions, and expanded QA.

Changes:

  • Uses chain-specific HTTP reads while retaining wallet signing.
  • Adds address-validation feedback and widget-wide busy guards.
  • Adds mocked interaction coverage and documents manual QA limits and screenshot storage.
File Description
tests/​widgets/​connect-a-wallet-widget/​walletFixture.ts Adds wallet and HTTP mocks.
tests/​widgets/​connect-a-wallet-widget/​QA.md Records verification, evidence, and limitations.
tests/​widgets/​connect-a-wallet-widget/​interactions.spec.ts Tests wallet flows, failures, and responsive states.
packages/​connect-a-wallet-widget/​src/​widgetRuntimeContract.ts Exposes validation and busy state.
packages/​connect-a-wallet-widget/​src/​components/​ConnectAWalletWidgetView.tsx Displays errors and disables competing actions.
packages/​connect-a-wallet-widget/​src/​components/​ChainLinkRow.tsx Supports widget-wide action disabling.
packages/​connect-a-wallet-widget/​src/​components/​AddressLinkForm.tsx Shows validation feedback and blocks busy edits.
packages/​connect-a-wallet-widget/​src/​adapter.ts Adds HTTP clients, operation guards, and receipt checks.
examples/​storybook/​src/​stories/​connect-a-wallet-widget/​ConnectAWalletWidget.interactions.stories.tsx Adds production-path interaction stories.
docs/​qa-guide.md Clarifies screenshot storage.
docs/​demo-environment.md Separates tracked evidence from temporary artifacts.
AGENTS.md Clarifies screenshot tracking requirements.

🧠 Review effort: Balanced


💡 Add a code-review agent skill for context-aware, tailored reviews. Learn more in the docs.

@edehvictor

Copy link
Copy Markdown
Collaborator Author

I have Implemented the review by copilot. You can inspect @L03TJ3

Comment thread packages/core/src/provider.tsx Resolved
@L03TJ3

L03TJ3 commented Oct 19, 2026

Copy link
Copy Markdown
Contributor

@edehvictor can you just respond to the remaining open questions, rest is approved and seems fine

Copy link
Copy Markdown
Collaborator Author

Thanks @L03TJ3, I’ve replied to both remaining threads, explained the provider change, and removed the manual screenshot in 7c36eb2. The PR description and QA notes are updated too. Appreciate the review.

@L03TJ3
L03TJ3 merged commit 63997e5 into GoodDollar:plan/connect-a-wallet-widget Oct 20, 2026
1 of 3 checks passed
L03TJ3 added a commit that referenced this pull request Oct 30, 2026
* Add ConnectAWalletWidget package with Storybook coverage and Playwright specs

Implements the ConnectAWalletWidget for linking a secondary wallet address to
the connected host wallet's GoodID across Fuse, Celo, and XDC via
@goodsdks/citizen-sdk's IdentitySDK. Adds QA runtime-fixture stories, a manual
showcase story, MDX docs, and a Playwright states spec covering the
disconnected, connecting, address-entry, checking, mixed per-chain row
statuses, unsupported-network, and top-level error/retry states.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>

* Add GoodDollar header and primary-identity card to connect-a-wallet-widget

Every widget in this repo renders its own GoodDollar/chain-badge header
inside its own view (see StreamingWidgetView) rather than relying on the
shared MiniAppShell for it — this widget was missing that, and the
"Primary verified identity" card showing which host address is linking
from, per the #113 design reference. Regenerated Playwright screenshots
to reflect both changes.

* Add ConnectAWalletWidget package with Storybook coverage and Playwright specs

Implements the ConnectAWalletWidget for linking a secondary wallet address to
the connected host wallet's GoodID across Fuse, Celo, and XDC via
@goodsdks/citizen-sdk's IdentitySDK. Adds QA runtime-fixture stories, a manual
showcase story, MDX docs, and a Playwright states spec covering the
disconnected, connecting, address-entry, checking, mixed per-chain row
statuses, unsupported-network, and top-level error/retry states.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>

* Add GoodDollar header and primary-identity card to connect-a-wallet-widget

Every widget in this repo renders its own GoodDollar/chain-badge header
inside its own view (see StreamingWidgetView) rather than relying on the
shared MiniAppShell for it — this widget was missing that, and the
"Primary verified identity" card showing which host address is linking
from, per the #113 design reference. Regenerated Playwright screenshots
to reflect both changes.

* Sammajayi/connect a wallet fixes (#135)

* fix: UI polish and lint fixes for connect-a-wallet-widget

- Fix missing Alert import crash on error/unsupported states
- Remove unused address prop from ChainLinkRow (lint fix)
- Restructure PrimaryIdentityCard layout (shield/text/copy)
- Reduce GlowCard shadow opacity and radius
- Update unlink SVG path to match lucide icon
- Add flexWrap to ChainLinkRow for 320px viewport support
- Reduce input/button sizes for small viewports
- Center address in verified identity box with wide gap
- Adjust heading spacing and checkmark position
- Update Playwright test screenshots

* fix: address Copilot review findings on connect-a-wallet-widget

Adds a changeSecondaryAddress adapter action and "Change address" button
so users can check a different address without reloading, replaces a
hardcoded RGBA background with the $infoMuted token, and swaps the
copy-address control for an accessible, focusable Button.

* fix: address pheobeayo review findings on connect-a-wallet-widget

Remove unused ChainRowCard export, disambiguate the duplicate "Connect
or Disconnect Address" heading, swap hover-tracked useState for
hoverStyle on the disconnect button (RN Web/touch compatible), and
clear the copy-feedback timeout on unmount.

* fix: restore hover text contrast on disconnect button

hoverStyle only flips the background to red; icon/label were still
hardcoded to error color, making them invisible on hover. Reintroduce
a small hover flag via onHoverIn/onHoverOut to swap text/icon to
white on hover, per pheobeayo's review.

* test: refresh connect-a-wallet-widget screenshots and fix stale spec assertion

The ready-state heading changed to 'Linked address' in earlier review-fix
commits; update the unsupported-network assertion and regenerate caw-05, 06,
08 and 09 so the committed evidence matches the current UI.

* fix: clear pending copy timeout before scheduling a new one

* fix(connect-a-wallet-widget): harden wallet flows and QA (#245) (#249)

* fix(connect-a-wallet-widget): harden wallet flows and QA (#245)

* fix(connect-a-wallet-widget): isolate stale dialogs and defer host connection

* docs(connect-a-wallet-widget): keep screenshot evidence test-generated

---------

Co-authored-by: BountyCoder <bountycoder@gooddollar.org>
Co-authored-by: Claude Sonnet 5 <noreply@anthropic.com>
Co-authored-by: goodbounties-nanoclaw-agent[bot] <307944451+goodbounties-nanoclaw-agent[bot]@users.noreply.github.com>
Co-authored-by: Samuel Ajayi <Samuelajayi554@gmail.com>
Co-authored-by: LewisB <laurence@gooddollar.org>
Co-authored-by: Victor Edeh <edehvictor715@gmail.com>

This branch is waiting to be deployed

1 waiting deployment
external — 7c36eb25 Waiting Oct 19, 2026 by edehvictor via authorize-tests #92
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.

3 participants