Skip to content

Fix: AI Credits widget UX polish (errors, badges, Manage, buy flow)#81

Merged
blueogin merged 17 commits into
mainfrom
fix/ai-credit/ux-improvement2
Jul 16, 2026
Merged

Fix: AI Credits widget UX polish (errors, badges, Manage, buy flow)#81
blueogin merged 17 commits into
mainfrom
fix/ai-credit/ux-improvement2

Conversation

@blueogin

Copy link
Copy Markdown
Contributor

Description

  • Polishes AI Credits Buy/Manage UX for issue Feature: AI Credits Widget UX polish (errors, badges, Manage stats) #79: clearer payment errors, network/badge copy, credit history discoverability, stepper Ready vs In progress, hybrid drawer open on step advance, and Buy rate hint.
  • Keeps G$ balance as the hero signal; GoodID shows as a verified status badge (rates remain on amount fields).

Closes #79

How Has This Been Tested?

Please describe the tests that you ran to verify your changes.

Checklist:

  • PR title matches follow: (Feature|Bug|Chore) Task Name
  • My code follows the style guidelines of this project
  • I have followed all the instructions described in the initial task (check Definitions of Done)
  • I have performed a self-review of my own code
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • I have added reference to a related issue in the repository
  • I have added a detailed description of the changes proposed in the pull request. I am as descriptive as possible, assisting reviewers as much as possible.
  • I have added screenshots related to my pull request (for frontend tasks)
  • I have pasted a gif showing the feature.
  • @mentions of the person or team responsible for reviewing proposed changes

blueogin added 13 commits July 13, 2026 15:44
…ent for improved G$ amount display, including exact and compact formatting based on value thresholds
…ion and update WidgetTabs to utilize it for improved chain name display
…mponent for improved clarity and update tests to reflect GoodID verification status
…itsStatusNotice styling for improved user experience
…oved reliability and update test result images
…nts to include 'ready' state for improved flow management
@blueogin
blueogin requested review from a team and L03TJ3 July 14, 2026 12:05
@sirpy
sirpy requested a review from Copilot July 15, 2026 08:40

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR polishes the AI Credits widget buy/manage experience (issue #79) by simplifying badges/copy, improving payment failure messaging, adjusting the purchase stepper behavior, and making credit history/stats easier to scan and discover.

Changes:

  • Refines user-facing copy and UX cues (GoodID verified badge, network display name, “Ready” vs “In progress”, payment failure messaging).
  • Improves buy/manage usability (rate hint on Buy, clearer “Update Monthly Stream” label, expandable credit history + exact-value tooltip for large G$ stats).
  • Adds error-mapping to sanitize noisy on-chain/wallet errors and updates Storybook + Playwright state coverage accordingly.

Reviewed changes

Copilot reviewed 18 out of 30 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
tests/widgets/ai-credits-widget/states.spec.ts Updates Playwright assertions/screenshots for GoodID badge + payment_failed UX expectations.
packages/ui/src/index.ts Re-exports getChainDisplayName from ChainBadge.
packages/ui/src/components/WidgetTabs.tsx Uses getChainDisplayName(chainId) instead of “Chain {id}”.
packages/ui/src/components/stepperStyles.ts Adds new ready status style and includes it in focused statuses.
packages/ui/src/components/Stepper.tsx Makes ready steps pressable (when onStepPress is provided).
packages/ui/src/components-test/ChainBadge.tsx Adds chain name map entries + exposes getChainDisplayName.
packages/ai-credits-widget/src/quoteMath.ts Adds formatUsd1ToG for the “US$1 ≈ … G$” hint.
packages/ai-credits-widget/src/paymentErrors.ts New payment error mapper to sanitize wallet/on-chain errors into short user copy.
packages/ai-credits-widget/src/components/theme/cards.ts Tweaks notice card background to $backgroundHover.
packages/ai-credits-widget/src/components/manage/UsageLog.tsx Makes credit history show a short list with a “show more/less” toggle.
packages/ai-credits-widget/src/components/manage/CreditsManagementCard.tsx Adds hover/focus/tap tooltip to reveal exact values for compacted large G$ stats.
packages/ai-credits-widget/src/components/flow/AiCreditsPurchaseFlow.tsx Auto-opens the drawer when advancing steps (keeps closed on initial mount).
packages/ai-credits-widget/src/components/flow/AiCreditsFlowStepper.tsx Uses ready for the current step (and active only during payment pending/confirmed).
packages/ai-credits-widget/src/components/buy/AmountPicker.tsx Softer “Verify for +%” bonus labels, adds US$1 rate hint, and clarifies stream-update label.
packages/ai-credits-widget/src/components/buy/AiCreditsHero.tsx Replaces dense multi-line bonus pill with a simple “GoodID verified” badge.
packages/ai-credits-widget/src/AiCreditsWidget.tsx Removes “Try Again” button from payment_failed notice; adjusts toast fallback/duration and hero props.
packages/ai-credits-widget/src/adapter.ts Uses mapPaymentError for payment/validation failures and rethrows sanitized errors.
examples/storybook/src/stories/helpers/aiCreditsWidgetStories.tsx Updates payment_failed story error copy to match new UX.

Comment thread packages/ai-credits-widget/src/components/manage/UsageLog.tsx
Comment thread packages/ai-credits-widget/src/components/manage/UsageLog.tsx Outdated
sirpy
sirpy previously requested changes Jul 15, 2026

@sirpy sirpy left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you make sure to add images showing the new fixes

Comment thread packages/ai-credits-widget/src/paymentErrors.ts
Comment thread packages/ai-credits-widget/src/quoteMath.ts
Comment thread packages/ui/src/components-test/ChainBadge.tsx
blueogin and others added 3 commits July 15, 2026 09:53
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
@blueogin

Copy link
Copy Markdown
Contributor Author

@sirpy
I have updated the screenshots with Playwright

@github-project-automation github-project-automation Bot moved this to In Progress in GoodBounties Jul 16, 2026
@L03TJ3 L03TJ3 moved this from In Progress to In Review in GoodBounties Jul 16, 2026
@blueogin
blueogin dismissed sirpy’s stale review July 16, 2026 12:41

The comments are already addressed/answered

@blueogin
blueogin merged commit 1276f9f into main Jul 16, 2026
1 check passed
@github-project-automation github-project-automation Bot moved this from In Review to Deploy and Verify in GoodBounties Jul 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Deploy and Verify

Development

Successfully merging this pull request may close these issues.

Feature: AI Credits Widget UX polish (errors, badges, Manage stats)

4 participants