Skip to content

Commit 576d0e1

Browse files
committed
fix: merge conflict
2 parents c8dadac + f22cf05 commit 576d0e1

File tree

28 files changed

+606
-319
lines changed

28 files changed

+606
-319
lines changed

app/scripts/background.js

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1800,17 +1800,29 @@ const initSidePanelBehavior = async () => {
18001800
// Wait for controller to be initialized
18011801
await isInitialized;
18021802

1803-
// Get user preference (default to true for side panel)
1803+
// Get user preference (default to false for side panel)
18041804
const useSidePanelAsDefault =
18051805
controller?.preferencesController?.state?.preferences
1806-
?.useSidePanelAsDefault ?? true;
1806+
?.useSidePanelAsDefault ?? false;
18071807

18081808
// Set panel behavior based on preference
18091809
if (browser?.sidePanel?.setPanelBehavior) {
18101810
await browser.sidePanel.setPanelBehavior({
18111811
openPanelOnActionClick: useSidePanelAsDefault,
18121812
});
18131813
}
1814+
1815+
// Setup remote feature flag listener to update sidepanel preferences
1816+
controller?.controllerMessenger?.subscribe(
1817+
'RemoteFeatureFlagController:stateChange',
1818+
(state) => {
1819+
const extensionUxSidepanel =
1820+
state?.remoteFeatureFlags?.extensionUxSidepanel;
1821+
if (extensionUxSidepanel === false) {
1822+
controller?.preferencesController?.setUseSidePanelAsDefault(false);
1823+
}
1824+
},
1825+
);
18141826
} catch (error) {
18151827
console.error('Error setting side panel behavior:', error);
18161828
}
@@ -1834,7 +1846,8 @@ const setupPreferenceListener = async () => {
18341846
'PreferencesController:stateChange',
18351847
(state) => {
18361848
const useSidePanelAsDefault =
1837-
state?.preferences?.useSidePanelAsDefault ?? true;
1849+
state?.preferences?.useSidePanelAsDefault ?? false;
1850+
18381851
if (browser?.sidePanel?.setPanelBehavior) {
18391852
browser.sidePanel
18401853
.setPanelBehavior({

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

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -708,7 +708,7 @@ describe('preferences controller', () => {
708708
smartTransactionsMigrationApplied: false,
709709
smartTransactionsOptInStatus: true,
710710
useNativeCurrencyAsPrimaryCurrency: true,
711-
useSidePanelAsDefault: true,
711+
useSidePanelAsDefault: false,
712712
hideZeroBalanceTokens: false,
713713
petnamesEnabled: true,
714714
skipDeepLinkInterstitial: false,
@@ -739,7 +739,7 @@ describe('preferences controller', () => {
739739
smartTransactionsMigrationApplied: false,
740740
smartTransactionsOptInStatus: true,
741741
useNativeCurrencyAsPrimaryCurrency: true,
742-
useSidePanelAsDefault: true,
742+
useSidePanelAsDefault: false,
743743
hideZeroBalanceTokens: false,
744744
petnamesEnabled: true,
745745
skipDeepLinkInterstitial: false,
@@ -911,7 +911,7 @@ describe('preferences controller', () => {
911911
"sortCallback": "stringNumeric",
912912
},
913913
"useNativeCurrencyAsPrimaryCurrency": true,
914-
"useSidePanelAsDefault": true,
914+
"useSidePanelAsDefault": false,
915915
},
916916
"theme": "os",
917917
"use4ByteResolution": true,
@@ -983,7 +983,7 @@ describe('preferences controller', () => {
983983
"sortCallback": "stringNumeric",
984984
},
985985
"useNativeCurrencyAsPrimaryCurrency": true,
986-
"useSidePanelAsDefault": true,
986+
"useSidePanelAsDefault": false,
987987
},
988988
"referrals": {
989989
"hyperliquid": {},
@@ -1067,7 +1067,7 @@ describe('preferences controller', () => {
10671067
"sortCallback": "stringNumeric",
10681068
},
10691069
"useNativeCurrencyAsPrimaryCurrency": true,
1070-
"useSidePanelAsDefault": true,
1070+
"useSidePanelAsDefault": false,
10711071
},
10721072
"referrals": {
10731073
"hyperliquid": {},
@@ -1151,7 +1151,7 @@ describe('preferences controller', () => {
11511151
"sortCallback": "stringNumeric",
11521152
},
11531153
"useNativeCurrencyAsPrimaryCurrency": true,
1154-
"useSidePanelAsDefault": true,
1154+
"useSidePanelAsDefault": false,
11551155
},
11561156
"referrals": {
11571157
"hyperliquid": {},

app/scripts/controllers/preferences-controller.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,7 @@ export const getDefaultPreferencesControllerState =
223223
},
224224
useNativeCurrencyAsPrimaryCurrency: true,
225225
///: BEGIN:ONLY_INCLUDE_IF(build-experimental)
226-
useSidePanelAsDefault: true,
226+
useSidePanelAsDefault: false,
227227
///: END:ONLY_INCLUDE_IF
228228
},
229229
securityAlertsEnabled: true,
@@ -1016,6 +1016,12 @@ export class PreferencesController extends BaseController<
10161016
});
10171017
}
10181018

1019+
setUseSidePanelAsDefault(value: boolean): void {
1020+
this.update((state) => {
1021+
state.preferences.useSidePanelAsDefault = value;
1022+
});
1023+
}
1024+
10191025
///: BEGIN:ONLY_INCLUDE_IF(keyring-snaps)
10201026
setSnapsAddSnapAccountModalDismissed(value: boolean): void {
10211027
this.update((state) => {

app/scripts/metamask-controller.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4605,8 +4605,9 @@ export default class MetamaskController extends EventEmitter {
46054605
const newHdEntropyIndex = this.getHDEntropyIndex();
46064606

46074607
this.metaMetricsController.trackEvent({
4608-
event: MetaMetricsEventName.ImportSecretRecoveryPhraseCompleted,
4608+
event: MetaMetricsEventName.ImportSecretRecoveryPhrase,
46094609
properties: {
4610+
status: 'completed',
46104611
// eslint-disable-next-line @typescript-eslint/naming-convention
46114612
hd_entropy_index: newHdEntropyIndex,
46124613
// eslint-disable-next-line @typescript-eslint/naming-convention

shared/constants/metametrics.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -719,8 +719,7 @@ export enum MetaMetricsEventName {
719719
EncryptionPublicKeyRequested = 'Encryption Requested',
720720
ErrorOccured = 'Error occured',
721721
ExternalLinkClicked = 'External Link Clicked',
722-
ImportSecretRecoveryPhraseClicked = 'Import Secret Recovery Phrase Clicked',
723-
ImportSecretRecoveryPhraseCompleted = 'Import Secret Recovery Phrase Completed',
722+
ImportSecretRecoveryPhrase = 'Import Secret Recovery Phrase',
724723
KeyExportSelected = 'Key Export Selected',
725724
KeyExportRequested = 'Key Export Requested',
726725
KeyExportFailed = 'Key Export Failed',

test/e2e/tests/identity/account-syncing/helpers.ts

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,14 @@ export const arrangeTestUtils = (
4646
const accounts = userStorageMockttpController.paths.get(
4747
USER_STORAGE_GROUPS_FEATURE_KEY,
4848
)?.response;
49-
return accounts?.length === expectedNumber;
49+
const currentCount = accounts?.length ?? 0;
50+
if (currentCount !== expectedNumber) {
51+
console.log(
52+
`Current synced accounts: ${currentCount}, expected: ${expectedNumber}. Accounts:`,
53+
JSON.stringify(accounts),
54+
);
55+
}
56+
return currentCount === expectedNumber;
5057
},
5158
{
5259
timeout: BASE_TIMEOUT,

test/e2e/tests/identity/account-syncing/imported-accounts.spec.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,10 @@ describe('Account syncing - Unsupported Account types', function () {
8181
prepareEventsEmittedCounter,
8282
waitUntilSyncedAccountsNumberEquals,
8383
} = arrangeTestUtils(driver, userStorageMockttpController);
84+
85+
// Wait for initial account sync to complete before adding a new account
86+
await waitUntilSyncedAccountsNumberEquals(1);
87+
8488
const { waitUntilEventsEmittedNumberEquals } =
8589
prepareEventsEmittedCounter(
8690
UserStorageMockttpControllerEvents.PUT_SINGLE,
@@ -90,8 +94,9 @@ describe('Account syncing - Unsupported Account types', function () {
9094
await accountListPage.addMultichainAccount();
9195

9296
// Wait for sync operation to complete
93-
await waitUntilSyncedAccountsNumberEquals(2);
97+
// Check event first to ensure sync was attempted, then verify state
9498
await waitUntilEventsEmittedNumberEquals(1);
99+
await waitUntilSyncedAccountsNumberEquals(2);
95100

96101
// Verify both regular accounts are visible
97102
await accountListPage.checkAccountDisplayedInAccountList(

test/e2e/tests/identity/account-syncing/multi-srp.spec.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,10 @@ describe('Account syncing - Multiple SRPs', function () {
7979
prepareEventsEmittedCounter,
8080
waitUntilSyncedAccountsNumberEquals,
8181
} = arrangeTestUtils(driver, userStorageMockttpController);
82+
83+
// Wait for initial account sync to complete before adding a new account
84+
await waitUntilSyncedAccountsNumberEquals(1);
85+
8286
const { waitUntilEventsEmittedNumberEquals } =
8387
prepareEventsEmittedCounter(
8488
UserStorageMockttpControllerEvents.PUT_SINGLE,
@@ -88,8 +92,9 @@ describe('Account syncing - Multiple SRPs', function () {
8892
await accountListPage.addMultichainAccount();
8993

9094
// Wait for sync operation to complete
91-
await waitUntilSyncedAccountsNumberEquals(2);
95+
// Check event first to ensure sync was attempted, then verify state
9296
await waitUntilEventsEmittedNumberEquals(1);
97+
await waitUntilSyncedAccountsNumberEquals(2);
9398

9499
// Verify both accounts are visible
95100
await accountListPage.checkAccountDisplayedInAccountList(

ui/components/app/confirm/info/row/address.tsx

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,16 @@ export type ConfirmInfoRowAddressProps = {
1818
address: string;
1919
chainId: string;
2020
isSnapUsingThis?: boolean;
21+
showFullName?: boolean;
2122
};
2223

2324
export const ConfirmInfoRowAddress = memo(
24-
({ address, chainId, isSnapUsingThis }: ConfirmInfoRowAddressProps) => {
25+
({
26+
address,
27+
chainId,
28+
isSnapUsingThis,
29+
showFullName = false,
30+
}: ConfirmInfoRowAddressProps) => {
2531
const { displayName, hexAddress } = useFallbackDisplayName(address);
2632
const [isNicknamePopoverShown, setIsNicknamePopoverShown] = useState(false);
2733
const handleDisplayNameClick = () => setIsNicknamePopoverShown(true);
@@ -70,6 +76,7 @@ export const ConfirmInfoRowAddress = memo(
7076
type={NameType.ETHEREUM_ADDRESS}
7177
preferContractSymbol
7278
variation={chainId}
79+
showFullName={showFullName}
7380
/>
7481
)
7582
}

ui/components/app/name/name.tsx

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,11 @@ export type NameProps = {
4545
* The fallback value to display if the name is not found or cannot be resolved.
4646
*/
4747
fallbackName?: string;
48+
49+
/**
50+
* Whether to show the full name.
51+
*/
52+
showFullName?: boolean;
4853
};
4954

5055
const Name = memo(

0 commit comments

Comments
 (0)