Skip to content

Commit 0232dd7

Browse files
authored
chore: remove importSrpWordSuggestion remote config flag (MetaMask#28139)
<!-- Please submit this PR as a draft initially. Do not mark it as "Ready for review" until the template has been completely filled out, and PR status checks have passed at least once. --> ## **Description** * Removes the `importSrpWordSuggestion` remote flag and all code that read it. The BIP39 word-suggestion bar experiment is complete, so the app no longer depends on remote config flag for that UI. * Jra: https://consensyssoftware.atlassian.net/browse/TO-647 <!-- Write a short description of the changes included in this pull request, also include relevant motivation and context. Have in mind the following questions: 1. What is the reason for the change? 2. What is the improvement/solution? --> ## **Changelog** <!-- If this PR is not End-User-Facing and should not show up in the CHANGELOG, you can choose to either: 1. Write `CHANGELOG entry: null` 2. Label with `no-changelog` If this PR is End-User-Facing, please write a short User-Facing description in the past tense like: `CHANGELOG entry: Added a new tab for users to see their NFTs` `CHANGELOG entry: Fixed a bug that was causing some NFTs to flicker` (This helps the Release Engineer do their job more quickly and accurately) --> CHANGELOG entry: Import SRP screens always show BIP39 word suggestions when the keyboard is open, with no remote feature flag ## **Related issues** Fixes: ## **Manual testing steps** ```gherkin Feature: Import SRP BIP39 word suggestions bar Scenario: Onboarding import wallet shows word suggestions while typing SRP Given the user is on Import from SRP And the keyboard is open When the user types partial words in the SRP field Then BIP39 word suggestions are shown and can be selected Scenario: Import new SRP (multi-SRP) shows word suggestions while typing Given the user is on Import New SRP And the keyboard is open When the user types partial words in the SRP field Then BIP39 word suggestions are shown and can be selected ``` ## **Screenshots/Recordings** <!-- If applicable, add screenshots and/or recordings to visualize the before and after of your change. --> ### **Before** <!-- [screenshots/recordings] --> ### **After** https://github.com/user-attachments/assets/8426a0a8-11d6-4f24-8eb6-b98208f584af https://github.com/user-attachments/assets/11bf056f-a203-4fd1-a90c-27fa27982d76 <!-- [screenshots/recordings] --> ## **Pre-merge author checklist** - [x] I've followed [MetaMask Contributor Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask Mobile Coding Standards](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/CODING_GUIDELINES.md). - [x] I've completed the PR template to the best of my ability - [x] I've included tests if applicable - [x] I've documented my code using [JSDoc](https://jsdoc.app/) format if applicable - [x] I've applied the right labels on the PR (see [labeling guidelines](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/LABELING_GUIDELINES.md)). Not required for external contributors. ## **Pre-merge reviewer checklist** - [ ] I've manually tested the PR (e.g. pull and build branch, run the app, test code being changed). - [ ] I confirm that this PR addresses all acceptance criteria described in the ticket it closes and includes the necessary testing evidence such as recordings and or screenshots. <!-- CURSOR_SUMMARY --> --- > [!NOTE] > **Medium Risk** > Moderate risk because it changes onboarding wallet-import UI behavior and removes a remote kill-switch, but the logic change is small and localized to SRP import screens and flag plumbing. > > **Overview** > Removes the `importSrpWordSuggestion` remote feature flag end-to-end (feature flag enum entry, selector implementation + tests, and registry entry). > > Updates both SRP import flows (`ImportFromSecretRecoveryPhrase` and `ImportNewSecretRecoveryPhrase`) to *always* render `SrpWordSuggestions` when the keyboard is visible (and on step 0 where applicable), and drops the associated feature-flag mocks from the screen tests. > > <sup>Written by [Cursor Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit 24f7f6a. Configure [here](https://cursor.com/dashboard?tab=bugbot).</sup> <!-- /CURSOR_SUMMARY -->
1 parent 88afe15 commit 0232dd7

8 files changed

Lines changed: 15 additions & 307 deletions

File tree

app/components/Views/ImportFromSecretRecoveryPhrase/index.js

Lines changed: 14 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ import {
1515
Platform,
1616
} from 'react-native';
1717
import { SafeAreaView } from 'react-native-safe-area-context';
18-
import { connect, useSelector } from 'react-redux';
18+
import { connect } from 'react-redux';
1919
import {
2020
KeyboardAwareScrollView,
2121
KeyboardProvider,
@@ -96,7 +96,6 @@ import {
9696
import { v4 as uuidv4 } from 'uuid';
9797
import SrpInputGrid from '../../UI/SrpInputGrid';
9898
import SrpWordSuggestions from '../../UI/SrpWordSuggestions';
99-
import { selectImportSrpWordSuggestionEnabledFlag } from '../../../selectors/featureFlagController/importSrpWordSuggestion';
10099

101100
const SCREEN_WIDTH = Dimensions.get('window').width;
102101

@@ -137,11 +136,6 @@ const ImportFromSecretRecoveryPhrase = ({
137136
const slideAnim = useRef(new Animated.Value(0)).current;
138137
const [currentInputWord, setCurrentInputWord] = useState('');
139138

140-
// Feature flag for SRP word suggestions
141-
const isSrpWordSuggestionsEnabled = useSelector(
142-
selectImportSrpWordSuggestionEnabledFlag,
143-
);
144-
145139
const isKeyboardVisible = useKeyboardState((state) => state.isVisible);
146140

147141
const { fetchAccountsWithActivity } = useAccountsWithNetworkActivitySync({
@@ -845,21 +839,19 @@ const ImportFromSecretRecoveryPhrase = ({
845839
</Button>
846840
</Box>
847841
)}
848-
{isSrpWordSuggestionsEnabled &&
849-
currentStep === 0 &&
850-
isKeyboardVisible && (
851-
<KeyboardStickyView
852-
offset={{ closed: 0, opened: 0 }}
853-
style={tw.style('absolute bottom-0 left-0 right-0')}
854-
>
855-
<SrpWordSuggestions
856-
currentInputWord={currentInputWord}
857-
onSuggestionSelect={(word) => {
858-
srpInputGridRef.current?.handleSuggestionSelect(word);
859-
}}
860-
/>
861-
</KeyboardStickyView>
862-
)}
842+
{currentStep === 0 && isKeyboardVisible && (
843+
<KeyboardStickyView
844+
offset={{ closed: 0, opened: 0 }}
845+
style={tw.style('absolute bottom-0 left-0 right-0')}
846+
>
847+
<SrpWordSuggestions
848+
currentInputWord={currentInputWord}
849+
onSuggestionSelect={(word) => {
850+
srpInputGridRef.current?.handleSuggestionSelect(word);
851+
}}
852+
/>
853+
</KeyboardStickyView>
854+
)}
863855
<ScreenshotDeterrent enabled isSRP />
864856
</SafeAreaView>
865857
);

app/components/Views/ImportFromSecretRecoveryPhrase/index.test.tsx

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -94,13 +94,6 @@ const initialState = {
9494
},
9595
};
9696

97-
jest.mock(
98-
'../../../selectors/featureFlagController/importSrpWordSuggestion',
99-
() => ({
100-
selectImportSrpWordSuggestionEnabledFlag: () => true,
101-
}),
102-
);
103-
10497
const mockIsEnabled = jest.fn().mockReturnValue(true);
10598

10699
jest.mock('../../hooks/useAnalytics/useAnalytics', () => {

app/components/Views/ImportNewSecretRecoveryPhrase/index.test.tsx

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -141,14 +141,6 @@ const initialState = {
141141
},
142142
};
143143

144-
// Mock the feature flag selector to return true
145-
jest.mock(
146-
'../../../selectors/featureFlagController/importSrpWordSuggestion',
147-
() => ({
148-
selectImportSrpWordSuggestionEnabledFlag: () => true,
149-
}),
150-
);
151-
152144
describe('ImportNewSecretRecoveryPhrase', () => {
153145
afterEach(() => {
154146
jest.clearAllMocks();

app/components/Views/ImportNewSecretRecoveryPhrase/index.tsx

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,6 @@ import Logger from '../../../util/Logger';
5353
import { v4 as uuidv4 } from 'uuid';
5454
import SrpInputGrid, { SrpInputGridRef } from '../../UI/SrpInputGrid';
5555
import SrpWordSuggestions from '../../UI/SrpWordSuggestions';
56-
import { selectImportSrpWordSuggestionEnabledFlag } from '../../../selectors/featureFlagController/importSrpWordSuggestion';
5756
import { isSRPLengthValid, SPACE_CHAR } from '../../../util/srp/srpInputUtils';
5857
import {
5958
validateSRP,
@@ -78,11 +77,6 @@ const ImportNewSecretRecoveryPhrase = () => {
7877
const [error, setError] = useState('');
7978
const [currentInputWord, setCurrentInputWord] = useState('');
8079

81-
// Feature flag for SRP word suggestions
82-
const isSrpWordSuggestionsEnabled = useSelector(
83-
selectImportSrpWordSuggestionEnabledFlag,
84-
);
85-
8680
const isKeyboardVisible = useKeyboardState((state) => state.isVisible);
8781

8882
const hdKeyrings = useSelector(selectHDKeyrings);
@@ -329,7 +323,7 @@ const ImportNewSecretRecoveryPhrase = () => {
329323
{strings('import_new_secret_recovery_phrase.cta_text')}
330324
</Button>
331325
</Box>
332-
{isSrpWordSuggestionsEnabled && isKeyboardVisible && (
326+
{isKeyboardVisible && (
333327
<KeyboardStickyView
334328
offset={{ closed: 0, opened: 0 }}
335329
style={tw.style('absolute bottom-0 left-0 right-0')}

app/constants/featureFlags.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ export enum FeatureFlagNames {
1010
otaUpdatesEnabled = 'otaUpdatesEnabled',
1111
rewardsEnableMusdHolding = 'rewardsEnableMusdHolding',
1212
fullPageAccountList = 'fullPageAccountList',
13-
importSrpWordSuggestion = 'importSrpWordSuggestion',
1413
assetsDefiPositionsEnabled = 'assetsDefiPositionsEnabled',
1514
tokenDetailsV2Buttons = 'tokenDetailsV2Buttons',
1615
tokenDetailsV2ButtonLayout = 'tokenDetailsV2ButtonLayout',

app/selectors/featureFlagController/importSrpWordSuggestion/index.test.ts

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

app/selectors/featureFlagController/importSrpWordSuggestion/index.ts

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

0 commit comments

Comments
 (0)