Skip to content

fix: Polish earn, quick-buy, rewards and gas toast for new animation#32947

Open
amandaye0h wants to merge 5 commits into
mainfrom
toast/polish-features
Open

fix: Polish earn, quick-buy, rewards and gas toast for new animation#32947
amandaye0h wants to merge 5 commits into
mainfrom
toast/polish-features

Conversation

@amandaye0h

@amandaye0h amandaye0h commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

Description

Polishes Earn, Quick Buy, Rewards, and Gas toast styling to align with the updated legacy Toast animation and design-system tokens.

  • Quick Buy: updates icon spacing and spinner color in quickBuyToastOptions
  • Earn: updates icon spacing, text style, and spinner color in useEarnToasts
  • Rewards: updates icon spacing and related test in useRewardsToast
  • Gas: updates text and close button icon in gas-fee-token-toast

Changelog

CHANGELOG entry: null

Related issues

Refs:

Related PRs

PR Description
#32933 Update DS legacy toast with iOS animation and UI polish (toast/animate-ds-legacy) — must merge first

Manual testing steps

Feature: Feature toast polish

  Scenario: User sees a Quick Buy toast
    Given the user initiates a Quick Buy transaction
    When the transaction triggers a toast
    Then the toast uses updated icon spacing and spinner color

  Scenario: User sees an Earn toast
    Given the user is on an Earn flow
    When an Earn action triggers a toast
    Then the toast uses updated icon spacing, text style, and spinner color

  Scenario: User sees a Rewards toast
    Given the user is on a Rewards flow
    When a rewards action triggers a toast
    Then the toast uses updated icon spacing consistent with the new Toast animation

  Scenario: User sees a Gas fee token toast
    Given the user is confirming a transaction with gas fee token options
    When the gas fee token toast appears
    Then the toast text and close button icon match the updated Toast design

Screenshots/Recordings

Before

After

Earn

Before
before-earn.mov
After
earn-after.mov

QuickBuy

Before
before-quickbuy.mov
After
quickbuy-after.mov

Rewards

Before
before-rewards.mov
After
rewards-after.mov

Gas

Before
gas-before.mov
After
gas-after.mov

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.

Made with Cursor

amandaye0h and others added 4 commits July 8, 2026 19:22
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
@amandaye0h amandaye0h self-assigned this Jul 8, 2026
@metamask-ci metamask-ci Bot added the team-design-system All issues relating to design system in Mobile label Jul 8, 2026
@github-actions

github-actions Bot commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

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.

@github-actions github-actions Bot added the size-M label Jul 8, 2026
@metamask-ci

metamask-ci Bot commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

PR template — items to address before "Ready for review"

Warnings — informational, address before merging:

  • Related issues section is empty. Add Fixes: #123 / Closes: <URL> / Refs: <Jira key>, or write a short rationale after the colon.

See docs/readme/ready-for-review.md for the full Definition of Ready for Review.

@amandaye0h amandaye0h changed the title fix: polish earn, quick-buy, rewards and gas toast for new animation fix: Polish earn, quick-buy, rewards and gas toast for new animation Jul 10, 2026
@github-actions

Copy link
Copy Markdown
Contributor

🔍 Smart E2E Test Selection

  • Selected E2E tags: SmokeConfirmations, SmokeStake, SmokePerps, SmokeWalletPlatform
  • Selected Performance tags: None (no tests recommended)
  • Risk Level: low
  • AI Confidence: 82%
click to see 🤖 AI reasoning details

E2E Test Selection:
The PR contains UI-level toast notification refactoring across several areas:

  1. gas-fee-token-toast.tsx (Confirmations): Changes the close button from ButtonVariants.Primary to ButtonIconVariant.Icon and consolidates label options. This is a functional UI change in the gas fee token toast shown during EIP-7702 confirmations. SmokeConfirmations is warranted to verify the toast still renders and dismisses correctly.

  2. useEarnToasts.tsx (Earn/Staking): Removes View wrappers around icons, changes primaryIsBold default to true. Affects toast notifications shown during staking operations. SmokeStake is warranted.

  3. quickBuyToastOptions.tsx (SocialLeaderboard/Perps QuickBuy): Removes Box wrapper, changes spinner color from PrimaryDefault to IconDefault. Affects the Perps quick buy flow toast. SmokePerps is warranted, and per tag description, SmokeWalletPlatform (Trending section) should also be selected.

  4. useRewardsToast.tsx (Rewards): Removes Box wrappers around icons. Minor UI change to rewards toast notifications. No dedicated smoke tag for Rewards specifically, but it's related to the wallet platform.

  5. Test files updated to match the implementation changes - no additional tag selection needed.

All changes are cosmetic/minor UI refactoring (removing wrapper components, adjusting styling), but the gas fee token close button variant change and the earn toast bold text default change are functional enough to warrant targeted smoke testing. Per tag descriptions: SmokePerps requires SmokeWalletPlatform and SmokeConfirmations; SmokeStake requires SmokeConfirmations.

Performance Test Selection:
All changes are UI-level toast notification refactoring (removing wrapper components, adjusting styling, consolidating labels). These changes do not affect app launch, login, onboarding, asset loading, swap execution, or other performance-sensitive flows. No performance tests are warranted.

View GitHub Actions results

@github-actions

Copy link
Copy Markdown
Contributor

🧪 Flaky unit test detection

Run history flaky detection

View recent run history

Historical failure rate is a hint, not proof — review each suggestion in context. See the flaky-test-detection skill for the full pattern reference and manual audit workflow.

Failures / runs sampled per window:

File 7d 15d 30d
app/components/UI/Rewards/hooks/useRewardsToast.test.tsx 0/50 0/178 0/375

AI-detected flaky patterns

app/components/UI/Rewards/hooks/useRewardsToast.test.tsx

  • J6 — Arbitrary setTimeout/sleep in test body (high)
    • Concrete J6 match: zero-delay setTimeout used as synchronization barrier after showToast call (and similar in 3 other tests in this file). This relies on real timers and can flake under CI load variations even with act(). No other J1-J10 patterns matched with exact code snippets (e.g. beforeEach uses clearAllMocks so not J3; no waitFor so not J4/J8; no module let mutations so not J9; no spyOn so not J10; mocks use initialRootState equivalent so not J5). History.json showed 0 failures so historicalHintUsed=false. Fix replaces barrier with waitFor containing assertions (per J6 and J4 guidance). Also update import to include waitFor from '@testing-library/react-native'.
    • Suggested fix in app/components/UI/Rewards/hooks/useRewardsToast.test.tsx:
      -      await act(async () => {
      -        result.current.showToast(testConfig);
      -        await new Promise((resolve) => setTimeout(resolve, 0));
      -      });
      -
      -      expect(mockShowToast).toHaveBeenCalledWith({
      -        variant: ToastVariants.Icon,
      -        iconName: IconName.Confirmation,
      -        labelOptions: [{ label: 'Test', isBold: true }],
      -        hasNoTimeout: false,
      -      });
      -      expect(playNotification).toHaveBeenCalledWith(NotificationMoment.Success);
      +      await act(async () => {
      +        result.current.showToast(testConfig);
      +      });
      +
      +      await waitFor(() => {
      +        expect(mockShowToast).toHaveBeenCalledWith({
      +          variant: ToastVariants.Icon,
      +          iconName: IconName.Confirmation,
      +          labelOptions: [{ label: 'Test', isBold: true }],
      +          hasNoTimeout: false,
      +        });
      +        expect(playNotification).toHaveBeenCalledWith(NotificationMoment.Success);
      +      });

This check is informational only and does not block merging.

@sonarqubecloud

Copy link
Copy Markdown

@amandaye0h amandaye0h marked this pull request as ready for review July 14, 2026 09:31
@amandaye0h amandaye0h requested review from a team as code owners July 14, 2026 09:31
@github-actions github-actions Bot added the risk:low AI analysis: low risk label Jul 14, 2026
@matthewwalsh0 matthewwalsh0 requested a review from jpuri July 14, 2026 09:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

risk:low AI analysis: low risk size-M team-design-system All issues relating to design system in Mobile

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants