Skip to content

Conversation

@smgv
Copy link
Contributor

@smgv smgv commented Nov 21, 2025

Description

Open in GitHub Codespaces

In this PR, we’ve removed the isTestEnvironment checks from all Rive animation–related files. During the e2e tests, the animation component still calls useRive, and since the WASM file isn’t set for the test environment, useRive falls back to fetching the WASM from external domains (unpkg.com and cdn.jsdelivr.net). This was causing unintended external calls during test execution. These changes address that issue.

Jira Link: https://consensyssoftware.atlassian.net/browse/SL-334

Changelog

CHANGELOG entry: removed the isTestEnvironment checks from all Rive animation–related files

Related issues

Fixes:

Manual testing steps

  1. Go to this page...

Screenshots/Recordings

Before

After

Pre-merge author checklist

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

Removes IN_TEST gating from Rive animations, initializes WASM normally, and updates tests to mock animations with snapshot adjustments.

  • Animations/Rive:
    • Remove isTestEnvironment checks to allow animations to render in all environments in wallet-ready-animation.tsx, fox-appear-animation.tsx, metamask-wordmark-animation.tsx, shield-icon-animation.tsx, shield-subscription-icon-animation.tsx, shield-illustration-animation.tsx, and creation-successful.js.
    • Update Rive WASM context useRiveWasmReady to always start with false and drop test-env shortcut; keep readiness when RuntimeLoader is undefined.
  • Onboarding/Unlock UI:
    • Always render animation components (remove test gating) in welcome.js and unlock-page.component.js.
  • Tests:
    • Mock animation components in integration/unit tests to avoid real Rive rendering (fox-appear-animation, metamask-wordmark-animation, wallet-ready-animation).
    • Update snapshots to reflect placeholder containers now rendered on welcome/unlock pages.
    • Minor imports added for React in affected tests.

Written by Cursor Bugbot for commit a3fe5d9. This will update automatically on new commits. Configure here.

@smgv smgv self-assigned this Nov 21, 2025
@smgv smgv requested review from a team as code owners November 21, 2025 10:42
@github-actions
Copy link
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.

@metamaskbot metamaskbot added the team-onboarding Onboarding team label Nov 21, 2025
@metamaskbot
Copy link
Collaborator

metamaskbot commented Nov 21, 2025

✨ Files requiring CODEOWNER review ✨

@MetaMask/confirmations (1 files, +0 -2)
  • 📁 ui/
    • 📁 pages/
      • 📁 confirmations/
        • 📁 components/
          • 📁 confirm/
            • 📁 footer/
              • 📁 shield-footer-coverage-indicator/
                • 📄 shield-icon-animation.tsx +0 -2

🔐 @MetaMask/web3auth (9 files, +10 -24)
  • 📁 ui/
    • 📁 components/
      • 📁 app/
        • 📁 shield-entry-modal/
          • 📄 shield-illustration-animation.tsx +0 -2
    • 📁 pages/
      • 📁 confirmations/
        • 📁 components/
          • 📁 confirm/
            • 📁 footer/
              • 📁 shield-footer-coverage-indicator/
                • 📄 shield-icon-animation.tsx +0 -2
      • 📁 onboarding-flow/
        • 📁 creation-successful/
          • 📄 creation-successful.js +1 -4
          • 📄 wallet-ready-animation.tsx +0 -2
        • 📁 welcome/
          • 📁 __snapshots__/
            • 📄 welcome.test.js.snap +4 -1
            • 📄 fox-appear-animation.tsx +1 -4
            • 📄 metamask-wordmark-animation.tsx +0 -2
            • 📄 welcome.js +4 -5
      • 📁 settings/
        • 📁 transaction-shield-tab/
          • 📄 shield-subscription-icon-animation.tsx +0 -2

@smgv smgv changed the title fix: removed isTestEnvironment check for rive animation fix: removed isTestEnvironment check for rive animation Nov 21, 2025
@metamaskbot
Copy link
Collaborator

Builds ready [a3fe5d9]
UI Startup Metrics (1220 ± 102 ms)
PlatformBuildTypePageMetricMean (ms)Min (ms)Max (ms)Std Dev (ms)P 75 (ms)P 95 (ms)
ChromeBrowserifyStandard HomeuiStartup12201025149710212681445
load103286812539110751210
domContentLoaded102686312489110701198
domInteractive2615105222188
firstPaint4817712313819541138
backgroundConnect2101952429213230
firstReactRender26197192644
getState301782103446
initialActions103112
loadScripts823663104389872995
setupStore1073841113
numNetworkReqs1257820573
BrowserifyPower User HomeuiStartup18751568290825820582335
load1004880169016010031472
domContentLoaded98987316781589791449
domInteractive39172184532181
firstPaint59511015004089521433
backgroundConnect22720028114231257
firstReactRender83481401592113
getState17712832749202295
initialActions103112
loadScripts78066914621587701252
setupStore1895182534
numNetworkReqs89641963096165
WebpackStandard HomeuiStartup800696106277830979
load62956683370638801
domContentLoaded62455882770633796
domInteractive2615106241999
firstPaint21273810149193625
backgroundConnect1056471219
firstReactRender27198693141
getState261360123352
initialActions104112
loadScripts62255681868631793
setupStore1053041120
numNetworkReqs1257720573
WebpackPower User HomeuiStartup14541218259724716141997
load68058714461426841035
domContentLoaded67058014391416661028
domInteractive41162364830204
firstPaint2631021140189260674
backgroundConnect1473361826
firstReactRender8352125119099
getState15712429234167253
initialActions102012
loadScripts66757814301396641017
setupStore21970132650
numNetworkReqs1366431054178246
FirefoxBrowserifyStandard HomeuiStartup12131046177212012661492
load102290012897810861168
domContentLoaded102189912897810831168
domInteractive57251873681136
firstPaint------
backgroundConnect3821163223978
firstReactRender22184452135
getState106849820
initialActions102112
loadScripts99888512207210461132
setupStore104527825
numNetworkReqs1156816654
BrowserifyPower User HomeuiStartup26871974369734428763416
load1162949162817412581518
domContentLoaded1161948162717412581517
domInteractive13533574122155469
firstPaint------
backgroundConnect191291027226225756
firstReactRender88451802095124
getState25784928255214883
initialActions2129427
loadScripts1128931159516812291484
setupStore1157834176113684
numNetworkReqs88522054084193
WebpackStandard HomeuiStartup14271253207512514621713
load1205108415899112521407
domContentLoaded1205108415899112511407
domInteractive56261773377123
firstPaint------
backgroundConnect41192082642102
firstReactRender27215963137
getState146163211343
initialActions103122
loadScripts1181106914108112341342
setupStore136173191141
numNetworkReqs1156616663
WebpackPower User HomeuiStartup28772090356930530273478
load13991071194120615751753
domContentLoaded13981071194120615751753
domInteractive12129508121136455
firstPaint------
backgroundConnect15425720163212580
firstReactRender87421682296125
getState28883901284265869
initialActions318227
loadScripts13641053192220515141733
setupStore110675617296668
numNetworkReqs89542204480208
📊 Page Load Benchmark Results

Current Commit: a3fe5d9 | Date: 11/21/2025

📄 Localhost MetaMask Test Dapp

Samples: 100

Summary

  • pageLoadTime-> current mean value: 1.04s (±39ms) 🟡 | historical mean value: 1.04s ⬇️ (historical data)
  • domContentLoaded-> current mean value: 723ms (±38ms) 🟢 | historical mean value: 727ms ⬇️ (historical data)
  • firstContentfulPaint-> current mean value: 77ms (±11ms) 🟢 | historical mean value: 79ms ⬇️ (historical data)

📈 Detailed Results

Metric Mean Std Dev Min Max P95 P99
pageLoadTime 1.04s 39ms 1.01s 1.32s 1.08s 1.32s
domContentLoaded 723ms 38ms 699ms 996ms 756ms 996ms
firstPaint 77ms 11ms 60ms 164ms 88ms 164ms
firstContentfulPaint 77ms 11ms 60ms 164ms 88ms 164ms
largestContentfulPaint 0ms 0ms 0ms 0ms 0ms 0ms
Bundle size diffs [🚨 Warning! Bundle size has increased!]
  • background: 53 Bytes (0%)
  • ui: -178 Bytes (0%)
  • common: 20 Bytes (0%)

Copy link
Member

@Gudahtt Gudahtt left a comment

Choose a reason for hiding this comment

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

LGTM!

// In test environments or when returning from another page, skip animations
const [isAnimationComplete, setIsAnimationComplete] = useState(
isTestEnvironment || shouldSkipAnimation,
shouldSkipAnimation || false,
Copy link
Member

Choose a reason for hiding this comment

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

Nit: Redundant extra condition:

Suggested change
shouldSkipAnimation || false,
shouldSkipAnimation,

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants