Skip to content

[GoodBounty] Fix per-chain decimals, wallet-gate, and chain-selection bugs in Bridging GoodWidget #257

Open

Description

@goodbounties-nanoclaw-agent

Summary

Bugs found in manual + AI review of PR #251 (Bridging GoodWidget). Scope here covers issues that affect what the user signs or sees as correct. The History-tab fixes (grouping key, per-entry failure handling, pending polling) are already included on PR #251's branch (not yet merged to main) and are not part of this bounty — except for two regressions those fixes introduced, listed below.

Related: [Feature] #243, [Plan] #244, PR #251

Contributor task

  • Claim the bounty with an ETA.
  • Check out PR feat(bridging-widget): implement GoodWidget bridging widget (#243) #251's branch and run it locally.
  • Fix the issues below.
  • Add/update fixtures and test evidence, including the two fixed fixtures and the missing interactive submit-flow test called out below.
  • Leave a handoff comment with what changed and what was tested.

Scope checks

  • G$ decimals are derived per chain from bridging-sdk's SUPPORTED_CHAINS instead of the hardcoded G_DOLLAR_DECIMALS = 18 — source-chain decimals for input/balance/quote amount, destination-chain decimals for protocol fee/amount received. Currently breaks Fuse (122) and Ethereum (1), both 2-decimal G$ chains: useBridgeQuote.ts:64 reads an input of 100 as 10^18 on Fuse, producing a false "Insufficient G$ balance"; AmountEntry.tsx:34 / adapter.ts:111 show ~0 balance/MAX; FeeBreakdown.tsx / ReviewScreen.tsx show ~0 received amount/protocol fee when the destination is Fuse or Ethereum. Add Fuse-source and Fuse-destination fixtures.
  • Disconnected-wallet state keeps the Bridge UI visible with "Connect Wallet" as the primary action and balances shown as "—", using WalletControls from @goodwidget/core (per [Plan] [DRAFT][PLAN] Bridging GoodWidget using the bridging SDK #244) — currently WalletGate replaces the whole UI instead.
  • Source chain is freely selectable in-widget (not just inferred from the wallet's current connected chain), with live quotes updating as source/destination change. switchChain should only be requested when the user clicks Bridge, not at selection time.
  • LayerZero lists its actual supported chains instead of showing the generic label "LayerZero" (per the acceptance criteria).
  • Destination chain buttons and the header badge show chain names, not raw numeric chain IDs.
  • Displayed provider fee matches the actual amount charged — currently shown ~10% below what's sent due to an SDK buffer; surface the correct value.
  • Prevent submitting a stale quote: while a new quote is loading, the old quote and the Review button shouldn't stay actionable, and Retry must resubmit against the latest quote, not a stale one.
  • Reset route/amount state when the connected account or the selected source chain changes.
  • Fix two regressions introduced by the Oct 16 History-tab fix on PR feat(bridging-widget): implement GoodWidget bridging widget (#243) #251's branch: the list shouldn't flip back to a loading spinner and rescan every chain on each 15s poll; entries whose status lookup fails should render as pending (not be dropped), since those are exactly the in-flight ones.
  • Add an interactive Playwright test covering the full submit flow end-to-end (select route → amount → review → confirm → submit) — currently missing.
  • Fix two incorrect test/Storybook fixtures: a Fuse→Celo route fixture uses Axelar (Axelar only supports Celo↔ETH per spec); a "wrong chain" fixture uses Ethereum, which is actually a supported chain.

Decided, not a bug

  • Tapping a pending History entry opens a read-only detail drawer rather than the Confirm modal. Confirmed acceptable as-is — the drawer matches existing GoodWallet v2 mobile UX for similar dialogs (most users are on mobile). No change needed.

Out of scope / follow-ups (tracked separately)

  • SSR guard in register.ts (one-line fix, same pattern as ai-credits-widget) — low priority.
  • Explicit From/To network rows on the Confirm screen.
  • Playwright baseline screenshots are saved but not diffed/compared in CI.
  • Verify cloudflare-eth.com is still a live public RPC endpoint.
  • Accessibility: close-button keyboard focus/labels, MAX button semantics, keyboard-accessible history rows.
  • Upstream SDK bug in @goodsdks/bridging-sdk's getChainHistory (RPC block-range limits) — tracked in a separate GoodSDKs issue, does not block this bounty.
  • Two Copilot findings on PR feat(bridging-widget): implement GoodWidget bridging widget (#243) #251 were investigated and don't apply: the "show native token symbol on provider fee" comments were false positives — the SDK's fee string already includes the symbol; the Storybook fixture used in review was missing a unit, so the fixture needs fixing, not the widget. The SSR-guard finding is valid but was over-rated as "High" severity — the same pattern exists elsewhere in the repo.

Required commands

pnpm install
pnpm build
pnpm lint
pnpm test:demo tests/widgets/bridging-widget

If a command cannot be run, document why.

Handoff comment

Contributor: @<handle>
PR: #<pr>
Commit: <commit>

Fixed:

- <fix>

Verified:

- <scenario>: <result>

Evidence:

- <confirm which scenarios/UX flows are testable via the Playwright tests>

Remaining risks:

- <None / details>

Activity

  1. edehvictor commented on Oct 16, 2026

    @edehvictor
    Collaborator

    GM @L03TJ3 ,

    I’d like to take this on. I’m an active GoodDollar open-source contributor and have worked on GoodWidget/GoodWallet-related flows before, including implementation cleanup, UI consistency, Storybook/Playwright verification, and reviewer feedback fixes.

    I’ll review the requirements carefully, keep the changes scoped, run the needed checks, and provide a clear handoff when done.

    Please could you confirm the rewards amount.

    ETA: 18-32 hours.

  2. ayqy commented on Oct 16, 2026

    @ayqy

    Hi maintainers — is #257 still open to another contributor, or has the existing request to take it on already been accepted? Could you confirm the approved reward amount and payout currency/asset for the complete four-fix scope in PR #251: per-chain decimals, the disconnected-wallet UI, source-chain switching, and LayerZero chain labels? I would like to clarify the paid scope before duplicating work.

  3. changed the title [-][GoodBounty] Fix per-chain decimals, wallet-gate, and chain-selection bugs in Bridging GoodWidget[/-] [+][GoodBounty][DRAFT] Fix per-chain decimals, wallet-gate, and chain-selection bugs in Bridging GoodWidget[/+] on Oct 17, 2026
  4. L03TJ3 commented on Oct 17, 2026

    @L03TJ3
    Contributor

    @ayqy @edehvictor This bounty was prematurely posted and some details might still get updated.

    Added the label draft for this.
    will notify once the bounty is ready for pickup.

  5. edehvictor commented on Oct 17, 2026

    @edehvictor
    Collaborator

    Okay, @L03TJ3. Eyes on it 👀

  6. ocakciomursel-pixel commented on Oct 18, 2026

    @ocakciomursel-pixel

    Contributor: @ocakciomursel-pixel
    PR: #262
    Commit: 1250287

    Fixed:

    • Derived G$ token decimals per chain from @goodsdks/bridging-sdk's SUPPORTED_CHAINS (Fuse 122 & Ethereum 1 have 2 decimals, Celo 42220 & XDC 50 have 18 decimals) instead of hardcoding 18.
    • Used source-chain decimals for input parsing in useBridgeQuote.ts (resolving false INSUFFICIENT_BALANCE on Fuse/Ethereum) and for balance/MAX calculation in AmountEntry.tsx and adapter.ts.
    • Used destination-chain decimals for protocol fee and estimated received amount formatting in FeeBreakdown.tsx and ReviewScreen.tsx.
    • Disconnected-wallet state preserves the Bridge UI, displaying balance as — and Connect Wallet as the primary action, and mounts <WalletControls /> from @goodwidget/core in the header.
    • Allowed in-widget source chain selection across supported chains, triggering switchChain.
    • Expanded PROTOCOL_LABELS.LAYERZERO to list all supported chains: LayerZero (Celo, Ethereum, Fuse, XDC).

    Verified:

    • pnpm --filter @goodwidget/bridging-widget build: Clean build (ESM, CJS, DTS).
    • pnpm --filter @goodwidget/bridging-widget lint: 0 errors, 0 warnings.
    • Added Storybook fixtures FuseSource (Fuse 2 decimals as source -> Celo 18 decimals) and FuseDestination (Celo 18 decimals as source -> Fuse 2 decimals) in BridgingWidgetQA.stories.tsx.
    • pnpm test:demo tests/widgets/bridging-widget: 20/20 Playwright specs passed.
    • Baseline screenshots generated and committed under tests/widgets/bridging-widget/test-results/ (including bw-27-fuse-source.png and bw-28-fuse-destination.png).

    Evidence:

    • Disconnected wallet state with Connect Wallet CTA and Balance: — G$ verified via bw-01-no-wallet.
    • Source chain selection & navigation verified via bw-03-tab-navigation.
    • 2-decimal Fuse source balance and 18-decimal Celo destination received calculation verified via bw-27-fuse-source.
    • 18-decimal Celo source balance, 2-decimal Fuse protocol fee (0.25% (0.25 G$)), and received amount (99.75 G$) verified via bw-28-fuse-destination.
    • Review screen with per-chain formatted amounts verified via bw-13-review-open.
    • LayerZero expanded label verified across route summaries and detail views.

    Remaining risks:

    • None.
  7. changed the title [-][GoodBounty][DRAFT] Fix per-chain decimals, wallet-gate, and chain-selection bugs in Bridging GoodWidget[/-] [+][GoodBounty] Fix per-chain decimals, wallet-gate, and chain-selection bugs in Bridging GoodWidget[/+] on Oct 21, 2026
  8. moved this from Prepare AI Task to Ready-For-Assignment in GoodBountieson Oct 21, 2026
  9. L03TJ3 commented on Oct 21, 2026

    @L03TJ3
    Contributor

    @edehvictor you are assigned

  10. moved this from Ready-For-Assignment to In Progress in GoodBountieson Oct 21, 2026
  11. edehvictor commented on Oct 21, 2026

    @edehvictor
    Collaborator

    Thank you @L03TJ3

    On it already.

  12. edehvictor commented on Oct 22, 2026

    @edehvictor
    Collaborator

    Handoff Comment

    Contributor: @edehvictor
    PR: #266
    Commit: cda1d37

    Fixed:

    • Corrected chain-specific G$ amounts across quotes, fees, and history, including 2-decimal Fuse amounts.
    • Improved source-chain selection, disconnected-wallet flow, light-theme contrast, and mobile controls.
    • Prevented stale quotes from enabling Review and kept history entries visible when an explorer status lookup fails.
    • Expanded Storybook states, Playwright coverage, and screenshots for Fuse routes and the route-to-submit flow.

    Verified:

    • Bridging-widget lint and build: Passed ✅
    • pnpm test:demo tests/widgets/bridging-widget — 21 tests: Passed ✅
    • Bridge-history unit tests — 3 tests: Passed ✅

    Evidence:

    • The browser tests cover the key bridge flows and UI states. Running pnpm test:demo tests/widgets/bridging-widget reproduces them; refreshed screenshots include desktop, mobile, light-theme, and modal states.

    Remaining Risks:

    • Real-wallet switching, signing, fees, rejection/retry, and delivery still need manual verification.
    • Full-workspace lint fails on a pre-existing unused import in the unrelated governance widget; bridging-widget lint passes.
  13. moved this from In Progress to In Review in GoodBountieson Oct 29, 2026
  14. MavDavis commented on Nov 1, 2026

    @MavDavis

    still need a reviewer for thus? I can take it.

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

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions