Skip to content

perf(token-details): defer heavy sections on TokenDetails - #40022

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

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

Conversation

@mganchas

@mganchas mganchas commented Nov 18, 2026 •

Copy link
Copy Markdown
Contributor

Description

What

Holds the transaction rows of the legacy TokenDetails screen out of the push transition. The gate is the existing useScreenTransitionComplete() hook, called with no arguments in TokenDetailsRouteWrapper above the early return. The V1 variant page is ungated. No new hook or wrapper is added.

Evidence

Earlier Reassure measurement (10 runs, local, not a CI gate) with a custom gate with the same release point: opening commit 83.99 ms → 24.63 ms. A TestFlight build using the plain hook was tested on a real device and the transition was fast. The screen's existing suites pass unchanged (88 suites, 1417 tests).

Changelog

CHANGELOG entry: null

Related issues

Refs: #38039

Manual testing steps

Feature: TokenDetails deferred render

  Background:
    Given a wallet with tokens that have transaction history

  Scenario: Token details opens with deferred activity rows
    When the user taps a token in the token list
    Then the token details header, chart and action buttons appear during the opening transition
    And the activity rows flush in after the transition settles

  Scenario: Activity content is unchanged after flush
    When the user taps a token in the token list
    And the opening transition completes
    Then the full transaction list renders exactly as before

Screenshots/Recordings

N/A — no visual change; performance-only gating verified on a real device via TestFlight and with the screen's existing Jest suite (88 suites, 1417 tests passing).

Before

N/A

After

N/A

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
    • Measurement is local-only (Reassure harness); no production trace instrumentation added

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.

@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-S 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
@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-token-details branch from e4bfaff to cddc3b9 Compare November 18, 2026 16:24
@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-token-details branch from cddc3b9 to 14734bf Compare November 18, 2026 16:33
@mganchas
mganchas marked this pull request as ready for review November 18, 2026 16:39
@mganchas
mganchas requested a review from a team as a code owner November 18, 2026 16:39

@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 14734bf. Configure here.

@mganchas
mganchas force-pushed the perf/deferred-render-token-details branch from 14734bf to fa2b43c Compare November 18, 2026 17:13
Hold the activity rows out of the opening transition with the existing
useScreenTransitionComplete hook. The V1 variant stays ungated.
@mganchas
mganchas force-pushed the perf/deferred-render-token-details branch from fa2b43c to d28719c Compare November 18, 2026 18:57
@mganchas
mganchas requested review from a team as code owners November 18, 2026 18:57
@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:58
@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 applied the right labels on the PR (see labeling guidelines). Not required for external contributors."). 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.

@sonarqubecloud

Copy link
Copy Markdown

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