Skip to content

fix(rewards): localize campaign date#29808

Merged
sophieqgu merged 1 commit into
mainfrom
localize-campaign-date
May 6, 2026
Merged

fix(rewards): localize campaign date#29808
sophieqgu merged 1 commit into
mainfrom
localize-campaign-date

Conversation

@sophieqgu
Copy link
Copy Markdown
Contributor

@sophieqgu sophieqgu commented May 6, 2026

Description

Changelog

CHANGELOG entry: null

Related issues

Fixes:

Manual testing steps

Feature: my feature name

  Scenario: user [verb for user action]
    Given [describe expected initial app state]

    When user [verb for user action]
    Then [describe expected outcome]

Screenshots/Recordings

Before

After

Simulator Screenshot - E2E Test  - 2026-05-06 at 11 48 33

Pre-merge author checklist

Performance checks (if applicable)

  • I've tested on Android
    • Ideally on a mid-range device; emulator is acceptable
  • I've tested with a power user scenario
    • Use these power-user SRPs to import wallets with many accounts and tokens
  • I've instrumented key operations with Sentry traces for production performance metrics

For performance guidelines and tooling, see the Performance Guide.

Pre-merge reviewer checklist

  • I've manually tested the PR (e.g. pull and build branch, run the app, test code being changed).
  • I confirm that this PR addresses all acceptance criteria described in the ticket it closes and includes the necessary testing evidence such as recordings and or screenshots.

Note

Low Risk
Low risk: swaps a hardcoded month-name formatter for cached Intl.DateTimeFormat using the app locale, plus a small Jest mock adjustment; behavior changes are limited to date label rendering.

Overview
Campaign tile date labels are now localized by formatting month/day via getIntlDateTimeFormatter using I18n.locale, replacing the prior hardcoded English month list.

Tests were updated to mock the i18n module’s default export (locale) so the new locale-aware formatter can run under Jest.

Reviewed by Cursor Bugbot for commit 38c82e4. Bugbot is set up for automated code reviews on this repo. Configure here.

@sophieqgu sophieqgu requested a review from a team as a code owner May 6, 2026 15:49
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 6, 2026

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.

@sophieqgu sophieqgu enabled auto-merge May 6, 2026 15:50
@metamaskbotv2 metamaskbotv2 Bot added the team-rewards Rewards team label May 6, 2026
@github-actions github-actions Bot added pr-not-ready-for-e2e Skip E2E and block merging. Remove this label once the PR is ready to run the E2E tests. size-S labels May 6, 2026
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 6, 2026

🔍 Smart E2E Test Selection

  • Selected E2E tags: None (no tests recommended)
  • Selected Performance tags: None (no tests recommended)
  • Risk Level: low
  • AI Confidence: 95%
click to see 🤖 AI reasoning details

E2E Test Selection:
The changes are limited to two files in the Rewards/Campaigns UI utility layer:

  1. CampaignTile.utils.ts: Replaces a hardcoded English MONTHS array with getIntlDateTimeFormatter (Intl.DateTimeFormat API) for locale-aware date formatting. This is a pure localization improvement with no behavioral change for English users and no impact on any shared infrastructure, navigation, controllers, or Engine.

  2. CampaignTile.utils.test.ts: Updates the i18n mock to properly handle the new default export (I18n.locale) alongside the named strings export.

No E2E tests exist for the Rewards/Campaigns area. The change is a self-contained utility refactor covered by unit tests. It does not affect any critical paths (confirmations, swaps, accounts, network, browser, snaps, etc.), shared components (TabBar, modals, navigation), or any controller/Engine code. The risk is low and no E2E tags are warranted.

Performance Test Selection:
The change is a date formatting utility refactor (replacing a static array with Intl.DateTimeFormat). This has no impact on rendering performance, data loading, state management, or any performance-sensitive code paths. No performance tests are needed.

View GitHub Actions results

@sonarqubecloud
Copy link
Copy Markdown

sonarqubecloud Bot commented May 6, 2026

@sophieqgu sophieqgu added this pull request to the merge queue May 6, 2026
Merged via the queue into main with commit 9c50f9b May 6, 2026
78 checks passed
@sophieqgu sophieqgu deleted the localize-campaign-date branch May 6, 2026 16:28
@github-actions github-actions Bot locked and limited conversation to collaborators May 6, 2026
@metamaskbotv2 metamaskbotv2 Bot added the release-7.77.0 Issue or pull request that will be included in release 7.77.0 label May 6, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

pr-not-ready-for-e2e Skip E2E and block merging. Remove this label once the PR is ready to run the E2E tests. release-7.77.0 Issue or pull request that will be included in release 7.77.0 size-S team-rewards Rewards team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants