Skip to content

Feat: AI Credit History Widget #72

Description

@blueogin

Short description of the new GoodWidget

A read-only widget that lists a payer’s AI credit events from the backend: G$ deposits, stream updates, and stream credit accruals. Users filter by event source and funding status, paginate through history, and see whether Base funding succeeded or failed per row.

Separate package from ai-credits-widget (buy) and ai-credits-manage-widget (dashboard). Can be embedded on the same page below management or used standalone.

Which repos and packages the AI should work with

Repo / package Role
GoodWidget New package packages/ai-credits-history-widget
GoodWidget/packages/ai-credits-widget Reuse mockBackendClient / getTransactions, microUsdToCredits, GdCreditEntry types
GoodWidget/packages/ui, packages/core List, filters, wallet address
antseed-integration (antseed) GET /v1/accounts/:account/transactions?status=&limit=&cursor=
Storybook examples/storybook Stories under ai-credits-history/

UI implementation reference

AI credit history

Source:  [✓ Deposit] [✓ Stream update] [✓ Stream request] [ ] Auto (cron)
Status:  [All ▾]

┌─────────────────────────────────────────────────────────┐
│ G$ deposit · Jun 25, 2026 · +0.66 cr · funded      ⓘ  │
│ Stream update · Jun 24, 2026 · 10 G$/mo            ⓘ  │
│ Stream credit · Jun 23, 2026 · +0.12 cr · pending ⓘ  │
└─────────────────────────────────────────────────────────┘

[ Load more ]
  • One compact line per row — do not stack G$, credits, tx hashes, and errors in the list.
  • ⓘ on each row — hover (web) or press opens tooltip/popover with full event description.
  • Title row only (no outer card required); list can live in one card or flat rows.
  • Empty state: “No credit events yet” when filter yields zero rows.

User flows, states and behaviours

Data source

GET /v1/accounts/{payer}/transactions

Response: { account, transactions: GdCreditEntry[], nextCursor? }

Each GdCreditEntry field — use in tooltip / detail popover, not all on the list row:

Field Tooltip / detail
source Event type label
gdAmountWei G$ amount
principalMicroUsd, bonusMicroUsd, totalCreditMicroUsd Credit breakdown
fundingStatus pending | funded | failed
fundingError Full message when failed
txHash Celo tx link or copy
fundingTxHash Base funding tx link or copy
createdAt Full timestamp
streamUpdateMonth Stream month context
buyerAddress Buyer address
id Entry id (optional, for support)

Source filter (mandatory UI)

Multi-select or checkboxes — always visible. Filter is applied client-side (backend has no source query param today).

source Default Label
deposit on G$ deposit
streamUpdate on Stream update
streamRequest on Stream credit (manual)
streamCron off Stream credit (auto)

Default set: deposit, streamUpdate, streamRequestexclude streamCron until user enables “Auto (cron)”.

Changing source filter re-filters loaded rows immediately; optionally refetch from API if status filter changed.

Funding status filter

Dropdown: All | Pending | Funded | Failed

When not “All”, pass ?status= to API on fetch / load-more (pending | funded | failed).

Pagination

  • Initial load: limit=20 (or 25).
  • Load more when nextCursor present; append rows.
  • Show loading spinner on fetch; error + retry on failure.

Row presentation (compact list + tooltip)

List row (single line only) — source label, short date, one summary value, funding status chip if relevant, info icon:

Source Row summary (visible)
deposit G$ deposit · {date} · {total credits} cr · {status}
streamUpdate Stream update · {date} · {G$/mo or “updated”}
streamRequest Stream credit · {date} · {total credits} cr · {status}
streamCron Stream credit (auto) · {date} · {total credits} cr · {status}

Failed rows: show failed chip on the line; do not inline full fundingError text in the list.

Tooltip / popover (full description) — opened from ⓘ on the row (hover on web, tap on mobile). Include all available fields for that entry, e.g.:

  • Event type and createdAt (full)
  • G$ amount (gdAmountWei)
  • Principal / bonus / total credits (formatted)
  • Funding status; if failed → fundingError
  • txHash, fundingTxHash (truncated in tooltip with copy)
  • streamUpdateMonth, buyerAddress when present

Use monospace for hashes. Tooltip content can be plain structured text or a small stacked block — not a second expanded list row.

Ask first if adding a shared Tooltip / Popover primitive to packages/ui; otherwise use web title, Tamagui popover, or a small local detail panel consistent with bonus-badge info pattern in manage widget.

Widget states

  • Wallet disconnected → connect prompt or rely on host wallet.
  • Connected, empty history → empty state copy.
  • Connected, filters exclude all → “No events match filters”.
  • Backend unavailable → error banner + retry.

Create the plan (keep this section in the issue body)

Create the plan

Based on the above description create an execution plan in a new sub-issue and preserve the original issue content unchanged.
Do not execute the plan until given instructions to do so.

Sub-issue requirements:

  • Title format: [DRAFT][PLAN] <what issue is being planned>
  • Type: Task
  • Description must start with: <sub-issue title>
  • Link the sub-issue back to this parent issue.

Instructions when creating the plan:

  • Map relevant files that are too be used as reference from all repos mentioned
  • import existing @GoodDollar packages
  • Map new components that should be created. Assess when a new component should be created in the new savings widget package or made part of the reusable packages/ui

Plan specification required sections:

  • Required states, flows, and behaviors
  • Execution plan
  • acceptance criteria
  • human-reviewer checklist

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    Status
    Prepare AI Task

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions