refactor: Updated header for Settings - Contacts page #26243
Conversation
|
CLA Signature Action: All authors have signed the CLA. You may need to manually re-run the blocking PR check if it doesn't pass in a few minutes. |
f303770 to
51b82ae
Compare
…to header/settings-contacts
…k/metamask-mobile into header/settings-contacts
🔍 Smart E2E Test Selection
click to see 🤖 AI reasoning detailsE2E Test Selection:
The E2E tests that interact with Contacts view are:
The SmokeIdentity tests use This is a low-risk UI refactoring change. Selecting SmokeIdentity to verify the contact syncing flows still work correctly with the new header implementation. Performance Test Selection: |
|



Description
This PR aligns the Contacts screen with the inline header pattern by replacing the stack navbar with an inline
HeaderCompactStandardcomponent.Reason for change: The Contacts screen used
getNavigationOptionsTitleandnavigation.setOptions()incomponentDidMount/componentDidUpdateto configure the stack header. Migrating to an inline header matches the app-wide header approach (seedocs/header-alignment-plans.md) and keeps the Contacts Settings subpage consistent with other screens that useHeaderCompactStandard(e.g. General Settings, main Settings view).What changed:
ContactsSettingsscreen now usesoptions={{ headerShown: false }}so the stack header is hidden and the header is fully inline.HeaderCompactStandardat the top with titlestrings('app_settings.contacts_title'), back button callingnavigation.goBack(), andincludesTopInset. Removed thegetNavigationOptionsTitleimport and allupdateNavBarlogic (including fromcomponentDidMountandcomponentDidUpdate). RemovedmarginTop: 16from the wrapper style so the header sits at the top. The page remains wrapped inSafeAreaViewwithedges={{ bottom: 'additive' }}.renderScreenfor full rendering with navigation. Added tests for: inline header presence (viaContactsViewSelectorIDs.HEADER), "Contacts" title, and back button press. AddedHEADERtoContactsView.testIds.tsand passedtestIDtoHeaderCompactStandard. Updated snapshot.User-visible behavior (back button, title, safe area) is unchanged; the header is now rendered inline.
Changelog
This PR is not end-user-facing (internal header implementation; same UI/UX, header is now inline).
CHANGELOG entry: null
Related issues
Fixes: https://consensyssoftware.atlassian.net/jira/software/c/projects/DSYS/boards/1888?selectedIssue=DSYS-355
Manual testing steps
Screenshots/Recordings
Before
After
Simulator.Screen.Recording.-.iPhone.15.Pro.Max.-.2026-02-18.at.15.23.39.mov
Pre-merge author checklist
Pre-merge reviewer checklist
Note
Low Risk
UI/navigation presentation refactor limited to the Contacts settings screen plus test updates; no new data handling or auth logic, with low regression risk mainly around header/back behavior and spacing.
Overview
Updates the Settings
Contactsscreen to use an inlineHeaderCompactStandardinstead of configuring the stack header vianavigation.setOptions, and hides the stack header forContactsSettings(headerShown: false). This also adjusts layout spacing (removes the wrapper top margin) and adds stable test IDs for the new header/back button.Reworks the Contacts tests from Enzyme shallow rendering to React Navigation + Testing Library (
renderScreen/renderWithProvider), adding coverage for header title rendering and back navigation, and updates the snapshot accordingly.Written by Cursor Bugbot for commit eb56dd2. This will update automatically on new commits. Configure here.