fix(Rewards): Move company name in Benefits cards - #34568
Conversation
Also use validTo as a fallback for actionDate when displaying time left.
|
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. |
PR template — items to address before "Ready for review"Warnings — informational, address before merging:
See docs/readme/ready-for-review.md for the full Definition of Ready for Review. |
## Summary - Move the benefit company name from the title row to the footer row alongside the remaining-time countdown. - Keep the company name right-aligned when no countdown is available. - Use `validTo` as the preferred countdown date, falling back to `actionDate`. - Treat empty or malformed dates as unavailable and try the fallback date. - Allow both `validTo` and `actionDate` to be nullable. - Apply the countdown logic consistently to benefit cards and the full benefit view. - Update benefit card typography and clock sizing for the compact layout. - Add stable footer test identifiers and replace the fragile React instance comparison. - Add tests covering date priority, fallback behavior, malformed dates, missing dates, and company placement. ## Testing - `yarn jest app/components/UI/Rewards/utils/formatUtils.test.ts app/components/UI/Rewards/components/Benefits/BenefitCard.test.tsx app/components/UI/Rewards/Views/BenefitFullView.test.tsx --runInBand` - `yarn lint:tsc` - ESLint on all modified files - `git diff --check`
🔍 Smart E2E Test Selection
click to see 🤖 AI reasoning detailsE2E Test Selection:
No E2E smoke tests exist for the Rewards/Benefits feature - confirmed by searching the tests/smoke* directories. The changes do not affect any shared components (TabBar, navigation, modals, confirmations, browser), core wallet flows (accounts, swaps, staking, network management), or any other area covered by the available smoke tags. The critical file flag on types.ts is due to the path pattern, but the actual change is a trivial type widening with no architectural impact. Performance Test Selection: |
|



Description
Company name in Benefits cards was displayed on the same line as the title, overlapping and severely truncating the titles. This moves it to the bottom of the card alongside the time left. It also addresses other issues related to Benefits cards. Full list of changes:
validToas the preferred countdown date, falling back toactionDate.validToandactionDateto be nullable.Testing
yarn jest app/components/UI/Rewards/utils/formatUtils.test.ts app/components/UI/Rewards/components/Benefits/BenefitCard.test.tsx app/components/UI/Rewards/Views/BenefitFullView.test.tsx --runInBandyarn lint:tscgit diff --checkChangelog
CHANGELOG entry: Improved the readability of Benefits cards in Rewards
Related issues
Fixes: n/a
Manual testing steps
Note: it isn't possible to see company names right now because they had to be disabled at the API level.
Screenshots/Recordings
Before
n/a
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
Note
Low Risk
Rewards benefits UI and display-only date selection; changes are localized with new unit tests and no auth or payment impact.
Overview
Rewards benefit list cards no longer show the partner company name on the same row as the title (which was truncating titles). The name now sits in a footer row with the clock and time remaining, using a new
BENEFIT_CARD_FOOTERtest id and slightly smaller typography for description and footer text.Time left on cards and the benefit detail screen now comes from a shared
resolveBenefitEndDatehelper: it usesvalidTowhen present and parseable, otherwiseactionDate.SubscriptionBenefitDto.validTois typed asstring | nullto match nullable API data. Unit and component tests cover the date resolution and layout.Reviewed by Cursor Bugbot for commit 3ee721e. Bugbot is set up for automated code reviews on this repo. Configure here.