Skip to content

Commit 28feee7

Browse files
committed
refactor(settings): remove account menu feature flag and related code
1 parent 603886d commit 28feee7

15 files changed

Lines changed: 194 additions & 1279 deletions

File tree

.github/scripts/known-feature-flag-constants.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ const FILE_SOURCES: Array<{ key: string; file: string; exportName: string }> = [
1313
{ key: 'TRON_REWARDS_FLAG_NAME', file: REWARDS_FILE, exportName: 'TRON_REWARDS_FLAG_NAME' },
1414
{ key: 'SNAPSHOTS_REWARDS_FLAG_NAME', file: REWARDS_FILE, exportName: 'SNAPSHOTS_REWARDS_FLAG_NAME' },
1515
{ key: 'MISSING_ENROLLED_ACCOUNTS_FLAG_NAME', file: REWARDS_FILE, exportName: 'MISSING_ENROLLED_ACCOUNTS_FLAG_NAME' },
16-
{ key: 'ACCOUNT_MENU_FLAG_KEY', file: sel('accountMenu'), exportName: 'ACCOUNT_MENU_FLAG_KEY' },
1716
{ key: 'NETWORK_MANAGEMENT_FLAG_KEY', file: sel('networkManagement'), exportName: 'NETWORK_MANAGEMENT_FLAG_KEY' },
1817
// FEATURE_FLAG_NAME is omitted (non-unique across rwa / gasFeesSponsored); per-file fallback handles it.
1918
{ key: 'OTA_UPDATES_FLAG_NAME', file: sel('otaUpdates'), exportName: 'OTA_UPDATES_FLAG_NAME' },

app/component-library/components/Navigation/TabBar/TabBar.test.tsx

Lines changed: 2 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ import { backgroundState } from '../../../../util/test/initial-root-state';
1515
import TabBar from './TabBar';
1616
import { TabBarIconKey, ExtendedBottomTabDescriptor } from './TabBar.types';
1717
import Routes from '../../../../constants/navigation/Routes';
18-
import { useAccountMenuEnabled } from '../../../../selectors/featureFlagController/accountMenu/useAccountMenuEnabled';
1918

2019
// Minimal descriptor interface for tests - only includes what TabBar component uses
2120
interface TestTabDescriptor {
@@ -30,14 +29,6 @@ interface TestDescriptors {
3029
[key: string]: TestTabDescriptor;
3130
}
3231

33-
// Mock account menu feature flag hook
34-
jest.mock(
35-
'../../../../selectors/featureFlagController/accountMenu/useAccountMenuEnabled',
36-
() => ({
37-
useAccountMenuEnabled: jest.fn(() => false),
38-
}),
39-
);
40-
4132
// Mock the navigation object with proper typing
4233
const navigation: NavigationHelpers<ParamListBase> = {
4334
navigate: jest.fn(),
@@ -129,10 +120,7 @@ describe('TabBar', () => {
129120
expect(toJSON()).toMatchSnapshot();
130121
});
131122

132-
it('navigates to the correct screen when a tab is pressed and account menu is disabled', () => {
133-
// Explicitly disable the account menu feature flag for this test
134-
jest.mocked(useAccountMenuEnabled).mockReturnValue(false);
135-
123+
it('navigates to the correct screen when a tab is pressed', () => {
136124
const { getByTestId } = renderWithProvider(
137125
<TabBar
138126
state={state as TabNavigationState<ParamListBase>}
@@ -168,7 +156,7 @@ describe('TabBar', () => {
168156

169157
fireEvent.press(getByTestId(`tab-bar-item-${TabBarIconKey.Setting}`));
170158
expect(navigation.navigate).toHaveBeenCalledWith(Routes.SETTINGS_VIEW, {
171-
screen: 'Settings',
159+
screen: Routes.ACCOUNTS_MENU_VIEW,
172160
});
173161
});
174162

@@ -230,23 +218,4 @@ describe('TabBar', () => {
230218
fireEvent.press(getByTestId(`tab-bar-item-${TabBarIconKey.Trending}`));
231219
expect(navigation.navigate).toHaveBeenCalledWith(Routes.TRENDING_VIEW);
232220
});
233-
234-
it('navigates to Accounts Menu when settings tab is pressed and account menu is enabled', () => {
235-
// Enable the account menu feature flag for this test
236-
jest.mocked(useAccountMenuEnabled).mockReturnValue(true);
237-
238-
const { getByTestId } = renderWithProvider(
239-
<TabBar
240-
state={state as TabNavigationState<ParamListBase>}
241-
descriptors={descriptors as Record<string, ExtendedBottomTabDescriptor>}
242-
navigation={navigation}
243-
/>,
244-
{ state: mockInitialState },
245-
);
246-
247-
fireEvent.press(getByTestId(`tab-bar-item-${TabBarIconKey.Setting}`));
248-
expect(navigation.navigate).toHaveBeenCalledWith(Routes.SETTINGS_VIEW, {
249-
screen: Routes.ACCOUNTS_MENU_VIEW,
250-
});
251-
});
252221
});

app/component-library/components/Navigation/TabBar/TabBar.tsx

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ import {
2828
LABEL_BY_TAB_BAR_ICON_KEY,
2929
} from './TabBar.constants';
3030
import { selectChainId } from '../../../../selectors/networkController';
31-
import { useAccountMenuEnabled } from '../../../../selectors/featureFlagController/accountMenu/useAccountMenuEnabled';
3231

3332
const FILLED_ICONS: Partial<Record<TabBarIconKey, IconName>> = {
3433
[TabBarIconKey.Wallet]: IconName.HomeFilled,
@@ -41,7 +40,6 @@ const TabBar = ({ state, descriptors, navigation }: TabBarProps) => {
4140
const { trackEvent, createEventBuilder } = useMetrics();
4241
const { bottom: bottomInset } = useSafeAreaInsets();
4342
const chainId = useSelector(selectChainId);
44-
const isAccountMenuEnabled = useAccountMenuEnabled();
4543
const tabBarRef = useRef(null);
4644
const previousTabIndexRef = useRef<number>(state.index);
4745
const tw = useTailwind();
@@ -107,9 +105,7 @@ const TabBar = ({ state, descriptors, navigation }: TabBarProps) => {
107105
break;
108106
case Routes.SETTINGS_VIEW:
109107
navigation.navigate(Routes.SETTINGS_VIEW, {
110-
screen: isAccountMenuEnabled
111-
? Routes.ACCOUNTS_MENU_VIEW
112-
: 'Settings',
108+
screen: Routes.ACCOUNTS_MENU_VIEW,
113109
});
114110
break;
115111
case Routes.TRENDING_VIEW:
@@ -146,7 +142,6 @@ const TabBar = ({ state, descriptors, navigation }: TabBarProps) => {
146142
trackEvent,
147143
createEventBuilder,
148144
tw,
149-
isAccountMenuEnabled,
150145
],
151146
);
152147

0 commit comments

Comments
 (0)