MetaMask / MetaMask/metamask-mobile
Remove dead "Show hex data" setting from Advanced Settings
- Dominant language
- TypeScript
- Stars
- 3k
- Forks
- 1.7k
- Avg merge
- 1d 14h
- Merged PRs (30d)
- 669
Description
## **Description**
The "Show hex data" toggle in Advanced Settings (`app/components/Views/Settings/AdvancedSettings/index.js`) is dead code. The setting value (`state.settings.showHexData`) is no longer read by any component in the app, so toggling it has no effect.
The consumers were removed in:
- **PR #24476** — removed the legacy send flow that read `showHexData` to conditionally show a hex data input
- **PR #24929** — removed the legacy confirmation view that read `showHexData` to conditionally show a hex data modal
The redesigned confirmation views do not use this setting.
## **Technical Details**
The following dead code should be removed:
- **Settings toggle:** `app/components/Views/Settings/AdvancedSettings/index.js` — remove the `showHexData` prop, the `SettingsRow` for "Show hex data", and the `mapStateToProps`/`mapDispatchToProps` wiring
- **Action creator:** `app/actions/settings/index.js` — remove `setShowHexData`
- **Reducer:** `app/reducers/settings/index.js` — remove the `SET_SHOW_HEX_DATA` case
- **Locale strings:** remove `app_settings.show_hex_data` and `app_settings.hex_desc` from all locale files
- **Test/mock references:** update `AdvancedSettings/index.test.tsx` and `Perps/__mocks__/perpsStateMock.ts`
## **Threat Modeling Framework**
- **What are we working on?** Removing dead UI and code that no longer has any effect.
- **What can go wrong?** Very low risk — the setting is already unused. The only concern is ensuring no other code path reads `showHexData` (confirmed: none do).
- **What are we going to do about it?** Remove all references and verify tests pass.
- **Did we do a good job?** Verify the toggle is gone from Advanced Settings and no regressions in settings or confirmation flows.
## **Acceptance Criteria**
- [ ] The "Show hex data" toggle is removed from Advanced Settings
- [ ] The `showHexData` Redux state, action, and reducer are removed
- [ ] Related locale strings are removed from all language files
- [ ] Tests and mocks are updated accordingly
- [ ] No regressions in Advanced Settings or confirmation flows
## **References**
- PR #24476 — `fix: Remove legacy send flow, components and tests`
- PR #24929 — `chore: remove legacy confirmation code`
- Files to clean up:
- `app/components/Views/Settings/AdvancedSettings/index.js`
- `app/actions/settings/index.js`
- `app/reducers/settings/index.js`
- `app/components/Views/Settings/AdvancedSettings/index.test.tsx`
- `app/components/UI/Perps/__mocks__/perpsStateMock.ts`
- `locales/languages/*.json` (all locale files)
Contributor guide
Research direction
Start by searching for showHexData and read the listed AdvancedSettings component, settings action and reducer, test, mock, and locale files. Run AdvancedSettings/index.test.tsx after removing the toggle and related references; done means no showHexData references remain and the settings and confirmation-flow tests pass.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- react-native, typescript
- Domain
- frontend, mobile
- Issue type
- Refactor
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 58/100