Skip to content

[PLAN] AI Credits management widget for issue #61 #68

Description

@L03TJ3

[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.

Metadata

Metadata

Labels

No labels
No labels

Type

No fields configured for Task.

Projects

Status
Prepare AI Task

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions