Skip to content

Citizen-claim-widget: contract-sourced how-it-works copy (invite rewards) - #191

Draft
goodbounties-nanoclaw-agent[bot] wants to merge 3 commits into
copilot/integrate-invite-sdk-into-widgetfrom
fix/citizen-claim-how-it-works-contract-copy
Draft

Citizen-claim-widget: contract-sourced how-it-works copy (invite rewards)#191
goodbounties-nanoclaw-agent[bot] wants to merge 3 commits into
copilot/integrate-invite-sdk-into-widgetfrom
fix/citizen-claim-how-it-works-contract-copy

Conversation

@goodbounties-nanoclaw-agent

Copy link
Copy Markdown
Contributor

Closes #190. Stacked on draft PR #91 (Integrate InviteSDK rewards flow into citizen claim widget).

What

The invite rewards "how it works" drawer showed generic, fully hardcoded copy. This aligns it with GoodWallet's InviteView step copy, sourcing minimumDays/minimumClaims from the InvitesV2 contract via InviteSDK.getMinimums() instead of hardcoding them. Surrounding step copy stays hardcoded/English-only for now, per requester direction.

Changes

  • inviteAdapter.ts: add getMinimums to the SDK plumbing (InviteSnapshotSdk/InviteWriteSdk), include minimums in the loaded snapshot / InviteState.
  • InviteRewards.tsx: HowItWorksDrawer now mirrors GoodWallet's 4-step explainer and interpolates state.minimums.minimumClaims / minimumDays.
  • inviteAdapter.spec.ts: fake SDK now implements getMinimums; added assertion covering snapshot.minimums.

Verification

  • pnpm turbo run build --filter=@goodwidget/citizen-claim-widget — pass
  • pnpm turbo run lint --filter=@goodwidget/citizen-claim-widget — pass
  • pnpm test:demo (Playwright) on tests/widgets/citizen-claim-widget/inviteAdapter.spec.ts — pre-existing failure reproduced identically on the unmodified base branch, unrelated to this change: the Node-based Playwright collector can't parse the React Native-flavored syntax in @tamagui/lucide-icons/react-native-svg, which packages/ui re-exports transitively. Flagging as a separate repo test-infra gap, out of scope here.

Out of scope

  • Native-app redirect handling for the claim widget — separate open research item, tracked with the requester directly.

…inimums

Add getMinimums to the adapter's SDK plumbing and surface minimums on
InviteState so consumers can source contract thresholds instead of
hardcoding them.

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

On-Behalf-Of: gdpatchagent[onecli] (yaskkeryodtdijpv)
…thresholds

Mirror GoodWallet's InviteView 4-step explainer in the how-it-works
drawer, interpolating minimumClaims/minimumDays from state.minimums
instead of showing generic hardcoded copy.

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

On-Behalf-Of: gdpatchagent[onecli] (yaskkeryodtdijpv)
Extend the fake SDK double with getMinimums and assert the loaded
snapshot carries the contract thresholds.

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

On-Behalf-Of: gdpatchagent[onecli] (yaskkeryodtdijpv)
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.

0 participants