chore: update experimental settings to new design#40369
Conversation
|
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. |
| <div | ||
| class="toggle-button__status" | ||
| > | ||
| <span | ||
| class="toggle-button__label-off" | ||
| /> | ||
| <span | ||
| class="toggle-button__label-on" | ||
| /> | ||
| </div> |
There was a problem hiding this comment.
Removed redundant toggle labels when they are not provided to ToggleButton
| {showLabels && ( | ||
| <div className="toggle-button__status"> | ||
| <span className="toggle-button__label-off">{offLabel}</span> | ||
| <span className="toggle-button__label-on">{onLabel}</span> | ||
| </div> | ||
| )} |
There was a problem hiding this comment.
ToggleButton labels are used optionally. This ensures these empty spans and div don't render when labels are not passed in.
There was a problem hiding this comment.
Renamed to experimental-tab.tsx
There was a problem hiding this comment.
No longer needed, hooks used inside component
There was a problem hiding this comment.
Renamed from experimental-tab.component.ts and brought up to date
✨ Files requiring CODEOWNER review ✨🔑 @MetaMask/accounts-engineers (2 files, +0 -70)
👨🔧 @MetaMask/core-extension-ux (1 files, +0 -20)
|
| <Text variant={TextVariant.BodyMd} fontWeight={FontWeight.Medium}> | ||
| {title} | ||
| </Text> | ||
| <div data-testid={toggleContainerDataTestId}> |
There was a problem hiding this comment.
It's for the e2e tests because the checkbox in the togglebutton is inaccessible. The ToggleButton will need a refactor at some point but not this PR.
| title: string; | ||
| description: React.ReactNode; | ||
| toggleValue: boolean; | ||
| toggleCallback: (value: boolean) => void; |
There was a problem hiding this comment.
Thoughts on common prop names like?
onTogglevalue
|
Builds ready [7da4b01]
⚡ Performance Benchmarks (1450 ± 103 ms)
🌐 Dapp Page Load BenchmarksCurrent Commit: 📄 Localhost MetaMask Test DappSamples: 100 Summary
📈 Detailed Results
Bundle size diffs [🚀 Bundle size reduced!]
|
There was a problem hiding this comment.
Let's use this component moving forwards for any setting item with a toggle @NidhiKJha ?
| <Text variant={TextVariant.BodyMd} fontWeight={FontWeight.Medium}> | ||
| {title} | ||
| </Text> | ||
| <div data-testid={containerDataTestId}> |
NidhiKJha
left a comment
There was a problem hiding this comment.
Left a small comment. Looks good otherwise
owencraston
left a comment
There was a problem hiding this comment.
Approving the design/content changes but did not review the code.



Description
Updates Settings > Experimental page to bring it inline with Figma redesign (note this doesn't include the header and search bar). React component and js files have been brought up to date. No functional changes.
NOTE: the new
SettingsToggleItemcomponent has been extracted out and should be reusable across other Settings pages now.Changelog
CHANGELOG entry: Updated Experimental Settings styles and Snaps settings content
Related issues
Fixes: https://consensyssoftware.atlassian.net/browse/CEUX-914
Manual testing steps
Screenshots/Recordings
Before
After
Pre-merge author checklist
Pre-merge reviewer checklist
Note
Low Risk
Primarily a UI refactor of the Experimental settings page plus minor action signature changes; risk is limited to settings toggle wiring/regressions and snapshot/test updates.
Overview
Updates Settings � Experimental to the new design-system layout by replacing the legacy class-based + Redux
connectimplementation with a functional component split into reusable toggle rows via a newSettingsToggleItem.Makes
ToggleButtononly render on/off labels when both labels are provided (updating snapshots accordingly), convertssetWatchEthereumAccountEnabledandsetAddSnapAccountEnabledto thunk action creators (with new action tests), adjusts the Experimental tab test to mock actions, and removes unused i18n strings (snapAccounts*) across locales.Written by Cursor Bugbot for commit 7da4b01. This will update automatically on new commits. Configure here.