Skip to content

Add AI Credits management dashboard with source-filtered historical credits#69

Draft
Copilot wants to merge 31 commits into
mainfrom
copilot/ai-credits-management-widget
Draft

Add AI Credits management dashboard with source-filtered historical credits#69
Copilot wants to merge 31 commits into
mainfrom
copilot/ai-credits-management-widget

Conversation

Copilot AI commented Jun 26, 2026

Copy link
Copy Markdown
Contributor

This update implements the AI Credits management experience on top of the existing widget flow, consolidating post-purchase controls and account visibility into one coherent screen. It adds the required sections and behavior, including mandatory historical source filtering with streamCron excluded by default.

  • Management dashboard surface

    • Introduces a unified post-purchase management view with:
      • bonus badge (+10% / +20%) and explanatory help toggle
      • AI credits summary (total now, estimated monthly stream) and Buy/Add credit action stub
      • G$ account overview (wallet balance + deposited G$)
      • stream management subsection (current flow, Update flow action stub)
      • operator section (operator address, sign/generate actions, consent state, public/private key display)
  • Historical credits + mandatory source filter

    • Extends historical entries with source and gdAmount metadata.
    • Adds required source controls: deposit | streamUpdate | streamRequest | streamCron.
    • Default filter excludes streamCron until explicitly enabled.
    • Handles filtered-empty state with explicit UI feedback.
  • Data shaping and mock backend alignment

    • Enhances backend usage-entry mapping to expose filterable credit origin fields.
    • Updates mock settlement/event generation to emit source-aware credit entries compatible with management history rendering.
  • QA fixture and smoke coverage alignment

    • Adjusts widget fixture states and smoke assertions to validate management sections and source-filter behavior against the new UI contract.
<UsageLog entries={state.usageLog} />
// UsageLog now enforces source filtering with default enabled sources:
// ['deposit', 'streamUpdate', 'streamRequest']
// `streamCron` is hidden until the user enables it.

Copilot AI and others added 25 commits June 23, 2026 12:49
- widgetRuntimeContract.ts: 13 states, all action types, adapter factory pattern
- mockBackendClient.ts: interface + mock + production client, createBackendClient factory
- adapter.ts: useAiCreditsAdapter hook with full state machine (EIP-712 consent, buyer key gen, Celo payment)
- aiCreditsComponents.tsx: all widget-specific components (AiCreditsHero, BuyerKeyPanel, OperatorConsentStep, AmountPicker, CreditsBalance, SetupSnippet, UsageLog, AiCreditsFlowStepper)
- AiCreditsWidget.tsx: main widget with GoodWidgetProvider wrapper and state-driven render
- integration.ts: manifest with Celo+Base chain IDs and all 13 states
- element.ts + register.ts: <ai-credits-widget> web component bridge
- index.ts: public exports
- Storybook stories: QA + Showcase stories for all 13 states
- aiCreditsWidgetStories.tsx: mock state factory and story helpers
- Playwright smoke tests: states.spec.ts covering all states
- pnpm build passes, pnpm lint passes (0 errors)
…eposit (transferAndCall) in one tx

Co-authored-by: blueogin <43612769+blueogin@users.noreply.github.com>
Co-authored-by: blueogin <43612769+blueogin@users.noreply.github.com>
…ots (13/13 pass)

Co-authored-by: blueogin <43612769+blueogin@users.noreply.github.com>
Copilot AI and others added 2 commits June 26, 2026 14:49
Co-authored-by: blueogin <43612769+blueogin@users.noreply.github.com>
Co-authored-by: blueogin <43612769+blueogin@users.noreply.github.com>
Copilot AI changed the title [WIP] Add AI Credits management widget for issue #61 Honor draft-plan gate for AI Credits management widget Jun 26, 2026
Copilot AI requested a review from blueogin June 26, 2026 14:54
Copilot AI and others added 4 commits June 26, 2026 15:00
Co-authored-by: blueogin <43612769+blueogin@users.noreply.github.com>
…nto copilot/ai-credits-management-widget

Co-authored-by: blueogin <43612769+blueogin@users.noreply.github.com>
Co-authored-by: blueogin <43612769+blueogin@users.noreply.github.com>
Co-authored-by: blueogin <43612769+blueogin@users.noreply.github.com>
Copilot AI changed the title Honor draft-plan gate for AI Credits management widget Add AI Credits management dashboard with source-filtered historical credits Jun 26, 2026
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.

2 participants