Skip to content

perf(money): defer heavy sections on MoneyHomeView - #40028

Open
mganchas wants to merge 1 commit into
mainfrom
perf/deferred-render-money
Open

mganchas wants to merge 1 commit into
mainfrom
perf/deferred-render-money

Conversation

@mganchas

@mganchas mganchas commented Nov 18, 2026 •

Copy link
Copy Markdown
Contributor

Description

What

Holds the three sections that dominate MoneyHomeView's opening commit (earnings, activity, potential earnings) out of the push transition, so the transition renders before they mount.

The gate is the existing useScreenTransitionComplete() hook (app/components/hooks/useScreenTransitionComplete.ts), called with no arguments. No new hook or wrapper is added. Header, balance summary and action row stay eager.

Evidence

Earlier measurement with the local Reassure harness (10 runs, not a CI gate), using a custom gate with the same release point: opening commit 23.10 ms eager → 8.78 ms held. A TestFlight build using the plain hook was checked on a real device for Perps, TokenDetails and Top traders. Money was not part of that check yet.

Test layer placement

MoneyHomeView.test.tsx mocks useScreenTransitionComplete (default true) and adds one test for the held-back state. Component-view tests are unchanged.

Changelog

CHANGELOG entry: null

Related issues

Refs: #38039

Manual testing steps

Feature: Money home opening transition

  Background:
    Given a funded Money account with activity and deposit tokens

  Scenario: Money home opens with deferred heavy sections
    When the user opens the Money home screen
    Then the header, balance summary, action row, banners and MetaMask Card section render immediately
    And the earnings, activity and potential-earnings sections render right after the opening transition completes

Screenshots/Recordings

Before

N/A — no visual change; only mount timing of the heavy sections changes.

After

N/A — no visual change; only mount timing of the heavy sections changes.

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.

Testing done: yarn jest app/components/UI/Money/Views/MoneyHomeView/MoneyHomeView.test.tsx — 208/208 pass; yarn test:view:one app/components/UI/Money/Views/MoneyHomeView/MoneyHomeView.view.test.tsx — 4/4 pass.

@mganchas
mganchas requested a review from a team as a code owner November 18, 2026 12:07
@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.

@github-actions github-actions Bot added size-M pr-not-ready-for-e2e Skip E2E and block merging. Remove this label once the PR is ready to run the E2E tests. labels Nov 18, 2026
@metamask-ci metamask-ci Bot added the team-mobile-platform Mobile Platform team label Nov 18, 2026

@cursor cursor Bot left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Stale Bugbot comment from a previous run.

@mganchas
mganchas force-pushed the feat/deferred-render-primitive branch from 6cb9a08 to 2e51f5a Compare November 18, 2026 16:16
@mganchas
mganchas force-pushed the perf/deferred-render-money branch from 402d05e to 02f1ad6 Compare November 18, 2026 16:26

@cursor cursor Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.

Fix All in Cursor

❌ 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 02f1ad6. Configure here.

@mganchas
mganchas force-pushed the feat/deferred-render-primitive branch from 2e51f5a to 8af1716 Compare November 18, 2026 16:33
@mganchas
mganchas force-pushed the perf/deferred-render-money branch 2 times, most recently from 112a927 to 84f63eb Compare November 18, 2026 17:12
@sonarqubecloud

Copy link
Copy Markdown

Hold the earnings, activity and potential-earnings sections out of the
opening transition with the existing useScreenTransitionComplete hook.
@mganchas
mganchas force-pushed the perf/deferred-render-money branch from 84f63eb to 8faf23d Compare November 18, 2026 18:57
@mganchas
mganchas requested review from a team as code owners November 18, 2026 18:57
@github-actions github-actions Bot added size-XL and removed size-M labels Nov 18, 2026
@mganchas
mganchas force-pushed the feat/deferred-render-primitive branch from d7a6a1f to 00fe69f Compare November 18, 2026 18:57
@mganchas
mganchas changed the base branch from feat/deferred-render-primitive to main November 18, 2026 18:57
@github-actions github-actions Bot removed the size-XL label Nov 18, 2026
@metamask-ci

metamask-ci Bot commented Nov 18, 2026

Copy link
Copy Markdown
Contributor

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

Warnings — informational, address before merging:

  • Pre-merge author checklist has unchecked items (e.g. "I've tested on Android"). Every box must be consciously checked — see docs/readme/ready-for-review.md.

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

@socket-security

Copy link
Copy Markdown

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Addednpm/​@​metamask/​money-account-lifecycle-controller@​1.1.0771007594100
Updatednpm/​@​metamask/​ramps-controller@​30.0.0 ⏵ 30.1.086 -1310080 +1100 +1100

View full report

@socket-security

Copy link
Copy Markdown

Warning

MetaMask internal reviewing guidelines:

  • Do not ignore-all
  • Each alert has instructions on how to review if you don't know what it means. If lost, ask your Security Liaison or the supply-chain group
  • Copy-paste ignore lines for specific packages or a group of one kind with a note on what research you did to deem it safe.
    @SocketSecurity ignore npm/PACKAGE@VERSION
Priority Alert  (click "▶" to expand/collapse) Action
Low priority
Network access: npm @metamask/ramps-controller in module globalThis["fetch"]

Module: globalThis["fetch"]

Location: Package overview

From: package.json → npm/@metamask/ramps-controller@30.1.0

ℹ Read more on: This package | This alert | What is network access?

Next steps: Take a moment to review the security alert above. Review the linked package source code to understand the potential risk. Ensure the package is not malicious before proceeding. If you're unsure how to proceed, reach out to your security team or ask the Socket team for help at support@socket.dev.

Suggestion: Packages should remove all network access that is functionally unnecessary. Consumers should audit network access to ensure legitimate use.

Mark the package as acceptable risk. To ignore this alert only in this pull request, reply with the comment @SocketSecurity ignore npm/@metamask/ramps-controller@30.1.0. You can also ignore all packages with @SocketSecurity ignore-all. To ignore an alert for all future pull requests, use Socket's Dashboard to change the triage state of this alert.

Warn

View full report

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

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 team-mobile-platform Mobile Platform team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant