Skip to content

fix(citizen-claim-widget): keep claim toast visible through on-chain confirmation - #171

Draft
sirpy with Copilot wants to merge 2 commits into
fix/citizen-claim-toast-confirmationfrom
copilot/fix-citizen-claim-widget
Draft

fix(citizen-claim-widget): keep claim toast visible through on-chain confirmation#171
sirpy with Copilot wants to merge 2 commits into
fix/citizen-claim-toast-confirmationfrom
copilot/fix-citizen-claim-widget

Conversation

Copilot AI commented Aug 17, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Toast for a chain's claim used to stay on "sign transaction in your wallet" copy forever, even after the wallet had already signed and broadcast the tx — reported by @hadar Rottenberg (screenshot showed 3 stacked signing toasts for Celo/Fuse/XDC).
  • Rather than dismissing the toast at signing time (which would hide the still-pending on-chain confirmation), the toast now updates its copy/color the moment the tx is signed+broadcast, and only actually resolves/dismisses once the claim is confirmed on-chain.
  • The mid-flight signal is delivered via a new onTransactionSubmitted parameter threaded through ClaimSDK.claim()submitAndWait()'s existing onHash callback. A companion PR to GoodDollar/GoodSDKs exposes this from claim(); a temporary as any cast bridges the gap until that SDK release lands.

Changes

  • adapter.ts: removed the wrapProviderWithSubmissionSignal EIP-1193 provider proxy. onTransactionSubmitted is now passed directly as the second argument to sdk.claimSDK.claim(), delegating to ClaimSDK.submitAndWait's built-in onHash callback instead of intercepting at the provider level.
  • CitizenClaimWidget.tsx: on that signal, updates each chain's toast to "Claiming on <chain> — waiting for blockchain confirmation" with a confirming status, staying persistent (duration: 0) until the claim promise settles.
  • Toast.tsx: adds a confirming ToastStatus with a subtly deeper blue border ($primaryDark vs $primary for signing) so it reads as related-but-distinct from the initial signing toast, and stays clearly different from the green success state.
  • .github/workflows/deploy-ai-credits-web.yml / deploy-superfluid-campaign-web.yml: restored the broader push: main path triggers (packages/core/**, packages/ui/**, packages/embed/**, pnpm-lock.yaml, pnpm-workspace.yaml); the pull_request_target sections remain narrowed to app/widget-specific paths.

Scope note

Only the default non-custodial (wallet-provider-driven) claim path is covered — the one in the bug report. Custodial execution mode (claimExecution.clientsByChain) supplies pre-built clients from outside GoodWidget; flagging as a possible separate follow-up if that path is ever in scope.

Test plan

  • pnpm --filter @goodwidget/ui --filter @goodwidget/citizen-claim-widget --filter @goodwidget/superfluid-campaign-widget --filter @goodwidget/embed build — clean
  • pnpm --filter @goodwidget/ui --filter @goodwidget/citizen-claim-widget --filter @goodwidget/superfluid-campaign-widget --filter @goodwidget/embed lint — clean (only pre-existing warnings unrelated to this change)
  • Manual: connect wallet, claim on a chain, confirm toast updates from "sign transaction" → "waiting for blockchain confirmation" → "succeeded", never disappearing early (requires companion GoodSDKs PR to be merged and the SDK version bumped)

🤖 Generated with Claude Code

1. Restore push-path triggers for ai-credits-web and superfluid-campaign-web
   workflows (the pull_request_target section remains narrowed as-is).
2. Remove the wrapProviderWithSubmissionSignal provider proxy from adapter.ts.
3. Thread onTransactionSubmitted directly into sdk.claimSDK.claim() as the
   second argument (ClaimSDK.submitAndWait already accepts an onHash callback;
   a companion PR to GoodDollar/GoodSDKs will expose it from claim()).

Co-authored-by: sirpy <671095+sirpy@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix citizen claim widget to keep claim toast visible through on-chain confirmation fix(citizen-claim-widget): keep claim toast visible through on-chain confirmation Aug 17, 2026
Copilot AI requested a review from sirpy August 17, 2026 10:23
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.

2 participants