Skip to content

[WIP] Add AI credits management widget for issue #61#70

Draft
Copilot wants to merge 1 commit into
mainfrom
copilot/add-ai-credits-management-widget
Draft

[WIP] Add AI credits management widget for issue #61#70
Copilot wants to merge 1 commit into
mainfrom
copilot/add-ai-credits-management-widget

Conversation

Copilot AI commented Jun 26, 2026

Copy link
Copy Markdown
Contributor

Thanks for asking me to work on this. I will get started on it and keep this PR's description up to date as I form a plan and make progress.


This section details on the original issue you should resolve

<issue_title>[PLAN] AI Credits management widget for issue #61</issue_title>
<issue_description>[DRAFT][PLAN] AI Credits management widget for issue #61

Parent issue: #61

Required states, flows, and behaviors

  • Management widget contains these sections in one coherent screen:
    • Bonus badge (10% / 20%) with tooltip explaining bonus eligibility and calculation.
    • AI credit section: total AI credits now, estimated monthly stream, and Buy/Add credit button (onclick TODO route to add-credit widget).
    • G$ account overview section (renamed from “G$ management”): G$ wallet balance and deposited G$.
    • Stream management subsection under G$ account overview: current flow and Update flow action.
    • Operator section: operator address, sign & generate flow, consent state, private/public key display area.
    • Historical credit section: backend-driven list with mandatory source filter (deposit | streamUpdate | streamRequest | streamCron) where streamCron is excluded by default until explicitly selected.
  • Behavior must align with existing AI credits widget journey and include loading/empty/error states for each data block.
  • Routing/action stubs are acceptable where parent issue explicitly allows TODO wiring.

Execution plan

  1. Re-validate parent issue AI Credits Widget: Buy AI coding credits with G$ #61 scope and keep this issue in planning-only state (no implementation).
  2. Map reference files in GoodDollar/GoodWidget:
    • packages/ai-credits-widget/** (existing flow, adapter/runtime contract)
    • packages/claim-widget/** (layout/flow patterns)
    • packages/ui/** (tokens, reusable primitives)
    • packages/core/** and packages/embed/** (provider/embed boundaries)
    • examples/storybook/src/stories/** and fixtures under examples/storybook/src/fixtures/**
    • tests/widgets/ai-credits-widget/** for smoke coverage shape
  3. Map cross-repo integration targets (read-only references):
    • GoodDollar/GoodWallet
    • GoodDollar/GoodProtocolUI
  4. Confirm backend contract/API updates required for historical-credit source filtering and default streamCron exclusion; reconcile with latest local backend project changes before implementation.
  5. Define component split:
    • Keep AI-credit-management-specific blocks in packages/ai-credits-widget.
    • Promote only broadly reusable primitives (if any) to packages/ui.
  6. Prepare Storybook stories (custodial/non-custodial) for each major section/state and Playwright smoke flows/screenshots under tests/widgets/ai-credits-widget/.
  7. Validate implementation plan against acceptance criteria and request human review before removing [DRAFT].

acceptance criteria

  • Sub-issue remains planning-only ([DRAFT][PLAN]) and linked to parent AI Credits Widget: Buy AI coding credits with G$ #61.
  • Planned UI includes all required sections and the renamed “G$ account overview”.
  • Historical credit source filter is mandatory and streamCron is not shown by default.
  • Plan explicitly identifies repository file references, cross-repo integration targets, and backend sync checkpoint.
  • Plan states component ownership decision criteria (packages/ai-credits-widget vs packages/ui).
  • Plan includes Storybook + Playwright validation expectations.

human-reviewer checklist

  • Title/description follow GoodWidget planning conventions.
  • Parent linkage to AI Credits Widget: Buy AI coding credits with G$ #61 is present.
  • All requested management-widget sections are captured.
  • “G$ management” was renamed appropriately.
  • Mandatory source filter behavior and streamCron default exclusion are captured.
  • Backend update verification step is explicit.
  • References to GoodWidget, GoodWallet, and GoodProtocolUI are listed.
  • Plan is ready for review and not for execution yet.</issue_description>
  • Closes [PLAN] AI Credits management widget for issue #61 #68

<agent_instructions>The ai-credits-widget is on the copilot/buy-ai-coding-credits branch in the GoodWidget repo.</agent_instructions>

Comments on the Issue (you are @copilot in this section)

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.

[PLAN] AI Credits management widget for issue #61

2 participants