Skip to content
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
8faf9bb
feat: only use remote FF for sidepanel
NidhiKJha Nov 28, 2025
a41e775
lint fix
NidhiKJha Nov 28, 2025
29dcfa1
restored check for firefox
NidhiKJha Nov 28, 2025
41ee047
updated manifest
NidhiKJha Nov 28, 2025
bcf1659
Merge branch 'main' into sidepanel-remote-flag
NidhiKJha Nov 28, 2025
97231f5
updated test
NidhiKJha Dec 1, 2025
f00030e
Merge branch 'main' into sidepanel-remote-flag
NidhiKJha Dec 1, 2025
5f662b7
updated console error
NidhiKJha Dec 1, 2025
733a22b
e2e fix
NidhiKJha Dec 1, 2025
e3f10e8
updated helpers
NidhiKJha Dec 1, 2025
faf9891
updated helpers
NidhiKJha Dec 1, 2025
d390cd2
Merge branch 'main' into sidepanel-remote-flag
NidhiKJha Dec 1, 2025
8c865ce
helper update
NidhiKJha Dec 1, 2025
cd6e517
updated sidepanel
NidhiKJha Dec 1, 2025
956cadb
updated sidepanel
NidhiKJha Dec 1, 2025
3e29061
Merge branch 'main' into sidepanel-remote-flag
NidhiKJha Dec 1, 2025
a4980cb
sidepanel fence
NidhiKJha Dec 1, 2025
c286e1e
Merge branch 'main' into sidepanel-remote-flag
ameliejyc Dec 2, 2025
fa9d999
fix: e2e tests by adding sidepanel env flag
ameliejyc Dec 2, 2025
920ea47
chore: update sidepanel env check conditions
ameliejyc Dec 2, 2025
e692d9a
chore: fix isSidePanelEnabled calls
ameliejyc Dec 2, 2025
056ccbf
chore: fix isSidePanelEnabled calls again
ameliejyc Dec 2, 2025
f78abd4
chore: bring back useSidePanelEnabled
ameliejyc Dec 2, 2025
67c4541
fix: onboarding e2e tests
ameliejyc Dec 2, 2025
b14a9d5
chore: add debug log
ameliejyc Dec 2, 2025
11255c1
fix: Browser import
ameliejyc Dec 2, 2025
2fa16aa
chore: make hasSidepanel check more specific
ameliejyc Dec 2, 2025
bb8b7e3
chore: fix lint
ameliejyc Dec 2, 2025
6f558d9
Merge branch 'main' into sidepanel-remote-flag
ameliejyc Dec 2, 2025
4916d85
fix: problematic browser import
ameliejyc Dec 2, 2025
346dad3
fix: vault encryptor test
ameliejyc Dec 2, 2025
23c0f5d
Merge branch 'main' into sidepanel-remote-flag
hjetpoluru Dec 2, 2025
4b50616
chore: revert back isSidePanelEnabled code
ameliejyc Dec 2, 2025
cab7484
chore: remove unused import
ameliejyc Dec 2, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions app/manifest/v3/_base.json
Original file line number Diff line number Diff line change
Expand Up @@ -88,8 +88,7 @@
"webRequest",
"offscreen",
"identity",
"sidePanel",
"contextMenus"
"sidePanel"
],
"sandbox": {
"pages": ["snaps/index.html"]
Expand Down
23 changes: 0 additions & 23 deletions app/scripts/background.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@ import {
CorruptionHandler,
hasVault,
} from './lib/state-corruption/state-corruption-recovery';
import { initSidePanelContextMenu } from './lib/sidepanel-context-menu';
import {
backedUpStateKeys,
PersistenceManager,
Expand Down Expand Up @@ -183,7 +182,6 @@ const PHISHING_WARNING_PAGE_TIMEOUT = ONE_SECOND_IN_MILLISECONDS;

lazyListener.once('runtime', 'onInstalled').then((details) => {
handleOnInstalled(details);
handleSidePanelContextMenu();
});

/**
Expand Down Expand Up @@ -1663,15 +1661,6 @@ function onInstall() {
}
}

/**
* Handles the onInstalled event for sidepanel context menu creation.
* This is registered via lazyListener to catch the event at module load time.
*/
async function handleSidePanelContextMenu() {
await isInitialized;
await initSidePanelContextMenu(controller);
}

/**
* Trigger actions that should happen only when an update is available
*/
Expand Down Expand Up @@ -1749,18 +1738,6 @@ const initSidePanelBehavior = async () => {
openPanelOnActionClick: useSidePanelAsDefault,
});
}

// Setup remote feature flag listener to update sidepanel preferences
controller?.controllerMessenger?.subscribe(
'RemoteFeatureFlagController:stateChange',
(state) => {
const extensionUxSidepanel =
state?.remoteFeatureFlags?.extensionUxSidepanel;
if (extensionUxSidepanel === false) {
controller?.preferencesController?.setUseSidePanelAsDefault(false);
}
},
);
} catch (error) {
console.error('Error setting side panel behavior:', error);
}
Expand Down
63 changes: 0 additions & 63 deletions app/scripts/lib/sidepanel-context-menu.ts

This file was deleted.

4 changes: 2 additions & 2 deletions builds.yml
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ buildTypes:
- REJECT_INVALID_SNAPS_PLATFORM_VERSION: true
- IFRAME_EXECUTION_ENVIRONMENT_URL: https://execution.metamask.io/iframe/10.2.3/index.html
- ACCOUNT_SNAPS_DIRECTORY_URL: https://snaps.metamask.io/account-management
- IS_SIDEPANEL: false
- IS_SIDEPANEL: true
- EXTENSION_UX_PNA25: true
# for seedless onboarding (social login)
- GOOGLE_BETA_CLIENT_ID
Expand Down Expand Up @@ -140,7 +140,7 @@ buildTypes:
- SEGMENT_WRITE_KEY_REF: SEGMENT_FLASK_WRITE_KEY
- ACCOUNT_SNAPS_DIRECTORY_URL: https://metamask.github.io/snaps-directory-staging/main/account-management
- EIP_4337_ENTRYPOINT: '0x5FF137D4b0FDCD49DcA30c7CF57E578a026d2789'
- IS_SIDEPANEL: false
- IS_SIDEPANEL: true
- EXTENSION_UX_PNA25: true
# for seedless onboarding (social login)
- GOOGLE_FLASK_CLIENT_ID
Expand Down
3 changes: 1 addition & 2 deletions test/e2e/page-objects/flows/onboarding.flow.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,9 @@ import TermsOfUseUpdateModal from '../pages/dialog/terms-of-use-update-modal';
export const handleSidepanelPostOnboarding = async (
driver: Driver,
): Promise<void> => {
// Check if sidepanel is enabled via build configuration
// AND we're not running on Firefox (which doesn't support sidepanel)
const isSidepanelEnabled =
process.env.IS_SIDEPANEL === 'true' &&
process.env.IS_SIDEPANEL &&
process.env.SELENIUM_BROWSER !== Browser.FIREFOX;

if (isSidepanelEnabled) {
Expand Down
6 changes: 0 additions & 6 deletions ui/components/multichain/global-menu/global-menu.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import {
} from '../../../helpers/constants/routes';
import { isGatorPermissionsRevocationFeatureEnabled } from '../../../../shared/modules/environment';
import { getBrowserName } from '../../../../shared/modules/browser-runtime.utils';
import { useSidePanelEnabled } from '../../../hooks/useSidePanelEnabled';
import {
ENVIRONMENT_TYPE_POPUP,
PLATFORM_FIREFOX,
Expand Down Expand Up @@ -58,10 +57,6 @@ jest.mock('../../../store/actions', () => ({

jest.mock('../../../../shared/modules/environment');

jest.mock('../../../hooks/useSidePanelEnabled', () => ({
useSidePanelEnabled: jest.fn(() => false),
}));

jest.mock('../../../../app/scripts/lib/util', () => ({
...jest.requireActual('../../../../app/scripts/lib/util'),
getEnvironmentType: jest.fn(),
Expand Down Expand Up @@ -127,7 +122,6 @@ describe('Global Menu', () => {
);
jest.mocked(getBrowserName).mockReturnValue(PLATFORM_FIREFOX);
jest.mocked(getEnvironmentType).mockReturnValue(ENVIRONMENT_TYPE_POPUP);
jest.mocked(useSidePanelEnabled).mockReturnValue(true);

// @ts-expect-error mocking platform
global.platform = {
Expand Down
3 changes: 1 addition & 2 deletions ui/components/multichain/global-menu/global-menu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ import {
} from '../../../store/actions';
import { isGatorPermissionsRevocationFeatureEnabled } from '../../../../shared/modules/environment';
import { useI18nContext } from '../../../hooks/useI18nContext';
import { useSidePanelEnabled } from '../../../hooks/useSidePanelEnabled';
import {
selectIsMetamaskNotificationsEnabled,
selectIsMetamaskNotificationsFeatureSeen,
Expand Down Expand Up @@ -169,7 +168,7 @@ export const GlobalMenu = ({
const isSidePanelDefault = preferences?.useSidePanelAsDefault ?? false;

// Check if sidepanel feature is enabled (both build flag and LaunchDarkly flag)
const isSidePanelEnabled = useSidePanelEnabled();
const isSidePanelEnabled = process.env.IS_SIDEPANEL;

const showPriorityTag = useMemo(
() =>
Expand Down
27 changes: 0 additions & 27 deletions ui/hooks/useSidePanelEnabled.ts

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@ import {
setUseSidePanelAsDefault,
} from '../../../store/actions';
import { LottieAnimation } from '../../../components/component-library/lottie-animation';
import { useSidePanelEnabled } from '../../../hooks/useSidePanelEnabled';
import WalletReadyAnimation from './wallet-ready-animation';

export default function CreationSuccessful() {
Expand All @@ -67,7 +66,7 @@ export default function CreationSuccessful() {
);
const trackEvent = useContext(MetaMetricsContext);
const firstTimeFlowType = useSelector(getFirstTimeFlowType);
const isSidePanelEnabled = useSidePanelEnabled();
const isSidePanelEnabled = process.env.IS_SIDEPANEL;

const learnMoreLink =
'https://support.metamask.io/stay-safe/safety-in-web3/basic-safety-and-security-tips-for-metamask/';
Expand Down
4 changes: 1 addition & 3 deletions ui/pages/onboarding-flow/pin-extension/pin-extension.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ import {
} from '../../../../shared/constants/metametrics';
import { FirstTimeFlowType } from '../../../../shared/constants/onboarding';
import { getBrowserName } from '../../../../shared/modules/browser-runtime.utils';
import { useSidePanelEnabled } from '../../../hooks/useSidePanelEnabled';

export default function OnboardingPinExtension() {
const t = useI18nContext();
Expand All @@ -54,7 +53,6 @@ export default function OnboardingPinExtension() {
const trackEvent = useContext(MetaMetricsContext);
const firstTimeFlowType = useSelector(getFirstTimeFlowType);
const currentKeyring = useSelector(getCurrentKeyring);
const isSidePanelEnabled = useSidePanelEnabled();

const externalServicesOnboardingToggleState = useSelector(
getExternalServicesOnboardingToggleState,
Expand All @@ -76,7 +74,7 @@ export default function OnboardingPinExtension() {
});

// Side Panel - only if feature flag is enabled and not in test mode
if (isSidePanelEnabled) {
if (process.env.IS_SIDEPANEL) {
try {
if (browser?.sidePanel?.open) {
const tabs = await browser.tabs.query({
Expand Down
5 changes: 0 additions & 5 deletions ui/pages/onboarding-flow/pin-extension/pin-extension.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,6 @@ jest.mock('react-router-dom-v5-compat', () => {
};
});

// Mock the useSidePanelEnabled hook to control sidepanel feature flag
jest.mock('../../../hooks/useSidePanelEnabled', () => ({
useSidePanelEnabled: jest.fn(() => false),
}));

describe('Creation Successful Onboarding View', () => {
afterEach(() => {
jest.clearAllMocks();
Expand Down
Loading