Skip to content

Conversation

@OGPoyraz
Copy link
Member

@OGPoyraz OGPoyraz commented Nov 26, 2025

Description

This PR updates dapp swap comparison banner copy if rewards does not exists.

Note: No changelog needed as this feature not released yet.

Open in GitHub Codespaces

Changelog

CHANGELOG entry: null

Related issues

Fixes: https://github.com/MetaMask/MetaMask-planning/issues/6349

Manual testing steps

  1. Trigger dapp swap comparison banner
  2. See no "and earn" copy if points doesn't exist
  3. See "and earn" copy if points exists

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

Shows "Save with MetaMask Swaps" when rewards are absent, adding i18n keys and updating tests accordingly.

  • UI (Confirmations):
    • Update dapp-swap-comparison-banner.tsx to render t('dappSwapAdvantage') only when rewards exist; otherwise use t('dappSwapAdvantageSaveOnly').
  • i18n:
    • Add dappSwapAdvantageSaveOnly locale string in app/_locales/en/messages.json and app/_locales/en_GB/messages.json.
  • Tests:
    • Adjust expectations in dapp-swap-comparison-banner.test.tsx to check for "Save with MetaMask Swaps" without rewards and "Save and earn with MetaMask Swaps" when rewards are provided.

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

@OGPoyraz OGPoyraz added the no-changelog no-changelog Indicates no external facing user changes, therefore no changelog documentation needed label Nov 26, 2025
@OGPoyraz OGPoyraz requested a review from a team as a code owner November 26, 2025 14:01
@OGPoyraz OGPoyraz added the team-confirmations Push issues to confirmations team label Nov 26, 2025
@metamaskbot
Copy link
Collaborator

✨ Files requiring CODEOWNER review ✨

@MetaMask/confirmations (2 files, +3 -2)
  • 📁 ui/
    • 📁 pages/
      • 📁 confirmations/
        • 📁 components/
          • 📁 confirm/
            • 📁 dapp-swap-comparison-banner/
              • 📄 dapp-swap-comparison-banner.test.tsx +2 -1
              • 📄 dapp-swap-comparison-banner.tsx +1 -1

});
const { getByText } = render();
expect(getByText(/Earn 100 points/u)).toBeInTheDocument();
expect(getByText('Save and earn with MetaMask Swaps')).toBeInTheDocument();
Copy link

Choose a reason for hiding this comment

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

Bug: Test missing mock setup prevents component from rendering

The new test 'renders rewards text when it is provided' mocks useDappSwapComparisonRewardText to return rewards data, but doesn't mock useDappSwapComparisonInfo with a selectedQuoteValueDifference value. The default mock only provides selectedQuote, so selectedQuoteValueDifference is undefined. The component's render condition requires selectedQuoteValueDifference >= 0.01, which fails for undefined, causing the component to not render. The test assertions checking for "Save and earn with MetaMask Swaps" will fail.

Fix in Cursor Fix in Web

@metamaskbot
Copy link
Collaborator

Builds ready [31dea0b]
UI Startup Metrics (1234 ± 135 ms)
PlatformBuildTypePageMetricMean (ms)Min (ms)Max (ms)Std Dev (ms)P 75 (ms)P 95 (ms)
ChromeBrowserifyStandard HomeuiStartup1234976190813512971428
load982802144510110231164
domContentLoaded97579914379910171157
domInteractive2414113211983
firstPaint66510113093839891141
backgroundConnect1901712209195208
firstReactRender362176104157
getState59161582972120
initialActions1016213
loadScripts792622124897823970
setupStore1343761528
numNetworkReqs41281533530149
BrowserifyPower User HomeuiStartup21531872274722022602632
load1046924150512110531325
domContentLoaded1031912147212210371317
domInteractive37182983731120
firstPaint61592148141210161303
backgroundConnect25520973593236498
firstReactRender944516126115144
getState19310370060203260
initialActions103112
loadScripts81870212751218241109
setupStore211064102347
numNetworkReqs102642835098244
WebpackStandard HomeuiStartup8196971179978351072
load60354488579635789
domContentLoaded59954087979632783
domInteractive2515107201982
firstPaint24076891174247599
backgroundConnect952841116
firstReactRender3720310323685
getState51161152467101
initialActions104112
loadScripts59653587777630774
setupStore15745101639
numNetworkReqs42281493431146
WebpackPower User HomeuiStartup20001431295131021982642
load7196251385110730946
domContentLoaded7086151366110713935
domInteractive40211603039130
firstPaint3661301381250630928
backgroundConnect108972020057610
firstReactRender1015017127122151
getState21316484688211263
initialActions115122
loadScripts7056131357108711931
setupStore251071162460
numNetworkReqs1477341273194316
FirefoxBrowserifyStandard HomeuiStartup14531172218119915601851
load1101908153412711761354
domContentLoaded1100903153412811751353
domInteractive66322574884190
firstPaint------
backgroundConnect70292764881204
firstReactRender281968103157
getState2611145192455
initialActions204123
loadScripts1068892150711511301306
setupStore279251292391
numNetworkReqs39281252634119
BrowserifyPower User HomeuiStartup27242073473555228504302
load1184961258328911581614
domContentLoaded1183961258329011581614
domInteractive12334552112113430
firstPaint------
backgroundConnect135261097163136357
firstReactRender934233440104141
getState26862905181306665
initialActions207123
loadScripts1136944240024211151508
setupStore19411814225247710
numNetworkReqs102623226479248
WebpackStandard HomeuiStartup17301405314225518262184
load13401136279518614001548
domContentLoaded13391136279518614001548
domInteractive8027144114190138
firstPaint------
backgroundConnect78284275785190
firstReactRender342298113652
getState267203252656
initialActions207123
loadScripts13061100277418013631491
setupStore28121562923122
numNetworkReqs41291322739124
WebpackPower User HomeuiStartup33132358528568535584751
load16121265318238417792720
domContentLoaded16111265318238417792720
domInteractive129331049144112477
firstPaint------
backgroundConnect174351144172184447
firstReactRender984231638106153
getState310621264258373848
initialActions218137
loadScripts15471236257730517302418
setupStore15591047176210576
numNetworkReqs99642905879244
📊 Page Load Benchmark Results

Current Commit: 31dea0b | Date: 11/26/2025

📄 Localhost MetaMask Test Dapp

Samples: 100

Summary

  • pageLoadTime-> current mean value: 1.05s (±40ms) 🟡 | historical mean value: 1.03s ⬆️ (historical data)
  • domContentLoaded-> current mean value: 729ms (±38ms) 🟢 | historical mean value: 719ms ⬆️ (historical data)
  • firstContentfulPaint-> current mean value: 78ms (±10ms) 🟢 | historical mean value: 78ms ⬇️ (historical data)

📈 Detailed Results

Metric Mean Std Dev Min Max P95 P99
pageLoadTime 1.05s 40ms 1.02s 1.34s 1.09s 1.34s
domContentLoaded 729ms 38ms 707ms 1.00s 764ms 1.00s
firstPaint 78ms 10ms 60ms 160ms 88ms 160ms
firstContentfulPaint 78ms 10ms 60ms 160ms 88ms 160ms
largestContentfulPaint 0ms 0ms 0ms 0ms 0ms 0ms
Bundle size diffs [🚨 Warning! Bundle size has increased!]
  • background: 58 Bytes (0%)
  • ui: 30 Bytes (0%)
  • common: 83 Bytes (0%)

@OGPoyraz OGPoyraz enabled auto-merge November 26, 2025 14:44
@OGPoyraz OGPoyraz added this pull request to the merge queue Nov 27, 2025
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Nov 27, 2025
@OGPoyraz OGPoyraz added this pull request to the merge queue Nov 27, 2025
Merged via the queue into main with commit 771ae71 Nov 27, 2025
188 of 190 checks passed
@OGPoyraz OGPoyraz deleted the ogp/6349 branch November 27, 2025 17:43
@github-actions github-actions bot locked and limited conversation to collaborators Nov 27, 2025
@metamaskbot metamaskbot added the release-13.12.0 Issue or pull request that will be included in release 13.12.0 label Nov 27, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

no-changelog no-changelog Indicates no external facing user changes, therefore no changelog documentation needed release-13.12.0 Issue or pull request that will be included in release 13.12.0 size-S team-confirmations Push issues to confirmations team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants