Skip to content

Commit 8faf9bb

Browse files
committed
feat: only use remote FF for sidepanel
1 parent 17092a5 commit 8faf9bb

File tree

8 files changed

+6
-126
lines changed

8 files changed

+6
-126
lines changed

app/scripts/background.js

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,6 @@ import {
5555
CorruptionHandler,
5656
hasVault,
5757
} from './lib/state-corruption/state-corruption-recovery';
58-
import { initSidePanelContextMenu } from './lib/sidepanel-context-menu';
5958
import {
6059
backedUpStateKeys,
6160
PersistenceManager,
@@ -183,7 +182,6 @@ const PHISHING_WARNING_PAGE_TIMEOUT = ONE_SECOND_IN_MILLISECONDS;
183182

184183
lazyListener.once('runtime', 'onInstalled').then((details) => {
185184
handleOnInstalled(details);
186-
handleSidePanelContextMenu();
187185
});
188186

189187
/**
@@ -1663,15 +1661,6 @@ function onInstall() {
16631661
}
16641662
}
16651663

1666-
/**
1667-
* Handles the onInstalled event for sidepanel context menu creation.
1668-
* This is registered via lazyListener to catch the event at module load time.
1669-
*/
1670-
async function handleSidePanelContextMenu() {
1671-
await isInitialized;
1672-
await initSidePanelContextMenu(controller);
1673-
}
1674-
16751664
/**
16761665
* Trigger actions that should happen only when an update is available
16771666
*/
@@ -1749,18 +1738,6 @@ const initSidePanelBehavior = async () => {
17491738
openPanelOnActionClick: useSidePanelAsDefault,
17501739
});
17511740
}
1752-
1753-
// Setup remote feature flag listener to update sidepanel preferences
1754-
controller?.controllerMessenger?.subscribe(
1755-
'RemoteFeatureFlagController:stateChange',
1756-
(state) => {
1757-
const extensionUxSidepanel =
1758-
state?.remoteFeatureFlags?.extensionUxSidepanel;
1759-
if (extensionUxSidepanel === false) {
1760-
controller?.preferencesController?.setUseSidePanelAsDefault(false);
1761-
}
1762-
},
1763-
);
17641741
} catch (error) {
17651742
console.error('Error setting side panel behavior:', error);
17661743
}

app/scripts/lib/sidepanel-context-menu.ts

Lines changed: 0 additions & 63 deletions
This file was deleted.

builds.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ buildTypes:
6969
- REJECT_INVALID_SNAPS_PLATFORM_VERSION: true
7070
- IFRAME_EXECUTION_ENVIRONMENT_URL: https://execution.metamask.io/iframe/10.2.3/index.html
7171
- ACCOUNT_SNAPS_DIRECTORY_URL: https://snaps.metamask.io/account-management
72-
- IS_SIDEPANEL: false
72+
- IS_SIDEPANEL: true
7373
- EXTENSION_UX_PNA25: true
7474
# for seedless onboarding (social login)
7575
- GOOGLE_BETA_CLIENT_ID
@@ -140,7 +140,7 @@ buildTypes:
140140
- SEGMENT_WRITE_KEY_REF: SEGMENT_FLASK_WRITE_KEY
141141
- ACCOUNT_SNAPS_DIRECTORY_URL: https://metamask.github.io/snaps-directory-staging/main/account-management
142142
- EIP_4337_ENTRYPOINT: '0x5FF137D4b0FDCD49DcA30c7CF57E578a026d2789'
143-
- IS_SIDEPANEL: false
143+
- IS_SIDEPANEL: true
144144
- EXTENSION_UX_PNA25: true
145145
# for seedless onboarding (social login)
146146
- GOOGLE_FLASK_CLIENT_ID

test/e2e/page-objects/flows/onboarding.flow.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,8 @@ import TermsOfUseUpdateModal from '../pages/dialog/terms-of-use-update-modal';
2525
export const handleSidepanelPostOnboarding = async (
2626
driver: Driver,
2727
): Promise<void> => {
28-
// Check if sidepanel is enabled via build configuration
2928
// AND we're not running on Firefox (which doesn't support sidepanel)
30-
const isSidepanelEnabled =
31-
process.env.IS_SIDEPANEL === 'true' &&
32-
process.env.SELENIUM_BROWSER !== Browser.FIREFOX;
29+
const isSidepanelEnabled = process.env.IS_SIDEPANEL;
3330

3431
if (isSidepanelEnabled) {
3532
// Give the onboarding completion time to process (needed for sidepanel)

ui/components/multichain/global-menu/global-menu.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ import {
2525
} from '../../../store/actions';
2626
import { isGatorPermissionsRevocationFeatureEnabled } from '../../../../shared/modules/environment';
2727
import { useI18nContext } from '../../../hooks/useI18nContext';
28-
import { useSidePanelEnabled } from '../../../hooks/useSidePanelEnabled';
2928
import {
3029
selectIsMetamaskNotificationsEnabled,
3130
selectIsMetamaskNotificationsFeatureSeen,
@@ -169,7 +168,7 @@ export const GlobalMenu = ({
169168
const isSidePanelDefault = preferences?.useSidePanelAsDefault ?? false;
170169

171170
// Check if sidepanel feature is enabled (both build flag and LaunchDarkly flag)
172-
const isSidePanelEnabled = useSidePanelEnabled();
171+
const isSidePanelEnabled = process.env.IS_SIDEPANEL;
173172

174173
const showPriorityTag = useMemo(
175174
() =>

ui/hooks/useSidePanelEnabled.ts

Lines changed: 0 additions & 27 deletions
This file was deleted.

ui/pages/onboarding-flow/creation-successful/creation-successful.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,6 @@ import {
5353
setUseSidePanelAsDefault,
5454
} from '../../../store/actions';
5555
import { LottieAnimation } from '../../../components/component-library/lottie-animation';
56-
import { useSidePanelEnabled } from '../../../hooks/useSidePanelEnabled';
5756
import WalletReadyAnimation from './wallet-ready-animation';
5857

5958
export default function CreationSuccessful() {
@@ -67,7 +66,7 @@ export default function CreationSuccessful() {
6766
);
6867
const trackEvent = useContext(MetaMetricsContext);
6968
const firstTimeFlowType = useSelector(getFirstTimeFlowType);
70-
const isSidePanelEnabled = useSidePanelEnabled();
69+
const isSidePanelEnabled = process.env.IS_SIDEPANEL;
7170

7271
const learnMoreLink =
7372
'https://support.metamask.io/stay-safe/safety-in-web3/basic-safety-and-security-tips-for-metamask/';

ui/pages/onboarding-flow/pin-extension/pin-extension.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,6 @@ import {
4444
} from '../../../../shared/constants/metametrics';
4545
import { FirstTimeFlowType } from '../../../../shared/constants/onboarding';
4646
import { getBrowserName } from '../../../../shared/modules/browser-runtime.utils';
47-
import { useSidePanelEnabled } from '../../../hooks/useSidePanelEnabled';
4847

4948
export default function OnboardingPinExtension() {
5049
const t = useI18nContext();
@@ -54,7 +53,6 @@ export default function OnboardingPinExtension() {
5453
const trackEvent = useContext(MetaMetricsContext);
5554
const firstTimeFlowType = useSelector(getFirstTimeFlowType);
5655
const currentKeyring = useSelector(getCurrentKeyring);
57-
const isSidePanelEnabled = useSidePanelEnabled();
5856

5957
const externalServicesOnboardingToggleState = useSelector(
6058
getExternalServicesOnboardingToggleState,
@@ -76,7 +74,7 @@ export default function OnboardingPinExtension() {
7674
});
7775

7876
// Side Panel - only if feature flag is enabled and not in test mode
79-
if (isSidePanelEnabled) {
77+
if (process.env.IS_SIDEPANEL) {
8078
try {
8179
if (browser?.sidePanel?.open) {
8280
const tabs = await browser.tabs.query({

0 commit comments

Comments
 (0)