Skip to content

Commit b827206

Browse files
committed
refactor: simplify home tabs
1 parent ed18920 commit b827206

Some content is hidden

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

41 files changed

+148
-234
lines changed

app/scripts/constants/sentry-state.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,6 @@ export const SENTRY_BACKGROUND_STATE = {
5858
currentPopupId: false,
5959
onboardingDate: false,
6060
currentExtensionPopupId: false,
61-
defaultHomeActiveTabName: true,
6261
enableEnforcedSimulations: true,
6362
enableEnforcedSimulationsForTransactions: false,
6463
fullScreenGasPollTokens: true,

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

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ import {
1212
ORIGIN_METAMASK,
1313
POLLING_TOKEN_ENVIRONMENT_TYPES,
1414
} from '../../../shared/constants/app';
15-
import { AccountOverviewTabKey } from '../../../shared/constants/app-state';
1615
import { MINUTE } from '../../../shared/constants/time';
1716
import { AppStateController } from './app-state-controller';
1817
import type {
@@ -188,18 +187,6 @@ describe('AppStateController', () => {
188187
});
189188
});
190189

191-
describe('setDefaultHomeActiveTabName', () => {
192-
it('sets the default home tab name', async () => {
193-
await withController(({ controller }) => {
194-
controller.setDefaultHomeActiveTabName(AccountOverviewTabKey.Activity);
195-
196-
expect(controller.state.defaultHomeActiveTabName).toBe(
197-
AccountOverviewTabKey.Activity,
198-
);
199-
});
200-
});
201-
});
202-
203190
describe('setConnectedStatusPopoverHasBeenShown', () => {
204191
it('sets connected status popover as shown', async () => {
205192
await withController(({ controller }) => {
@@ -763,7 +750,6 @@ describe('AppStateController', () => {
763750
"connectedStatusPopoverHasBeenShown": true,
764751
"currentExtensionPopupId": 0,
765752
"currentPopupId": 0,
766-
"defaultHomeActiveTabName": null,
767753
"enableEnforcedSimulations": true,
768754
"enableEnforcedSimulationsForTransactions": {},
769755
"enforcedSimulationsSlippage": 10,
@@ -852,7 +838,6 @@ describe('AppStateController', () => {
852838
"connectedStatusPopoverHasBeenShown": true,
853839
"currentExtensionPopupId": 0,
854840
"currentPopupId": 0,
855-
"defaultHomeActiveTabName": null,
856841
"enableEnforcedSimulations": true,
857842
"enableEnforcedSimulationsForTransactions": {},
858843
"enforcedSimulationsSlippage": 10,
@@ -937,7 +922,6 @@ describe('AppStateController', () => {
937922
"browserEnvironment": {},
938923
"canTrackWalletFundsObtained": true,
939924
"connectedStatusPopoverHasBeenShown": true,
940-
"defaultHomeActiveTabName": null,
941925
"enableEnforcedSimulations": true,
942926
"enforcedSimulationsSlippage": 10,
943927
"hadAdvancedGasFeesSetPriorToMigration92_3": false,
@@ -1017,7 +1001,6 @@ describe('AppStateController', () => {
10171001
"connectedStatusPopoverHasBeenShown": true,
10181002
"currentExtensionPopupId": 0,
10191003
"currentPopupId": 0,
1020-
"defaultHomeActiveTabName": null,
10211004
"enableEnforcedSimulations": true,
10221005
"enableEnforcedSimulationsForTransactions": {},
10231006
"enforcedSimulationsSlippage": 10,

app/scripts/controllers/app-state-controller.ts

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,6 @@ export type AppStateControllerState = {
7373
// States used for displaying the changed network toast
7474
currentExtensionPopupId: number;
7575
currentPopupId?: number;
76-
defaultHomeActiveTabName: AccountOverviewTabKey | null;
7776
enableEnforcedSimulations: boolean;
7877
enableEnforcedSimulationsForTransactions: Record<string, boolean>;
7978
enforcedSimulationsSlippage: number;
@@ -234,7 +233,6 @@ const getDefaultAppStateControllerState = (): AppStateControllerState => ({
234233
appActiveTab: undefined,
235234
browserEnvironment: {},
236235
connectedStatusPopoverHasBeenShown: true,
237-
defaultHomeActiveTabName: null,
238236
enableEnforcedSimulations: true,
239237
enableEnforcedSimulationsForTransactions: {},
240238
enforcedSimulationsSlippage: 10,
@@ -342,12 +340,6 @@ const controllerMetadata: StateMetadata<AppStateControllerState> = {
342340
includeInDebugSnapshot: true,
343341
usedInUi: true,
344342
},
345-
defaultHomeActiveTabName: {
346-
includeInStateLogs: true,
347-
persist: true,
348-
includeInDebugSnapshot: true,
349-
usedInUi: true,
350-
},
351343
enableEnforcedSimulations: {
352344
includeInStateLogs: true,
353345
persist: true,
@@ -757,19 +749,6 @@ export class AppStateController extends BaseController<
757749
this.#acceptApproval();
758750
}
759751

760-
/**
761-
* Sets the default home tab
762-
*
763-
* @param defaultHomeActiveTabName - the tab name
764-
*/
765-
setDefaultHomeActiveTabName(
766-
defaultHomeActiveTabName: AccountOverviewTabKey | null,
767-
): void {
768-
this.update((state) => {
769-
state.defaultHomeActiveTabName = defaultHomeActiveTabName;
770-
});
771-
}
772-
773752
/**
774753
* Record that the user has seen the connected status info popover
775754
*/

app/scripts/metamask-controller.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2768,8 +2768,6 @@ export default class MetamaskController extends EventEmitter {
27682768
appStateController.setCurrentExtensionPopupId.bind(appStateController),
27692769
setBrowserEnvironment:
27702770
appStateController.setBrowserEnvironment.bind(appStateController),
2771-
setDefaultHomeActiveTabName:
2772-
appStateController.setDefaultHomeActiveTabName.bind(appStateController),
27732771
setConnectedStatusPopoverHasBeenShown:
27742772
appStateController.setConnectedStatusPopoverHasBeenShown.bind(
27752773
appStateController,

shared/types/background.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,6 @@ export type ControllerStatePropertiesEnumerated = {
9393
pendingApprovalCount: ApprovalControllerState['pendingApprovalCount'];
9494
timeoutMinutes: AppStateControllerState['timeoutMinutes'];
9595
connectedStatusPopoverHasBeenShown: AppStateControllerState['connectedStatusPopoverHasBeenShown'];
96-
defaultHomeActiveTabName: AppStateControllerState['defaultHomeActiveTabName'];
9796
browserEnvironment: AppStateControllerState['browserEnvironment'];
9897
popupGasPollTokens: AppStateControllerState['popupGasPollTokens'];
9998
notificationGasPollTokens: AppStateControllerState['notificationGasPollTokens'];

test/e2e/default-fixture.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,6 @@ function defaultFixture(inputChainId = CHAIN_IDS.LOCALHOST) {
108108
connectedStatusPopoverHasBeenShown: true,
109109
termsOfUseLastAgreed:
110110
'__FIXTURE_SUBSTITUTION__currentDateInMilliseconds',
111-
defaultHomeActiveTabName: null,
112111
fullScreenGasPollTokens: [],
113112
notificationGasPollTokens: [],
114113
popupGasPollTokens: [],

test/e2e/fixtures/onboarding-fixture.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,6 @@
4848
"os": "mac"
4949
},
5050
"connectedStatusPopoverHasBeenShown": true,
51-
"defaultHomeActiveTabName": null,
5251
"enableEnforcedSimulations": true,
5352
"enforcedSimulationsSlippage": 10,
5453
"hadAdvancedGasFeesSetPriorToMigration92_3": false,

test/e2e/tests/metrics/state-snapshots/errors-after-init-opt-in-background-state.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@
3333
"browserEnvironment": { "os": "string", "browser": "string" },
3434
"canTrackWalletFundsObtained": false,
3535
"connectedStatusPopoverHasBeenShown": true,
36-
"defaultHomeActiveTabName": null,
3736
"enableEnforcedSimulations": true,
3837
"enableEnforcedSimulationsForTransactions": "object",
3938
"enforcedSimulationsSlippage": "number",

test/e2e/tests/metrics/state-snapshots/errors-after-init-opt-in-ui-state.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,6 @@
136136
"appActiveTab": "object",
137137
"browserEnvironment": { "os": "string", "browser": "string" },
138138
"connectedStatusPopoverHasBeenShown": true,
139-
"defaultHomeActiveTabName": null,
140139
"enableEnforcedSimulations": true,
141140
"enableEnforcedSimulationsForTransactions": "object",
142141
"enforcedSimulationsSlippage": "number",

test/e2e/tests/metrics/state-snapshots/errors-before-init-opt-in-background-state.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@
3737
"nftsDropdownState": {},
3838
"connectedStatusPopoverHasBeenShown": true,
3939
"termsOfUseLastAgreed": "number",
40-
"defaultHomeActiveTabName": null,
4140
"fullScreenGasPollTokens": "object",
4241
"notificationGasPollTokens": "object",
4342
"popupGasPollTokens": "object",

0 commit comments

Comments
 (0)