Skip to content

fix: Polish Engagement toast for 8.6.0 release - #33772

Merged
amandaye0h merged 2 commits into
mainfrom
toast-8.6.0/polish-engagement
Jul 28, 2026
Merged

fix: Polish Engagement toast for 8.6.0 release#33772
amandaye0h merged 2 commits into
mainfrom
toast-8.6.0/polish-engagement

Conversation

@amandaye0h

@amandaye0h amandaye0h commented Jul 24, 2026

Copy link
Copy Markdown
Contributor

Description

Polishes Engagement toast call sites for the 8.6.0 release so they align with the shared toast pattern (Confirmation icon, success/error icon colors, and default toast chrome instead of custom background colors).

Updates notification copy-clipboard and push-notification onboarding toasts to use Confirmation + success/default icon colors and shared accessory spacing.

Changelog

CHANGELOG entry: Polished toast styling for consistency in the 8.6.0 release

Related issues

Fixes:

Related toast polish PRs for 8.6.0:

Manual testing steps

Feature: Notification toasts
  Scenario: copy from notification details
    Given the user copies a value from a notification detail
    When the toast appears
    Then it uses the Confirmation icon with the success color

Screenshots/Recordings

Before

Screen.Recording.2026-07-28.at.3.28.55.PM.mov

After

Screen.Recording.2026-07-28.at.3.19.07.PM.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

Align Engagement toast call sites with the shared 8.6.0 toast polish pattern.

Co-authored-by: Cursor <cursoragent@cursor.com>
@amandaye0h amandaye0h self-assigned this Jul 24, 2026
@github-actions

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.

@metamask-ci metamask-ci Bot added the team-design-system All issues relating to design system in Mobile label Jul 24, 2026
@metamask-ci

metamask-ci Bot commented Jul 24, 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.

@github-actions

github-actions Bot commented Jul 24, 2026

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/Nav/App/App.test.tsx 0/181 0/317 0/322
app/components/Views/Notifications/Details/hooks/useCopyClipboard.test.ts 0/181 0/317 0/322

AI-detected flaky patterns

app/components/Nav/App/App.test.tsx

  • J8 — jest.useFakeTimers() combined with waitFor() (polling conflict) (high)
    • Top-level describe calls jest.useFakeTimers(); this test (and similar ones for FoxLoader render and UIStartup trace) follows it with waitFor after advancing timers. Per the loaded skill (which explicitly cites App.test.tsx for this anti-pattern) and the PR's own new comment about waitFor hanging under frozen Date.now, the real-timer polling inside waitFor conflicts with fake timers and produces intermittent timeouts/hangs.
    • Suggested fix in app/components/Nav/App/App.test.tsx:
      -      renderAppWithSeedlessState(true);
      -      jest.advanceTimersByTime(0);
      -      await waitFor(() => {
      -        expect(mockCheckIsSeedlessPasswordOutdated).toHaveBeenCalledWith(
      -
      +      renderAppWithSeedlessState(true);
      +      await act(async () => {
      +        jest.advanceTimersByTime(0);
      +        jest.runAllTimersAsync();
      +      });
      +      expect(mockCheckIsSeedlessPasswordOutdated).toHaveBeenCalledWith(
      +
  • J10 — jest.spyOn() without restoreAllMocks()/mockRestore() afterward (medium)
    • Suite contains many jest.spyOn(StorageWrapper, 'getItem'/'setItem'), mockCheckIsSeedlessPasswordOutdated, mockTrace etc. beforeEach only does clearAllMocks(); afterEach lacks restoreAllMocks(). Spies leak between tests. PR added per-test mockRestore() to the two edited tests but not to the shared hook or the other three version-branch tests.
    • Suggested fix in app/components/Nav/App/App.test.tsx:
      -  afterEach(() => {
      -    cleanup();
      -    jest.runOnlyPendingTimers();
      -  });
      -
      +  afterEach(() => {
      +    cleanup();
      +    jest.runOnlyPendingTimers();
      +    jest.restoreAllMocks();
      +  });
      +

app/components/Views/Notifications/Details/hooks/useCopyClipboard.test.ts

  • J3 — Shared mock state (high)
    • The test configures multiple shared module-level mocks (mockDispatch, mockShowToast, ClipboardManager.setString) and only clears call counts in beforeEach. Without jest.resetAllMocks() in afterEach, any per-test mockImplementation or mockReturnValue changes would leak across tests (even though this file does not mutate them, the pattern matches J3 and is a common source of order-dependent flakiness). Historical data showed zero failures, so this is a proactive fix.
    • Suggested fix in app/components/Views/Notifications/Details/hooks/useCopyClipboard.test.ts:
      -  afterEach(() => {
      -    jest.useRealTimers();
      -  });
      +  afterEach(() => {
      +    jest.useRealTimers();
      +    jest.resetAllMocks();
      +  });

This check is informational only and does not block merging.

@amandaye0h
amandaye0h added this pull request to the merge queue Jul 28, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Jul 28, 2026
Flush startApp with act instead of waitFor so the assertion does not
stall under fake timers with the frozen Date.now from testSetup.

Co-authored-by: Cursor <cursoragent@cursor.com>
@github-actions

Copy link
Copy Markdown
Contributor

🔍 Smart E2E Test Selection

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

E2E Test Selection:
All four changed files contain minor visual/styling updates and unit test fixes:

  1. PushNotificationOnboarding/index.tsx: Removes marginRight: 12 from a toast style, changes icon color from IconColor.Alternative to IconColor.Default, and changes icon name from IconName.CheckBold to IconName.Confirmation. These are purely cosmetic UI tweaks to the notification onboarding toast appearance.

  2. useCopyClipboard.ts: Changes icon name from CheckBold to Confirmation and updates color references from accent03.dark/normal to success.default. Minor visual change to the copy-to-clipboard toast.

  3. App.test.tsx: Unit test fix - replaces waitFor with act(async () => {...}) to properly handle fake timers. This is a unit test improvement with no functional impact on the app.

  4. useCopyClipboard.test.ts: Unit test update to match the icon name change (CheckBoldConfirmation).

None of these changes affect core user flows, navigation, confirmations, account management, network operations, or any other functionality covered by E2E smoke tests. The changes are limited to notification toast icon/color appearance. No E2E smoke tests validate notification toast icon names or colors specifically. No performance-sensitive code paths are touched.

Performance Test Selection:
No performance-sensitive code paths are affected. Changes are limited to notification toast icon names, colors, and margins - purely visual/cosmetic changes with no impact on app launch, rendering performance, or any measured performance scenarios.

View GitHub Actions results

@sonarqubecloud

Copy link
Copy Markdown

@amandaye0h
amandaye0h added this pull request to the merge queue Jul 28, 2026
Merged via the queue into main with commit 08eb84a Jul 28, 2026
74 checks passed
@amandaye0h
amandaye0h deleted the toast-8.6.0/polish-engagement branch July 28, 2026 17:17
@github-actions github-actions Bot locked and limited conversation to collaborators Jul 28, 2026
@metamask-ci metamask-ci Bot added the release-8.6.0 Issue or pull request that will be included in release 8.6.0 label Jul 28, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

release-8.6.0 Issue or pull request that will be included in release 8.6.0 risk:low AI analysis: low risk size-S 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