feat(rewards): benefits preview uses Tag for available count cp-7.78.0#30196
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. |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit e3de347. Configure here.
Assert no available_count i18n when the list is empty, numeric count at exactly 99 benefits, and a single preview card.
🔍 Smart E2E Test Selection
click to see 🤖 AI reasoning detailsE2E Test Selection:
No E2E tests exist for the Rewards feature (confirmed by searching e2e test files). These changes do not affect any shared components (navigation, modals, confirmations, browser), controllers, or critical user flows covered by the available E2E test tags. The risk is low and no E2E tags are warranted. Performance Test Selection: |
|




Description
The Rewards dashboard Benefits preview header previously used a numeric
BadgeCountbeside the section title. This change replaces it with a design-systemTag(TagSeverity.Neutral) that shows how many benefits are available using the localized stringrewards.benefits.available_count(e.g.%{count} availablein English). Counts above 99 display as99+.The header row is full width with
justifyContent: space-between: the title and chevron stay on the leading side; the tag sits on the trailing edge so it matches the intended layout. Spacing usesgap-1between the title and chevron. The empty-state header no longer renders a redundant null badge slot.Motivation: Align with design (muted pill copy and alignment) and keep copy in i18n for the translation pipeline (English source string only in
en.json).Automated tests:
yarn jest app/components/UI/Rewards/components/Benefits/BenefitsPreview.test.tsxChangelog
CHANGELOG entry: Updated the Rewards benefits preview header to show how many benefits are available using a tag label next to the section title; aligned campaigns preview section header spacing with the benefits preview (
gap-1).Related issues
Fixes:
Manual testing steps
Screenshots/Recordings
Before
Numeric badge style (
BadgeCount) adjacent to the Benefits title (previous implementation).After
Neutral
Tagwith “{count} available” (per locale), title + chevron on the left, tag aligned to the trailing edge. (Screenshot also attached in an earlier PR update.)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
Low risk UI/i18n change with unit test updates; primary risk is minor layout/regression in rewards preview headers and count formatting around the 99/99+ boundary.
Overview
The Benefits preview header now replaces the numeric
BadgeCountwith a neutral design-systemTagthat shows a localizedrewards.benefits.available_countlabel (capped to99+), and adjusts header layout to keep the title+chevron grouped left with the tag right-aligned.Campaigns preview header spacing is tightened (
gap-1), and tests were expanded to cover the new benefits count behavior (including empty state and 99/99+ cases) plus treatingundefinedcampaigns as an empty list. Adds the new English i18n keyrewards.benefits.available_count.Reviewed by Cursor Bugbot for commit 5ece706. Bugbot is set up for automated code reviews on this repo. Configure here.