[pull] main from MetaMask:main#360
Merged
Merged
Conversation
…3283) <!-- Please submit this PR as a draft initially. Do not mark it as "Ready for review" until the template has been completely filled out, and PR status checks have passed at least once. --> ## **Description** - Update pending toast onPress callback to accept transactionMeta parameter - Add navigation to TRANSACTION_DETAILS route with transaction ID - Apply 100ms timeout to ensure smooth navigation transition - Enable users to view specific transaction details directly from deposit toast <!-- Write a short description of the changes included in this pull request, also include relevant motivation and context. Have in mind the following questions: 1. What is the reason for the change? 2. What is the improvement/solution? --> ## **Changelog** <!-- If this PR is not End-User-Facing and should not show up in the CHANGELOG, you can choose to either: 1. Write `CHANGELOG entry: null` 2. Label with `no-changelog` If this PR is End-User-Facing, please write a short User-Facing description in the past tense like: `CHANGELOG entry: Added a new tab for users to see their NFTs` `CHANGELOG entry: Fixed a bug that was causing some NFTs to flicker` (This helps the Release Engineer do their job more quickly and accurately) --> CHANGELOG entry: null ## **Related issues** Fixes: https://consensyssoftware.atlassian.net/browse/PRED-332 ## **Manual testing steps** ```gherkin Feature: my feature name Scenario: user [verb for user action] Given [describe expected initial app state] When user [verb for user action] Then [describe expected outcome] ``` ## **Screenshots/Recordings** <!-- If applicable, add screenshots and/or recordings to visualize the before and after of your change. --> ### **Before** <!-- [screenshots/recordings] --> ### **After** <!-- [screenshots/recordings] --> ## **Pre-merge author checklist** - [ ] I’ve followed [MetaMask Contributor Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask Mobile Coding Standards](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/CODING_GUIDELINES.md). - [ ] I've completed the PR template to the best of my ability - [ ] I’ve included tests if applicable - [ ] I’ve documented my code using [JSDoc](https://jsdoc.app/) format if applicable - [ ] I’ve applied the right labels on the PR (see [labeling guidelines](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/LABELING_GUIDELINES.md)). Not required for external contributors. ## **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. <!-- CURSOR_SUMMARY --> --- > [!NOTE] > Make pending deposit toast link navigate to Transactions, then (after 100ms) to the specific Transaction Details when an ID is available; update toast API to pass transaction metadata and add tests. > > - **Hooks** > - `usePredictToasts` > - Change `pendingToastConfig.onPress` signature to accept `transactionMeta`. > - `showPendingToast` now passes `transactionMeta` to `onPress` and supports link button when provided. > - `usePredictDepositToasts` > - Pending toast `onPress` now navigates to `Routes.TRANSACTIONS_VIEW`, then (100ms delay) to `Routes.TRANSACTION_DETAILS` with `transactionId` if present. > - **Tests** > - `usePredictDepositToasts.test.ts` > - Add navigation tests for pending toast link, including transaction ID handling and 100ms timeout. > - `usePredictToasts.test.ts` > - Verify `transactionMeta` is passed to `onPress`, presence/absence of link button options, and related behaviors. > > <sup>Written by [Cursor Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit 2f1f153. This will update automatically on new commits. Configure [here](https://cursor.com/dashboard?tab=bugbot).</sup> <!-- /CURSOR_SUMMARY -->
## **Description** This PR fixes three chart UX issues in the Perps trading view: 1. **Thin/minuscule candles when switching intervals** - When users switched between time intervals (1min, 3min, 5min, 15min, etc.), candles would appear very thin/small. This was caused by: - Using `setVisibleRange()` (time-based) instead of `setVisibleLogicalRange()` (index-based) which doesn't control bar width - Not re-applying zoom when interval changes (only applied on initial load) - Hardcoded candle count of 45 in multiple places instead of using the centralized config 2. **Chart not resetting to current date on interval change** - The chart would preserve scroll position from the previous interval instead of showing the most recent candles. 3. **Volume bars taking too much space on horizontal fullscreen chart (TAT-2116)** - When users rotated to landscape in fullscreen mode, the volume pane would sometimes expand beyond its intended 20% height. This was caused by: - Race condition during orientation change resize events - `setPaneHeights()` using stale height values from `window.chart.options().height` - Missing final pane height enforcement after resize events settle **Solutions implemented:** - Changed `applyZoom()` to use `setVisibleLogicalRange()` for consistent candle width control - Added interval change detection to re-apply zoom when switching intervals - Added `scrollToRealTime()` to reset chart position to latest data on interval change - Reduced default candle count from 45 to 30 for better visibility - Consolidated all hardcoded values to use `PERPS_CHART_CONFIG.CANDLE_COUNT.DEFAULT` - Updated `setPaneHeights()` to use actual container element height instead of potentially stale chart options - Added debounced final resize handler to enforce 80/20 pane split after resize events settle - Ensured pane heights are re-applied after volume data is set ## **Changelog** CHANGELOG entry: Fixed chart candles appearing thin when switching between time intervals; Fixed volume pane taking too much space on horizontal fullscreen chart ## **Related issues** Fixes: - https://consensyssoftware.atlassian.net/browse/TAT-2115 - https://consensyssoftware.atlassian.net/browse/TAT-2116 ## **Manual testing steps** ```gherkin Feature: Chart interval switching Scenario: User switches between chart intervals Given the user is on the Perps market details view with chart visible And the chart shows candles at a reasonable width When user taps on different interval options (1min, 3min, 5min, 15min, 1hr, etc.) Then candles should maintain consistent width across all intervals And chart should reset to show the most recent candles (current date) And no scroll offset from previous interval should be preserved Scenario: User pinch-zooms the chart Given the user is on the Perps market details view with chart visible When user pinch-zooms in or out on the chart Then candle width should change based on zoom level And this should be the only way to change candle width Scenario: User rotates device in fullscreen chart mode (TAT-2116) Given the user is on the Perps market details view with chart visible And the user taps the fullscreen button to enter fullscreen mode When user rotates device to landscape orientation Then volume pane should take approximately 20% of the chart height And candlestick pane should take approximately 80% of the chart height When user rotates device back to portrait orientation Then volume pane should still take approximately 20% of the chart height And candlestick pane should still take approximately 80% of the chart height ``` ## **Screenshots/Recordings** ### **Before** Candles appear thin/minuscule when switching to certain intervals (e.g., 15min) ### **After** Candles maintain consistent width across all interval changes, chart resets to show latest data https://github.com/user-attachments/assets/74244275-5009-4964-b942-7d5a93357a76 ## **Pre-merge author checklist** - [x] I've followed [MetaMask Contributor Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask Mobile Coding Standards](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/CODING_GUIDELINES.md). - [x] I've completed the PR template to the best of my ability - [x] I've included tests if applicable - [x] I've documented my code using [JSDoc](https://jsdoc.app/) format if applicable - [x] I've applied the right labels on the PR (see [labeling guidelines](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/LABELING_GUIDELINES.md)). Not required for external contributors. ## **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. <!-- CURSOR_SUMMARY --> --- > [!NOTE] > Standardizes chart zoom using logical ranges, re-zooms on interval change, sets default candles to 30 via config, and stabilizes volume pane sizing with improved resize handling. > > - **Chart behavior**: > - Use `setVisibleLogicalRange()` in `applyZoom()` and call `scrollToRealTime()` on forced resets for consistent candle width. > - Detect interval changes (pass `interval` with data) and re-apply zoom on initial load or interval switch. > - Reduce and centralize default visible candles to `PERPS_CHART_CONFIG.CANDLE_COUNT.DEFAULT` (30) across `PerpsMarketDetailsView`, `TradingViewChart.tsx`, and WebView templates; update reset logs/messages. > - **WebView/Template updates**: > - Pass `visibleCandleCount` and `interval` in `SET_CANDLESTICK_DATA`; auto-zoom on initial load or interval change. > - Simplify loading skeleton to show while WebView initializes. > - **Pane sizing and formatting**: > - Use container height in `setPaneHeights()` and add debounced final resize enforcement to maintain 80/20 candlestick/volume split; re-apply after volume data updates. > - Set current price line `axisLabelFormatter` to `formatPriceUniversal` for consistent decimals. > > <sup>Written by [Cursor Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit 1a576c1. This will update automatically on new commits. Configure [here](https://cursor.com/dashboard?tab=bugbot).</sup> <!-- /CURSOR_SUMMARY -->
<!-- Please submit this PR as a draft initially. Do not mark it as "Ready for review" until the template has been completely filled out, and PR status checks have passed at least once. --> This PR is the same as the extension version: [https://github.com/MetaMask/metamask-extension/pull/36227](https://github.com/MetaMask/metamask-extension/pull/36227) ## **Description** <!-- Write a short description of the changes included in this pull request, also include relevant motivation and context. Have in mind the following questions: 1. What is the reason for the change? 2. What is the improvement/solution? --> Integrates gas-fee sponsorship into the mobile for eligible networks and flows. When sponsorship is available, MetaMask covers the network fee so users can complete certain transactions without holding native token. The feature is service‑driven and gated via remote feature flags, with clear UI indicators and the correct transaction routing. **Reason for the change:** - Reduce friction for users who don’t have native token to pay network fees, enabling key flows (swaps) to complete “gasless” when sponsorship is offered on a network. **Improvement/solution:** A service‑backed, per‑network sponsorship system that: - Detects capability via a service backend and remote feature flags. - Relays sponsored transactions through backend. - Adjusts UI to clearly indicate sponsorship and prevent conflicting gas edits. - Is fully test‑covered for sponsored and non‑sponsored paths. **User impact:** When available, users can complete supported transactions without needing native token, with clear “Paid by MetaMask” messaging and no need to configure gas. ## **Changelog** <!-- If this PR is not End-User-Facing and should not show up in the CHANGELOG, you can choose to either: 1. Write `CHANGELOG entry: null` 2. Label with `no-changelog` If this PR is End-User-Facing, please write a short User-Facing description in the past tense like: `CHANGELOG entry: Added a new tab for users to see their NFTs` `CHANGELOG entry: Fixed a bug that was causing some NFTs to flicker` (This helps the Release Engineer do their job more quickly and accurately) --> CHANGELOG entry: Added a new label "no network fee" to gas fees sponsored networks. CHANGELOG entry: Added a new label "Paid by MetaMask" to swap quotes for gas fees sponsored networks. ## **Related issues** Fixes: ## **Manual testing steps** 1. Go to the network selection page 2. Look at networks that are known to be gas fees sponsored. There should be below their name a tag with "no network fee". 3. Go to the swap page with a network being gas fees sponsored. Request for a quote swap. There should be a "paid by MetaMask" label for the network fee. 4. Submit the swap. The swap should happen without native balance being used for gas fees. ## **Screenshots/Recordings** ### **After** Network list <img width="438" height="950" alt="netw" src="https://github.com/user-attachments/assets/e2009ccd-66b0-4ed7-92e6-118593a277ac" /> Swap Quote <img width="438" height="950" alt="swap" src="https://github.com/user-attachments/assets/eb278737-58e8-44f7-aa38-c9192072ddae" /> ## **Pre-merge author checklist** - [x] I’ve followed [MetaMask Contributor Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask Mobile Coding Standards](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/CODING_GUIDELINES.md). - [x] I've completed the PR template to the best of my ability - [x] I’ve included tests if applicable - [x] I’ve documented my code using [JSDoc](https://jsdoc.app/) format if applicable - [x] I’ve applied the right labels on the PR (see [labeling guidelines](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/LABELING_GUIDELINES.md)). Not required for external contributors. ## **Pre-merge reviewer checklist** - [x] I've manually tested the PR (e.g. pull and build branch, run the app, test code being changed). - [x] 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. <!-- CURSOR_SUMMARY --> --- > [!NOTE] > Adds gas-fee sponsorship support: shows "No network fee"/"Paid by MetaMask" in UI, treats sponsored quotes as gas-sufficient, and updates 7702 relay txs as intent-complete. > > - **Bridge**: > - Compute `isQuoteSponsored` and pass to `TokenInputArea`; show "Paid by MetaMask" with tooltip in `QuoteDetailsCard` when sponsored. > - `TokenInputArea`: show Max for native tokens when quote is sponsored. > - Hooks: `useHasSufficientGas`/`useInsufficientBalance` treat `quote.gasSponsored` as gas-sufficient/not insufficient. > - **Networks UI**: > - Show "No network fee" label for sponsored chains in `NetworkSelector`, `NetworkMultiSelectorList`, `CustomNetwork`, and bridge source network list (`NetworkRow`). > - `CellBase` title now accepts a React node. > - **Feature Flags**: > - New selector `getGasFeesSponsoredNetworkEnabled` to gate sponsorship per `chainId`. > - **i18n**: > - Add strings for "No network fee", "Paid by MetaMask", and sponsored fee tooltip. > - **Transactions**: > - Mark EIP-7702 relay transactions as `isIntentComplete` via `TransactionController:updateTransaction`. > - **Tests**: > - Extensive unit/snapshot/e2e updates covering sponsored labels and quote behavior. > - **Deps**: > - Bump `@metamask/delegation-deployments` to `^0.15.0`. > > <sup>Written by [Cursor Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit 9cf36e0. This will update automatically on new commits. Configure [here](https://cursor.com/dashboard?tab=bugbot).</sup> <!-- /CURSOR_SUMMARY --> --------- Co-authored-by: Florin Dzeladini <florin.dzeladini@consensys.net> Co-authored-by: Julien Fontanel <julien.fontanel@consensys.net>
<!-- Please submit this PR as a draft initially. Do not mark it as "Ready for review" until the template has been completely filled out, and PR status checks have passed at least once. --> ## **Description** <!-- Write a short description of the changes included in this pull request, also include relevant motivation and context. Have in mind the following questions: 1. What is the reason for the change? 2. What is the improvement/solution? --> Swap the Cronos logo for one that will work on dark theme. ## **Changelog** <!-- If this PR is not End-User-Facing and should not show up in the CHANGELOG, you can choose to either: 1. Write `CHANGELOG entry: null` 2. Label with `no-changelog` If this PR is End-User-Facing, please write a short User-Facing description in the past tense like: `CHANGELOG entry: Added a new tab for users to see their NFTs` `CHANGELOG entry: Fixed a bug that was causing some NFTs to flicker` (This helps the Release Engineer do their job more quickly and accurately) --> CHANGELOG entry: replace the Cronos logo for a white-background one ## **Related issues** Fixes: NA ## **Manual testing steps** Go to the MetaMask Mobile app 1/ Navigate to "chainList.org" search for CRONOS and click add new network. Chain Name : CRONOS Currency Symbol: CRO Chain ID: 25 2/ Confirm that the network logo is displayed correctly 3/ Confirm that the native Token logo is displayed correctly 4/ Repeat the test using different "dark theme" modes from your phone <!-- If applicable, add screenshots and/or recordings to visualize the before and after of your change. --> ### **Before** <img width="250" alt="image" src="https://github.com/user-attachments/assets/8ec17b35-ae9c-4101-80d6-247da43fb370" /> ### **After** <img width="250" alt="image" src="https://github.com/user-attachments/assets/e8505fa5-bf41-4aa5-ac68-519ffd108455" /> ## **Pre-merge author checklist** - [ ] I’ve followed [MetaMask Contributor Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask Mobile Coding Standards](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/CODING_GUIDELINES.md). - [ ] I've completed the PR template to the best of my ability - [ ] I’ve included tests if applicable - [ ] I’ve documented my code using [JSDoc](https://jsdoc.app/) format if applicable - [ ] I’ve applied the right labels on the PR (see [labeling guidelines](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/LABELING_GUIDELINES.md)). Not required for external contributors. ## **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. <!-- CURSOR_SUMMARY --> --- > [!NOTE] > No file changes detected in this PR diff. > > <sup>Written by [Cursor Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit 3e1e691. This will update automatically on new commits. Configure [here](https://cursor.com/dashboard?tab=bugbot).</sup> <!-- /CURSOR_SUMMARY -->
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
See Commits and Changes for more details.
Created by
pull[bot] (v2.0.0-alpha.4)
Can you help keep this open source service alive? 💖 Please sponsor : )