Skip to content

Finalize citizen claim Invite Rewards states and evidence#111

Closed
AntonsBB wants to merge 5 commits into
GoodDollar:mainfrom
AntonsBB:codex/gooddollar-invite-rewards
Closed

Finalize citizen claim Invite Rewards states and evidence#111
AntonsBB wants to merge 5 commits into
GoodDollar:mainfrom
AntonsBB:codex/gooddollar-invite-rewards

Conversation

@AntonsBB

Copy link
Copy Markdown

Context

Continuation of #91 on top of the current main branch. The original PR head is not writable from this contributor account, so this branch preserves its InviteSDK commits, resolves its main-branch conflicts, and adds only the #109 completion work.

Closes #109. References #84 and #85.

Fixed

  • Uses protocol-provided totalApprovedInvites and totalEarned values instead of labelling every registered invitee as approved.
  • Distinguishes approved, pending, and currently collectable rewards while keeping each pending address visible.
  • Enables batch collection only when getCollectableInvitees() reports at least one eligible pending invitee.
  • Preserves waiting invitees after a successful collect refresh.
  • Keeps join and collection success/error feedback visible after refresh and after the conditional join card disappears.
  • Reuses an already-registered personal code for deferred inviter attachment.
  • Adds a deterministic adapter factory consistent with the repository's existing fixture pattern.
  • Adds ready, pending, collectable, success, and error Storybook fixtures plus desktop/mobile screenshot evidence.
  • Updates the README to the installed InviteSDK 1.0.3 behavior.

Acceptance checklist

  • Approved, pending, collectable, and total-earned data use the correct SDK/protocol fields.
  • Collection is gated by the SDK collectable list, not campaign activity.
  • Deferred inviter attachment reuses the original personal code and remains governed by the existing protocol rule.
  • Join and collection feedback remains visible after state refreshes.
  • Tests exercise the shared adapter action helpers and UI action path with deterministic fixtures.
  • Ready, pending, collectable, success, error, desktop, and mobile states have curated evidence.
  • The scoped package builds and all edited files lint cleanly.

Verification

  • Citizen claim package dependency build: passed (ui, core, embed, then citizen-claim-widget via tsup; declaration output included).
  • ESLint on the citizen package, edited stories, and focused specs: passed.
  • Prettier check on all edited text files: passed.
  • Playwright: 11/11 focused Invite Rewards tests passed with one worker.
  • Manual evidence: screenshots ccw-06 through ccw-11 cover ready, pending, collectable, success, error, and 390x844 mobile.
  • Textual diff credential scan: no credential-like additions detected.

The frozen-lockfile install verified the lockfile and installed all workspace dependencies. In this local Codex runtime, pnpm's supply-chain wrapper required explicit approval for the existing esbuild and @swc/core install scripts; that approval was local only and no pnpm-workspace policy change is included.

Remaining risk

No live payout was submitted. Contract reads/writes, preconditions, simulations, and non-eligible-pending behavior remain delegated to @goodsdks/invite-sdk as required; deterministic fixtures cover the UI and adapter orchestration without requiring a live wallet.

Copilot AI and others added 5 commits July 16, 2026 04:50
Co-authored-by: L03TJ3 <6606028+L03TJ3@users.noreply.github.com>
Co-authored-by: L03TJ3 <6606028+L03TJ3@users.noreply.github.com>
…te-rewards

# Conflicts:
#	pnpm-lock.yaml
#	tests/widgets/citizen-claim-widget/test-results/ccw-01-loading.png
#	tests/widgets/citizen-claim-widget/test-results/ccw-02-not-whitelisted.png
#	tests/widgets/citizen-claim-widget/test-results/ccw-03-error.png
#	tests/widgets/citizen-claim-widget/test-results/ccw-04-retry-clicked.png
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.

[GoodBounty]: Finalize citizen claim Invite Rewards PR

3 participants