Fix: AI Credits widget UX polish (errors, badges, Manage, buy flow)#81
Merged
Conversation
… on flow type for improved user clarity
…ent for improved G$ amount display, including exact and compact formatting based on value thresholds
…fication requirements
…ion and update WidgetTabs to utilize it for improved chain name display
…mponent for improved clarity and update tests to reflect GoodID verification status
…le functionality for better user experience
…itsStatusNotice styling for improved user experience
…er feedback on payment failures
…oved reliability and update test result images
…nts to include 'ready' state for improved flow management
…er step transition handling
…ntPicker to display conversion rate
Contributor
There was a problem hiding this comment.
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. |
sirpy
previously requested changes
Jul 15, 2026
sirpy
left a comment
Contributor
There was a problem hiding this comment.
can you make sure to add images showing the new fixes
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>
…changes in purchase and payment states
Contributor
Author
|
@sirpy |
…hecks for gas and G$
L03TJ3
requested changes
Jul 15, 2026
L03TJ3
approved these changes
Jul 16, 2026
blueogin
dismissed
sirpy’s stale review
July 16, 2026 12:41
The comments are already addressed/answered
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Closes #79
How Has This Been Tested?
Please describe the tests that you ran to verify your changes.
Checklist: