Skip to content

Commit 66c994a

Browse files
feat: Remove 'Improved transactions requests' toggle (#29695)
<!-- 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** We [recently enabled the transaction redesign for all users by default](#28321). We also [migrated some existing e2e tests to corresponding e2e tests for redesigned flows](#28780). This PR removes the toggle that allowed users to opt out of the redesigned confirmations. It also removes the e2e tests for old confirmation flows that are no longer visible in any scenario. <!-- 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? --> [![Open in GitHub Codespaces](https://github.com/codespaces/badge.svg)](https://codespaces.new/MetaMask/metamask-extension/pull/29695?quickstart=1) ## **Related issues** Fixes: MetaMask/MetaMask-planning#3030 ## **Manual testing steps** 1. Open experimental settings. 2. The option toggle shouldn't be there. 3. Create a new transaction confirmation 4. It should be redesigned. ## **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 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.
1 parent 5786e7a commit 66c994a

File tree

81 files changed

+4901
-12872
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

81 files changed

+4901
-12872
lines changed

app/_locales/de/messages.json

-6
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

app/_locales/el/messages.json

-6
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

app/_locales/en/messages.json

-6
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

app/_locales/es/messages.json

-6
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

app/_locales/fr/messages.json

-6
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

app/_locales/hi/messages.json

-6
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

app/_locales/id/messages.json

-6
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

app/_locales/ja/messages.json

-6
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

app/_locales/ko/messages.json

-6
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

app/_locales/pt/messages.json

-6
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

app/_locales/ru/messages.json

-6
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

app/_locales/tl/messages.json

-6
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

app/_locales/tr/messages.json

-6
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

app/_locales/vi/messages.json

-6
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

app/_locales/zh_CN/messages.json

-6
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

app/scripts/constants/sentry-state.ts

-1
Original file line numberDiff line numberDiff line change
@@ -249,7 +249,6 @@ export const SENTRY_BACKGROUND_STATE = {
249249
autoLockTimeLimit: true,
250250
hideZeroBalanceTokens: true,
251251
redesignedConfirmationsEnabled: true,
252-
redesignedTransactionsEnabled: false,
253252
isRedesignedConfirmationsDeveloperEnabled: false,
254253
showExtensionInFullSizeView: true,
255254
showFiatInTestnets: true,

app/scripts/controllers/preferences-controller.test.ts

-2
Original file line numberDiff line numberDiff line change
@@ -726,7 +726,6 @@ describe('preferences controller', () => {
726726
hideZeroBalanceTokens: false,
727727
petnamesEnabled: true,
728728
redesignedConfirmationsEnabled: true,
729-
redesignedTransactionsEnabled: true,
730729
shouldShowAggregatedBalancePopover: true,
731730
featureNotificationsEnabled: false,
732731
isRedesignedConfirmationsDeveloperEnabled: false,
@@ -757,7 +756,6 @@ describe('preferences controller', () => {
757756
petnamesEnabled: true,
758757
privacyMode: false,
759758
redesignedConfirmationsEnabled: true,
760-
redesignedTransactionsEnabled: true,
761759
shouldShowAggregatedBalancePopover: true,
762760
featureNotificationsEnabled: false,
763761
isRedesignedConfirmationsDeveloperEnabled: false,

app/scripts/controllers/preferences-controller.ts

-2
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,6 @@ export type Preferences = {
110110
hideZeroBalanceTokens: boolean;
111111
petnamesEnabled: boolean;
112112
redesignedConfirmationsEnabled: boolean;
113-
redesignedTransactionsEnabled: boolean;
114113
featureNotificationsEnabled: boolean;
115114
showMultiRpcModal: boolean;
116115
privacyMode: boolean;
@@ -223,7 +222,6 @@ export const getDefaultPreferencesControllerState =
223222
hideZeroBalanceTokens: false,
224223
petnamesEnabled: true,
225224
redesignedConfirmationsEnabled: true,
226-
redesignedTransactionsEnabled: true,
227225
featureNotificationsEnabled: false,
228226
isRedesignedConfirmationsDeveloperEnabled: false,
229227
showConfirmationAdvancedDetails: false,

app/scripts/lib/transaction/metrics.test.ts

-1
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,6 @@ const mockTransactionMetricsRequest = {
7575
trackEvent: jest.fn(),
7676
getIsSmartTransaction: jest.fn(),
7777
getSmartTransactionByMinedTxHash: jest.fn(),
78-
getRedesignedTransactionsEnabled: jest.fn(),
7978
getMethodData: jest.fn(),
8079
getIsRedesignedConfirmationsDeveloperEnabled: jest.fn(),
8180
getIsConfirmationAdvancedDetailsOpen: jest.fn(),

app/scripts/lib/transaction/metrics.ts

-3
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,6 @@ export type TransactionMetricsRequest = {
102102
getSmartTransactionByMinedTxHash: (
103103
txhash: string | undefined,
104104
) => SmartTransaction;
105-
getRedesignedTransactionsEnabled: () => boolean;
106105
getMethodData: (data: string) => Promise<{ name: string }>;
107106
getIsRedesignedConfirmationsDeveloperEnabled: () => boolean;
108107
getIsConfirmationAdvancedDetailsOpen: () => boolean;
@@ -1024,8 +1023,6 @@ async function buildEventFragmentProperties({
10241023

10251024
const isRedesignedForTransaction = shouldUseRedesignForTransactions({
10261025
transactionMetadataType: transactionMeta.type as TransactionType,
1027-
isRedesignedTransactionsUserSettingEnabled:
1028-
transactionMetricsRequest.getRedesignedTransactionsEnabled(),
10291026
isRedesignedConfirmationsDeveloperEnabled:
10301027
transactionMetricsRequest.getIsRedesignedConfirmationsDeveloperEnabled(),
10311028
});

app/scripts/metamask-controller.js

-7
Original file line numberDiff line numberDiff line change
@@ -6665,11 +6665,6 @@ export default class MetamaskController extends EventEmitter {
66656665
.redesignedConfirmationsEnabled;
66666666
}
66676667

6668-
isTransactionsRedesignEnabled() {
6669-
return this.preferencesController.state.preferences
6670-
.redesignedTransactionsEnabled;
6671-
}
6672-
66736668
isConfirmationRedesignDeveloperEnabled() {
66746669
return this.preferencesController.state.preferences
66756670
.isRedesignedConfirmationsDeveloperEnabled;
@@ -6861,8 +6856,6 @@ export default class MetamaskController extends EventEmitter {
68616856
},
68626857
getRedesignedConfirmationsEnabled:
68636858
this.isConfirmationRedesignEnabled.bind(this),
6864-
getRedesignedTransactionsEnabled:
6865-
this.isTransactionsRedesignEnabled.bind(this),
68666859
getMethodData: (data) => {
68676860
if (!data) {
68686861
return null;

app/scripts/migrations/138.test.ts

+79
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
import { migrate, version } from './138';
2+
3+
const oldVersion = 137;
4+
5+
describe(`migration #${version}`, () => {
6+
it('updates the version metadata', async () => {
7+
const oldStorage = {
8+
meta: { version: oldVersion },
9+
data: {},
10+
};
11+
const newStorage = await migrate(oldStorage);
12+
expect(newStorage.meta).toStrictEqual({ version });
13+
});
14+
15+
describe(`migration #${version}`, () => {
16+
it('removes the redesignedTransactionsEnabled preference if it is set to true', async () => {
17+
const oldStorage = {
18+
meta: { version: oldVersion },
19+
data: {
20+
PreferencesController: {
21+
preferences: {
22+
redesignedTransactionsEnabled: true,
23+
},
24+
},
25+
},
26+
};
27+
const expectedData = {
28+
PreferencesController: {
29+
preferences: {},
30+
},
31+
};
32+
const newStorage = await migrate(oldStorage);
33+
34+
expect(newStorage.data).toStrictEqual(expectedData);
35+
});
36+
37+
it('removes the redesignedTransactionsEnabled preference if it is set to false', async () => {
38+
const oldStorage = {
39+
meta: { version: oldVersion },
40+
data: {
41+
PreferencesController: {
42+
preferences: {
43+
redesignedTransactionsEnabled: false,
44+
},
45+
},
46+
},
47+
};
48+
const expectedData = {
49+
PreferencesController: {
50+
preferences: {},
51+
},
52+
};
53+
const newStorage = await migrate(oldStorage);
54+
55+
expect(newStorage.data).toStrictEqual(expectedData);
56+
});
57+
58+
it('does nothing to other PreferencesController state if there is not a redesignedTransactionsEnabled preference', async () => {
59+
const oldStorage = {
60+
meta: { version: oldVersion },
61+
data: {
62+
PreferencesController: {
63+
existingPreference: true,
64+
},
65+
},
66+
};
67+
68+
const expectedData = {
69+
PreferencesController: {
70+
existingPreference: true,
71+
},
72+
};
73+
74+
const newStorage = await migrate(oldStorage);
75+
76+
expect(newStorage.data).toStrictEqual(expectedData);
77+
});
78+
});
79+
});

0 commit comments

Comments
 (0)