Skip to content

feat: advanced charts candle with legacy line - #47737

Draft
sahar-fehri wants to merge 6 commits into
mainfrom
feat/advanced-charts-candle-with-legacy-line
Draft

sahar-fehri wants to merge 6 commits into
mainfrom
feat/advanced-charts-candle-with-legacy-line

Conversation

@sahar-fehri

Copy link
Copy Markdown
Contributor

Description

Changelog

CHANGELOG entry:

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.

@github-actions

github-actions Bot commented Nov 9, 2026

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.

@metamask-ci

metamask-ci Bot commented Nov 9, 2026 •

Copy link
Copy Markdown
Contributor

✨ Files requiring CODEOWNER review ✨

🫰 @MetaMask/core-platform (1 files, +2 -0)
  • 📁 app/
    • 📁 scripts/
      • 📄 metamask-controller.js +2 -0

👨‍🔧 @MetaMask/extension-platform (2 files, +5 -0)
  • 📁 app/
    • 📁 scripts/
      • 📄 metamask-controller.js +2 -0
  • 📁 test/
    • 📁 e2e/
      • 📁 fixtures/
        • 📄 onboarding-fixture.json +3 -0

🕵️ @MetaMask/extension-privacy-reviewers (1 files, +3 -0)
  • 📁 test/
    • 📁 e2e/
      • 📁 tests/
        • 📁 settings/
          • 📄 state-logs.json +3 -0

📜 @MetaMask/policy-reviewers (8 files, +16 -0)
  • 📁 lavamoat/
    • 📁 webpack/
      • 📁 mv2/
        • 📁 beta/
          • 📄 policy.json +2 -0
        • 📁 experimental/
          • 📄 policy.json +2 -0
        • 📁 flask/
          • 📄 policy.json +2 -0
        • 📁 main/
          • 📄 policy.json +2 -0
      • 📁 mv3/
        • 📁 beta/
          • 📄 policy.json +2 -0
        • 📁 experimental/
          • 📄 policy.json +2 -0
        • 📁 flask/
          • 📄 policy.json +2 -0
        • 📁 main/
          • 📄 policy.json +2 -0

Tip

Follow the policy review process outlined in the LavaMoat Policy Review Process doc before expecting an approval from Policy Reviewers.


🧪 @MetaMask/qa (2 files, +6 -0)
  • 📁 test/
    • 📁 e2e/
      • 📁 fixtures/
        • 📄 onboarding-fixture.json +3 -0
      • 📁 tests/
        • 📁 settings/
          • 📄 state-logs.json +3 -0

@metamask-ci

metamask-ci Bot commented Nov 9, 2026

Copy link
Copy Markdown
Contributor
Builds ready [8746156]
⚡ Performance Benchmarks (Total: 🟢 11 pass · 🟡 0 warn · 🔴 0 fail)

Baseline (latest main): f693520 | Date: 11/3/2026 | Pipeline: 42625636061 | Baseline logs

Interaction Benchmarks · Samples: 5
Benchmarkchrome-webpackfirefox-webpack
loadNewAccount
[Sentry log · main/release]
🟢 [CI log]🟢 [CI log]
confirmTx
[Sentry log · main/release]
🟢 [CI log]🟢 [CI log]
bridgeUserActions
[Sentry log · main/release]
🟢 [CI log]🟢 [CI log]
User Journey Benchmarks · Samples: 5 · mock API
Benchmarkchrome-webpackfirefox-webpack
onboardingImportWallet
[Sentry log · main/release]
🟢 [CI log]🟢 [CI log]
onboardingNewWallet
[Sentry log · main/release]
🟢 [CI log]🟢 [CI log]
Dapp Page Load Benchmarks · Samples: 100
Benchmarkchrome-webpack
dappPageLoad
[Sentry log · main/release]
🟢 [CI log]

📈 Results compared to the previous 5 runs on main

  • ↓ dappPageLoad/pageLoadTime: -61%
  • ↓ dappPageLoad/domContentLoaded: -20%
  • ↓ dappPageLoad/firstPaint: -42%
  • ↓ dappPageLoad/firstContentfulPaint: -42%
Bundle Size Diffs [🚨 Warning! Bundle size has increased!]
Status Bundle Total Diff Change
🚨 background 15.27 MiB +20.4 KiB +0.13%
🚨 ui 19.45 MiB +79.64 KiB +0.40%
✅ common 0 Bytes 0 Bytes 0.00%
🚨 other 4.46 MiB +22.3 KiB +0.49%
🚨 content scripts 3.23 MiB +1.53 KiB +0.05%
🚨 unzipped 79.82 MiB +128.29 KiB +0.16%
🚨 zip 23.88 MiB +54.06 KiB +0.22%

@metamask-ci

metamask-ci Bot commented Nov 9, 2026

Copy link
Copy Markdown
Contributor
Builds ready [46f4540]
⚡ Performance Benchmarks (Total: 🟢 11 pass · 🟡 0 warn · 🔴 0 fail)

Baseline (latest main): f693520 | Date: 11/3/2026 | Pipeline: 42632395269 | Baseline logs

Interaction Benchmarks · Samples: 5
Benchmarkchrome-webpackfirefox-webpack
loadNewAccount
[Sentry log · main/release]
🟢 [CI log]🟢 [CI log]
confirmTx
[Sentry log · main/release]
🟢 [CI log]🟢 [CI log]
bridgeUserActions
[Sentry log · main/release]
🟢 [CI log]🟢 [CI log]
User Journey Benchmarks · Samples: 5 · mock API
Benchmarkchrome-webpackfirefox-webpack
onboardingImportWallet
[Sentry log · main/release]
🟢 [CI log]🟢 [CI log]
onboardingNewWallet
[Sentry log · main/release]
🟢 [CI log]🟢 [CI log]
Dapp Page Load Benchmarks · Samples: 100
Benchmarkchrome-webpack
dappPageLoad
[Sentry log · main/release]
🟢 [CI log]

📈 Results compared to the previous 5 runs on main

  • ↓ dappPageLoad/pageLoadTime: -49%
  • ↓ dappPageLoad/firstPaint: -33%
  • ↓ dappPageLoad/firstContentfulPaint: -33%
Bundle Size Diffs [🚨 Warning! Bundle size has increased!]
Status Bundle Total Diff Change
🚨 background 15.27 MiB +20.56 KiB +0.13%
🚨 ui 19.48 MiB +106.78 KiB +0.54%
✅ common 0 Bytes 0 Bytes 0.00%
🚨 other 4.46 MiB +22.36 KiB +0.49%
🚨 content scripts 3.23 MiB +1.65 KiB +0.05%
🚨 unzipped 79.95 MiB +257.83 KiB +0.32%
🚨 zip 23.98 MiB +161.05 KiB +0.66%

@sahar-fehri sahar-fehri changed the title Feat/advanced charts candle with legacy line feat: advanced charts candle with legacy line Nov 9, 2026
@sahar-fehri

Copy link
Copy Markdown
Contributor Author

@metamaskbot update-policies

@metamask-ci

metamask-ci Bot commented Nov 9, 2026

Copy link
Copy Markdown
Contributor

Policies updated.
👀 Please review the diff for suspicious new powers.

Tip

Follow the policy review process outlined in the LavaMoat Policy Review Process doc before expecting an approval from Policy Reviewers.
🧠 Learn how to read policy diffs: https://lavamoat.github.io/guides/policy-diff/#what-to-look-for-when-reviewing-a-policy-diff

👀 lavamoat/webpack/mv2/beta/policy.json changes differ from lavamoat/webpack/mv2/main/policy.json changes
👀 lavamoat/webpack/mv2/experimental/policy.json changes differ from lavamoat/webpack/mv2/main/policy.json changes
👀 lavamoat/webpack/mv2/flask/policy.json changes differ from lavamoat/webpack/mv2/main/policy.json changes
👀 lavamoat/webpack/mv3/beta/policy.json changes differ from lavamoat/webpack/mv3/main/policy.json changes
👀 lavamoat/webpack/mv3/experimental/policy.json changes differ from lavamoat/webpack/mv3/main/policy.json changes
👀 lavamoat/webpack/mv3/flask/policy.json changes differ from lavamoat/webpack/mv3/main/policy.json changes

@metamask-ci

metamask-ci Bot commented Nov 9, 2026

Copy link
Copy Markdown
Contributor
Builds ready [e7e4a41]
⚡ Performance Benchmarks (Total: 🟢 8 pass · 🟡 2 warn · 🔴 3 fail)

Baseline (latest main): f693520 | Date: 11/3/2026 | Pipeline: 42639865114 | Baseline logs

Metricschrome-webpackfirefox-webpack
loadNewAccount
[Sentry log · main/release]
🔴 load_new_account(p95) [CI log]🔴 load_new_account(p95) [CI log]
onboardingImportWallet
[Sentry log · main/release]
🟢 [CI log]🔴 [CI log]

Regressions (🔴 3 failures)

Interaction Benchmarks · Samples: 5 🔴 2
Benchmarkchrome-webpackfirefox-webpack
loadNewAccount
[Sentry log · main/release]
🔴 [CI log]
🔴 load_new_account
🔴 [CI log]
🔴 load_new_account
confirmTx
[Sentry log · main/release]
🟢 [CI log]🟡 [CI log]
bridgeUserActions
[Sentry log · main/release]
🟢 [CI log]🟢 [CI log]

📈 Results compared to the previous 5 runs on main

  • ↑ loadNewAccount/load_new_account: +180%
  • ↑ loadNewAccount/total: +180%
  • ↓ loadNewAccount/inp: -40%
  • ↓ loadNewAccount/fcp: -19%
  • ↑ loadNewAccount/lcp: +693%
  • ↑ loadNewAccount/cls: +294%
  • ↑ confirmTx/longTaskTotalDuration: +11%
  • ↑ confirmTx/longTaskMaxDuration: +18%
  • ↑ confirmTx/tbt: +21%
  • ↓ confirmTx/inp: -37%
  • ↓ confirmTx/fcp: -19%
  • ↑ confirmTx/lcp: +716%
  • ↑ bridgeUserActions/bridge_load_page: +67%
  • ↑ bridgeUserActions/longTaskCount: +36%
  • ↑ bridgeUserActions/longTaskTotalDuration: +27%
  • ↑ bridgeUserActions/longTaskMaxDuration: +25%
  • ↑ bridgeUserActions/tbt: +15%
  • ↓ bridgeUserActions/inp: -19%
  • ↓ bridgeUserActions/fcp: -21%
  • ↑ bridgeUserActions/lcp: +681%
  • ↑ bridgeUserActions/cls: +634%
  • ↑ loadNewAccount/load_new_account: +182%
  • ↑ loadNewAccount/total: +182%
  • ↑ loadNewAccount/fcp: +15%
  • ↑ loadNewAccount/lcp: +1264%
  • ↓ confirmTx/longTaskCount: -100%
  • ↓ confirmTx/longTaskTotalDuration: -100%
  • ↓ confirmTx/longTaskMaxDuration: -100%
  • ↓ confirmTx/tbt: -100%
  • ↑ confirmTx/fcp: +27%
  • ↑ confirmTx/lcp: +1390%
  • ↑ bridgeUserActions/bridge_load_page: +261%
  • ↑ bridgeUserActions/bridge_load_asset_picker: +178%
  • ↓ bridgeUserActions/longTaskCount: -100%
  • ↓ bridgeUserActions/longTaskTotalDuration: -100%
  • ↓ bridgeUserActions/longTaskMaxDuration: -100%
  • ↓ bridgeUserActions/tbt: -100%
  • ↑ bridgeUserActions/total: +37%
  • ↑ bridgeUserActions/inp: +62%
  • ↓ bridgeUserActions/fcp: -32%
  • ↑ bridgeUserActions/lcp: +1313%

🌐 Core Web Vitals — 🟢 good · 🟡 needs improvement · 🔴 poor (web.dev thresholds)

  • 🟡 loadNewAccount/FCP: p75 2.0s
  • 🟡 confirmTx/FCP: p75 2.2s
  • 🟡 confirmTx/LCP: p75 2.5s
Startup Benchmarks · Samples: 100
Benchmarkchrome-webpackfirefox-webpack
startupStandardHome
[Sentry log · main/release]
🟢 [CI log]🟡 [CI log]
🟡 loadScripts

📈 Results compared to the previous 5 runs on main

  • ↑ startupStandardHome/uiStartup: +80%
  • ↑ startupStandardHome/load: +112%
  • ↑ startupStandardHome/domContentLoaded: +113%
  • ↑ startupStandardHome/domInteractive: +23%
  • ↓ startupStandardHome/firstPaint: -55%
  • ↓ startupStandardHome/firstReactRender: -98%
  • ↓ startupStandardHome/initialActions: -29%
  • ↑ startupStandardHome/loadScripts: +112%
  • ↑ startupStandardHome/setupStore: +121%
  • ↑ startupStandardHome/longTaskCount: +43%
  • ↑ startupStandardHome/longTaskTotalDuration: +109%
  • ↑ startupStandardHome/longTaskMaxDuration: +120%
  • ↑ startupStandardHome/tbt: +130%
  • ↓ startupStandardHome/fcp: -54%
  • ↑ startupStandardHome/lcp: +106%
  • ↓ startupStandardHome/cls: -72%
  • ↑ startupStandardHome/domInteractive: +41%
  • ↓ startupStandardHome/firstReactRender: -99%
  • ↓ startupStandardHome/initialActions: -50%
  • ↑ startupStandardHome/fcp: +43%
User Journey Benchmarks · Samples: 5 · mock API 🔴 1
Benchmarkchrome-webpackfirefox-webpack
onboardingImportWallet
[Sentry log · main/release]
🟢 [CI log]🔴 [CI log]
🔴 total
onboardingNewWallet
[Sentry log · main/release]
🟢 [CI log]🟢 [CI log]

📈 Results compared to the previous 5 runs on main

  • ↓ onboardingImportWallet/srpButtonToSrpForm: -16%
  • ↓ onboardingImportWallet/metricsToWalletReadyScreen: -31%
  • ↓ onboardingImportWallet/doneButtonToHomeScreen: -92%
  • ↓ onboardingImportWallet/openAccountMenuToAccountListLoaded: -74%
  • ↓ onboardingImportWallet/longTaskCount: -100%
  • ↓ onboardingImportWallet/longTaskTotalDuration: -100%
  • ↓ onboardingImportWallet/longTaskMaxDuration: -100%
  • ↓ onboardingImportWallet/tbt: -100%
  • ↓ onboardingImportWallet/total: -85%
  • ↓ onboardingNewWallet/createWalletToSocialScreen: -12%
  • ↓ onboardingNewWallet/srpButtonToPwForm: -17%
  • ↓ onboardingNewWallet/agreeButtonToOnboardingSuccess: -33%
  • ↓ onboardingNewWallet/doneButtonToAssetList: -80%
  • ↓ onboardingNewWallet/longTaskCount: -100%
  • ↓ onboardingNewWallet/longTaskTotalDuration: -100%
  • ↓ onboardingNewWallet/longTaskMaxDuration: -100%
  • ↓ onboardingNewWallet/tbt: -100%
  • ↓ onboardingNewWallet/total: -76%
Dapp Page Load Benchmarks · Samples: 100
Benchmarkchrome-webpack
dappPageLoad
[Sentry log · main/release]
🟢 [CI log]

📈 Results compared to the previous 5 runs on main

  • ↓ dappPageLoad/pageLoadTime: -60%
  • ↓ dappPageLoad/domContentLoaded: -18%
  • ↓ dappPageLoad/firstPaint: -42%
  • ↓ dappPageLoad/firstContentfulPaint: -42%
Bundle Size Diffs [🚨 Warning! Bundle size has increased!]
Status Bundle Total Diff Change
🚨 background 15.25 MiB +10.8 KiB +0.07%
🚨 ui 19.48 MiB +40.71 KiB +0.20%
✅ common 0 Bytes 0 Bytes 0.00%
✅ other 4.46 MiB +139 Bytes 0.00%
✅ content scripts 3.23 MiB +278 Bytes +0.01%
🚨 unzipped 79.93 MiB +52.64 KiB +0.06%
🚨 zip 23.98 MiB +16.18 KiB +0.07%

@sonarqubecloud

sonarqubecloud Bot commented Nov 9, 2026

Copy link
Copy Markdown

LabinatorSolutions pushed a commit to LabinatorSolutions/metamask-extension that referenced this pull request Nov 11, 2026
## **Description**

Foundation PR (1/5) for the Token Details Page (TDP) advanced charts
work. This splits the original MetaMask#47737 into five reviewable, stacked PRs:

1. **MetaMask#47749 (this PR)** — background/state foundation
2. MetaMask#47751 — chart UI
3. MetaMask#47753 — host-backed OHLCV pagination
4. MetaMask#47771 — chart theming (line/candle colors driven by design tokens)
5. MetaMask#47772 — chart analytics/instrumentation (interaction + empty-state
events)

This PR contains **no user-facing UI on its own**; the advanced chart is
rendered in the UI PR (MetaMask#47751) and stays behind the `AdvancedCharts`
remote feature flag. Landing it first keeps the CODEOWNER-reviewed
surface (background controller wiring, fixtures, privacy/state-logs)
small and isolated.

What it includes:

- **Chart-type preference** on `PreferencesController` (plus
`shared/types/preferences.ts` and `shared/lib/selectors/preferences.ts`
selector) so the TDP can persist the user's candle/line choice.
- **OHLCV service wiring** into the background: the
`@metamask/core-backend` OHLCV service and its messenger are registered
via `app/scripts/messenger-client-init/*` and `metamask-controller.js`.
- **Fixtures & state snapshots** (`default-fixture.json`,
`onboarding-fixture.json`, metrics state snapshots, `state-logs.json`)
updated to reflect the new controller state.

Base branch: `main`.

## **Changelog**

CHANGELOG entry: null

<!--
## **Related issues**

Fixes:
-->

## **Manual testing steps**

Since this PR adds no visible UI, testing is a no-regression smoke
check:

1. Build and run the extension.
2. Complete onboarding / unlock an existing wallet.
3. Confirm the wallet loads normally (home, asset list, settings) with
no errors in the background or UI console.
4. Open a token details page and confirm the existing (legacy) price
chart still renders as before.

<!--
## **Screenshots/Recordings**

### **Before**

### **After**
-->

## **Pre-merge author checklist**

- [ ] I've followed [MetaMask Contributor
Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask
Extension Coding
Standards](https://github.com/MetaMask/metamask-extension/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-extension/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]
> **Medium Risk**
> Touches persisted preferences, background service initialization, and
LavaMoat policies; new OHLCV service may open backend connectivity when
later UI/flags enable it, but this PR alone adds no visible surface.
> 
> **Overview**
> Adds **background/state foundation** for Token Details Page advanced
charts (no user-facing UI in this PR).
> 
> **Chart preferences** — `PreferencesController` and `Preferences`
types now persist `tdpChartType`, `tdpChartInterval`, and
`tdpChartIndicators`, with shared defaults in
`shared/constants/preferences` and new selectors (`getTdpChartType`,
`getTdpChartInterval`, `getTdpChartIndicators`) so controller defaults
and UI fallbacks stay aligned. Controller tests, fixtures, metrics
snapshots, and state-logs schemas are updated for the new fields.
> 
> **OHLCV streaming** — Registers `@metamask/core-backend`
`OHLCVService` in the background via `OHLCVServiceInit`, a restricted
`getOHLCVServiceMessenger` (core allow-lists), and `metamask-controller`
/ messenger factory wiring. LavaMoat webpack policies grant
`AbortController` and `async-mutex` to `core-backend` for this
dependency path.
> 
> <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit
7f6d7d4. Bugbot is set up for automated
code reviews on this repo. Configure
[here](https://www.cursor.com/dashboard/bugbot).</sup>
<!-- /CURSOR_SUMMARY -->

---------

Co-authored-by: MetaMask Bot <metamaskbot@users.noreply.github.com>

This branch was previously deployed

1 inactive deployment
pr-comment — e7e4a411 Deployed Nov 9, 2026 by sahar-fehri via Publish prerelease / Publish prerelease #173525
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.

2 participants