✨ app: display activity entry for declined card purchases#1046
✨ app: display activity entry for declined card purchases#1046dieguezguille wants to merge 3 commits into
Conversation
🦋 Changeset detectedLatest commit: 2096113 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
|
Warning Review limit reached
More reviews will be available in 46 minutes and 44 seconds. Learn how PR review limits work. Your organization has run out of usage credits. Purchase more in the billing tab. ⌛ How to resolve this issue?After more reviews become available, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available. Please see our Fair Usage Limits Policy for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Pro Run ID: 📒 Files selected for processing (19)
WalkthroughServer now surfaces declined activity items. The activity list marks declined panda purchases (struck-through amount, adjusted processing logic). Declined items route to a new DeclinedActivity detail view that shows reason, amount, copyable transaction ID, and timestamp. Spanish/Portuguese translations and changesets added. ChangesDeclined Card Activity Display
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related PRs
Suggested reviewers
🚥 Pre-merge checks | ✅ 3 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
✨ Simplify code
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Code Review
This pull request implements the display of activity entries for declined card purchases. It updates the activity list item to visually indicate declined transactions, introduces a new DeclinedActivity component to show detailed failure reasons, adds corresponding localization strings, and stops filtering out declined transactions from the server response. The reviewer identified a critical runtime issue in DeclinedActivity.tsx where item.timestamp (which is a string at runtime) is passed directly to the date-fns format function, which will throw a RangeError. Wrapping item.timestamp in new Date() is recommended for both the date and time formatting fields.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 4722552f38
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## fixes #1046 +/- ##
==========================================
- Coverage 73.48% 73.47% -0.02%
==========================================
Files 243 243
Lines 10627 10638 +11
Branches 3555 3560 +5
==========================================
+ Hits 7809 7816 +7
- Misses 2505 2508 +3
- Partials 313 314 +1
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Actionable comments posted: 1
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: ASSERTIVE
Plan: Pro
Run ID: c61d193c-0392-417a-9e62-5dcbf6fbaaac
📒 Files selected for processing (9)
.changeset/warm-words-eat.mdsrc/components/activity/ActivityItem.tsxsrc/components/activity/details/ActivityDetails.tsxsrc/components/activity/details/DeclinedActivity.tsxsrc/components/card/Card.tsxsrc/i18n/es.jsonsrc/i18n/pt.jsonsrc/utils/isProcessing.tssrc/utils/server.ts
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 7ec29eccfb
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| t, | ||
| i18n: { language }, | ||
| } = useTranslation(); | ||
| const amount = `$${Math.abs(item.usdAmount).toLocaleString(language, { style: "decimal", minimumFractionDigits: 2, maximumFractionDigits: 2 })}`; |
There was a problem hiding this comment.
Display the declined authorization amount
When Panda sends a pending created authorization and later appends a declined created event for the same transaction, the stored payload contains both bodies (see server/test/hooks/panda.test.ts's merge case), and PandaActivity currently sums every non-requested operation into item.usdAmount in server/api/activity.ts. This new declined screen displays that aggregate directly, so those common declined purchases can show double the attempted amount; use the declined operation/details amount instead of the aggregate before rendering it.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Actionable comments posted: 2
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: ASSERTIVE
Plan: Pro
Run ID: 96f9703d-42a0-43a4-bf26-950773789ca4
📒 Files selected for processing (19)
.changeset/cuddly-beds-stick.md.changeset/goofy-candles-move.md.changeset/warm-words-eat.mdsrc/components/activity/ActivityItem.tsxsrc/components/activity/details/ActivityDetails.tsxsrc/components/activity/details/DeclinedActivity.tsxsrc/components/activity/details/OperationDetails.tsxsrc/components/activity/details/PurchaseDetails.tsxsrc/components/activity/details/TransactionDetails.tsxsrc/components/add-funds/AddCrypto.tsxsrc/components/card/Card.tsxsrc/components/card/CardDetails.tsxsrc/components/send-funds/Contact.tsxsrc/components/settings/Settings.tsxsrc/components/shared/ProfileHeader.tsxsrc/i18n/es.jsonsrc/i18n/pt.jsonsrc/utils/isProcessing.tssrc/utils/server.ts
closes #636
Summary by CodeRabbit
New Features
Bug Fixes / Behavior Changes