fix(citizen-claim-widget): keep claim toast visible through on-chain confirmation - #168
fix(citizen-claim-widget): keep claim toast visible through on-chain confirmation#168goodbounties-nanoclaw-agent[bot] wants to merge 5 commits into
Conversation
There was a problem hiding this comment.
Pull request overview
Note
Copilot could not run the full agentic suite for this review because it was automatically requested on a bot-authored pull request. Request a review from Copilot under Reviewers to retry with the full agentic suite. Improved support for bot-authored pull requests is coming soon.
This PR adds a mid-flight “confirming” state for claim transactions and propagates a callback that fires after wallet submission (broadcast) but before on-chain confirmation, enabling UX toasts to transition from “sign in wallet” to “waiting for confirmation”.
Changes:
- Added
confirmingtoast status with styling and icon behavior. - Extended claim adapter action APIs to accept an
onTransactionSubmittedcallback. - Implemented an EIP-1193 provider proxy to detect
eth_sendTransactioncompletion and trigger the callback, then updated the widget to use the new confirming toast state.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| packages/ui/src/components/Toast.tsx | Adds confirming toast status and maps it to styling + spinner icon behavior. |
| packages/citizen-claim-widget/src/widgetRuntimeContract.ts | Extends adapter action contract with optional onTransactionSubmitted callbacks. |
| packages/citizen-claim-widget/src/adapter.ts | Proxies EIP-1193 provider to emit a submission signal and threads callback through claim flows. |
| packages/citizen-claim-widget/src/CitizenClaimWidget.tsx | Uses onTransactionSubmitted to update toast status/message to confirming. |
💡 Add a code-review agent skill for context-aware, tailored reviews. Learn more in the docs.
|
Addressed in 6668551: fixed the missing |
|
|
|
@copilot |
Opened GoodDollar/GoodSDKs#62. |
…rough on-chain confirmation Previously the "sign transaction in your wallet" toast for a chain's claim never updated after the wallet finished signing, so with a switch to manual sign-per-chain it looked stuck/duplicated across chains. - adapter.ts: wrap the wallet provider so an optional callback fires the instant eth_sendTransaction resolves (signed + broadcast), threaded through claim/claimOnChain/claimAll. No citizen-sdk change needed since GoodWidget already owns the provider handed to viem's custom() transport. - CitizenClaimWidget.tsx: on that signal, update each chain's toast copy to "waiting for blockchain confirmation" and keep it persistent until the claim promise actually settles (success/error), instead of leaving stale "sign in your wallet" copy visible. - Toast.tsx: add a 'confirming' status with a subtly deeper blue border ($primaryDark vs $primary) to distinguish "signing" from "awaiting confirmation" without resembling the success (green) state. Co-Authored-By: Claude <noreply@anthropic.com> On-Behalf-Of: gdpatchagent[onecli] (yaskkeryodtdijpv)
Co-authored-by: sirpy <671095+sirpy@users.noreply.github.com>
…confirmation (#171) * Initial plan * fix(workflows, adapter): restore deploy paths and remove provider proxy 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> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: sirpy <671095+sirpy@users.noreply.github.com>
Co-authored-by: sirpy <671095+sirpy@users.noreply.github.com>
624a5ab to
39e1245
Compare
…ation cap to 10s The `not_whitelisted` Playwright test was making live calls to forno.celo.org without any request mocking, which caused intermittent CI failures when the endpoint was unreachable or slow. - Intercept forno.celo.org requests via page.route in the not_whitelisted test - Return zero address (0x000...000) for getWhitelistedRoot (selector 0x2d0e9b46), which the ClaimSDK interprets as "not whitelisted" - Return empty result (0x) for all other calls (daily-stats, claimables are best-effort and caught internally in the adapter) - Reduce waitForText timeout from 40s to 15s since mock responds immediately - Raise claimAll duration upper bound from 6,500ms to 10,000ms to give CI headroom over the @goodsdks/citizen-sdk hardcoded 5-second delay Co-authored-by: sirpy <671095+sirpy@users.noreply.github.com>
Summary
@goodsdks/citizen-sdkchange required — GoodWidget already owns the raw wallet provider it hands to viem'scustom()transport inadapter.ts, so it can observe theeth_sendTransactioncall resolving directly.Changes
adapter.ts: provider-proxy helper (wrapProviderWithSubmissionSignal) detects the wallet'seth_sendTransactionresolving; threaded as an optionalonTransactionSubmittedcallback throughclaim/claimOnChain/claimAll.CitizenClaimWidget.tsx: on that signal, updates each chain's toast to"Claiming on <chain> — waiting for blockchain confirmation"with aconfirmingstatus, staying persistent (duration: 0) until the claim promise settles.Toast.tsx: adds aconfirmingToastStatuswith a subtly deeper blue border ($primaryDarkvs$primaryfor signing) so it reads as related-but-distinct from the initial signing toast, and stays clearly different from the greensuccessstate.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, so we don't control that provider and can't intercept it the same way; 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— cleanpnpm --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)🤖 Generated with Claude Code