feat(card): show compact spending limit on Card Home for Solana limited tokens#29662
Conversation
|
CLA Signature Action: All authors have signed the CLA. You may need to manually re-run the blocking PR check if it doesn't pass in a few minutes. |
🔍 Smart E2E Test Selection
click to see 🤖 AI reasoning detailsE2E Test Selection:
These changes are purely within the Card UI feature area (CardHome screen and SpendingLimitProgressBar component). They don't touch core infrastructure, navigation, shared components, or other feature areas. The Performance Test Selection: |
|



Description
Card Home only showed the spending limit progress bar for EVM chains (
isEvmChain), because the original cap is resolved from on-chain Approval logs inBaanxProvider. Solana funding tokens inLimitedstatus therefore showed nothing, even though the Baanx API already returns the remaining allowance asspendingCap.This change:
showSpendingLimitProgressinCardHome.tsx, while keepingisSpendingLimitSupportedTokensoAUSDC/AMUSDstay excluded.hasOriginalAllowancetoSpendingLimitProgressBar: whenoriginalSpendingCapis absent (typical for Solana; also possible for EVM if log fetch fails), the component renders a compact row: same divider and “Spending Limit” label, then<remaining> <symbol> <localized “available”>with no progress bar (we cannot show consumed vs total without the original cap).card.card_home.spending_limit_availableinlocales/languages/en.json.SpendingLimitProgressBarcompact-mode coverage;CardHomeSolana limited case and the EVM “undefined allowance” case now expect the compact string instead of a misleading0/0full-bar display.Trade-off: Solana (and any asset without
originalSpendingCap) does not get a progress bar until a backend field or on-chain read path exists; users still see that spending is limited and how much remains.Changelog
CHANGELOG entry: Added a compact spending limit indicator on Card Home for limited Solana card funding tokens, showing remaining allowance when the original cap is not available.
Related issues
Fixes: #29550
Manual testing steps
Screenshots/Recordings
N/A — change is small UI copy/layout on Card Home; capture before/after on device or simulator when opening the PR for review if reviewers require visual proof.
Before
(Solana limited: no “Spending Limit” block on Card Home.)
After
Pre-merge author checklist
Performance checks (if applicable)
trace()for usage andaddTokenfor an exampleFor performance guidelines and tooling, see the Performance Guide.
Pre-merge reviewer checklist
Files changed (vs
main)app/components/UI/Card/Views/CardHome/CardHome.tsxisEvmChaingate; passhasOriginalAllowancefromoriginalSpendingCapapp/components/UI/Card/components/SpendingLimitProgressBar/SpendingLimitProgressBar.tsxhasOriginalAllowanceis false; i18n for “available”app/components/UI/Card/components/SpendingLimitProgressBar/SpendingLimitProgressBar.test.tsxapp/components/UI/Card/Views/CardHome/CardHome.test.tsxlocales/languages/en.jsoncard.card_home.spending_limit_availableNote
Low Risk
Low risk UI change that only alters when/how the Card Home spending-limit section is displayed and adds i18n copy; main risk is incorrect gating/labeling for limited assets across chains.
Overview
Shows a spending-limit indicator on Card Home for limited funding assets even when an
originalSpendingCapis unavailable (e.g., Solana), by removing the EVM-only gate and introducing a compactSpendingLimitProgressBarmode.SpendingLimitProgressBarnow acceptshasOriginalAllowanceto switch between the existing consumed/total progress bar and a remaining-only “<amount> <symbol> available” label (localized via newcard.card_home.spending_limit_available), with updated unit tests and CardHome expectations for Solana and undefined allowance cases.Reviewed by Cursor Bugbot for commit 1a2133d. Bugbot is set up for automated code reviews on this repo. Configure here.