Skip to content

refactor: Updated header for Settings - Contacts page #26243

Merged
brianacnguyen merged 11 commits into
mainfrom
header/settings-contacts
Feb 20, 2026
Merged

refactor: Updated header for Settings - Contacts page #26243
brianacnguyen merged 11 commits into
mainfrom
header/settings-contacts

Conversation

@brianacnguyen

@brianacnguyen brianacnguyen commented Feb 18, 2026

Copy link
Copy Markdown
Contributor

Description

This PR aligns the Contacts screen with the inline header pattern by replacing the stack navbar with an inline HeaderCompactStandard component.

Reason for change: The Contacts screen used getNavigationOptionsTitle and navigation.setOptions() in componentDidMount / componentDidUpdate to configure the stack header. Migrating to an inline header matches the app-wide header approach (see docs/header-alignment-plans.md) and keeps the Contacts Settings subpage consistent with other screens that use HeaderCompactStandard (e.g. General Settings, main Settings view).

What changed:

  1. MainNavigator – The ContactsSettings screen now uses options={{ headerShown: false }} so the stack header is hidden and the header is fully inline.
  2. Contacts – Renders inline HeaderCompactStandard at the top with title strings('app_settings.contacts_title'), back button calling navigation.goBack(), and includesTopInset. Removed the getNavigationOptionsTitle import and all updateNavBar logic (including from componentDidMount and componentDidUpdate). Removed marginTop: 16 from the wrapper style so the header sits at the top. The page remains wrapped in SafeAreaView with edges={{ bottom: 'additive' }}.
  3. Tests – Switched from Enzyme shallow render to renderScreen for full rendering with navigation. Added tests for: inline header presence (via ContactsViewSelectorIDs.HEADER), "Contacts" title, and back button press. Added HEADER to ContactsView.testIds.ts and passed testID to HeaderCompactStandard. 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

Feature: Contacts inline header

  Scenario: user opens Contacts from Settings
    Given the app is open and the user is on the main Settings screen

    When the user taps "Contacts"
    Then the Contacts screen is shown with a header that displays "Contacts" and a back arrow on the left

    When the user taps the back arrow
    Then the app navigates back to the main Settings screen

  Scenario: safe area and content layout
    Given the user is on the Contacts screen

    When the screen is displayed
    Then the header sits below the status bar (safe area respected)
    And the contact list and "Add contact" button are visible and not covered by the header

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

  • 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.

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 Contacts screen to use an inline HeaderCompactStandard instead of configuring the stack header via navigation.setOptions, and hides the stack header for ContactsSettings (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.

@brianacnguyen brianacnguyen self-assigned this Feb 18, 2026
@brianacnguyen brianacnguyen requested a review from a team as a code owner February 18, 2026 19:17
@brianacnguyen brianacnguyen added No QA Needed Apply this label when your PR does not need any QA effort. team-design-system All issues relating to design system in Mobile no-changelog no-changelog Indicates no external facing user changes, therefore no changelog documentation needed labels Feb 18, 2026
@github-actions

Copy link
Copy Markdown
Contributor

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.

Comment thread app/components/Views/Settings/Contacts/ContactForm/index.js Outdated
Comment thread app/components/Views/Settings/Contacts/index.test.tsx Outdated
Comment thread app/components/Views/Settings/Contacts/ContactForm/index.js Outdated
@brianacnguyen brianacnguyen force-pushed the header/settings-contacts branch from f303770 to 51b82ae Compare February 18, 2026 23:31
@brianacnguyen brianacnguyen changed the title refactor: Updated headers for settings contacts flow refactor: Updated header for Settings - Contacts page Feb 18, 2026
@github-actions github-actions Bot added size-S and removed size-M labels Feb 18, 2026
Comment thread app/components/Views/Settings/Contacts/index.test.tsx
Comment thread app/components/Views/Settings/Contacts/index.test.tsx Outdated
@github-actions github-actions Bot added size-M and removed size-S labels Feb 18, 2026
Comment thread app/components/Views/Settings/Contacts/index.test.tsx
Comment thread app/components/Views/Settings/Contacts/index.test.tsx Outdated
@github-actions

Copy link
Copy Markdown
Contributor

🔍 Smart E2E Test Selection

  • Selected E2E tags: SmokeIdentity
  • Selected Performance tags: None (no tests recommended)
  • Risk Level: low
  • AI Confidence: 85%
click to see 🤖 AI reasoning details

E2E Test Selection:
The changes are a UI refactoring of the Contacts Settings view to use an inline HeaderCompactStandard component instead of navigation-based header options. The key changes are:

  1. MainNavigator.js: Changed ContactsSettings screen to use headerShown: false instead of Contacts.navigationOptions
  2. Contacts/index.js: Added inline HeaderCompactStandard component with back button, removed updateNavBar method
  3. Added new test IDs for the header and back button
  4. Updated unit tests to use React Testing Library instead of enzyme

The E2E tests that interact with Contacts view are:

  • SmokeIdentity tests (contact-sync-toggle.spec.ts, sync-users-contacts.spec.ts) - These test contact syncing functionality and navigate to the Contacts view
  • RegressionWalletPlatform tests (addressbook-*.spec.ts) - These are regression tests, not smoke tests

The SmokeIdentity tests use ContactsView.container and ContactsView.addButton selectors which remain unchanged. The navigation to contacts via SettingsView.tapContacts() should still work. The HeaderCompactStandard component is already widely used across the app and is well-tested.

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:
This change is a UI refactoring of the Contacts Settings view header. It replaces navigation-based header with an inline HeaderCompactStandard component. The change does not affect: app startup/launch, account list rendering, login performance, swap flows, asset loading, or any performance-critical paths. The HeaderCompactStandard component is already used throughout the app and this is simply adopting it in the Contacts view. No performance tests are needed.

View GitHub Actions results

@cursor cursor Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Comment thread app/components/Views/Settings/Contacts/index.test.tsx
@sonarqubecloud

Copy link
Copy Markdown

@brianacnguyen brianacnguyen added this pull request to the merge queue Feb 19, 2026
Merged via the queue into main with commit 8f351a4 Feb 20, 2026
99 checks passed
@brianacnguyen brianacnguyen deleted the header/settings-contacts branch February 20, 2026 00:12
@github-actions github-actions Bot locked and limited conversation to collaborators Feb 20, 2026
@metamaskbot metamaskbot added the release-7.68.0 Issue or pull request that will be included in release 7.68.0 label Feb 20, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

No QA Needed Apply this label when your PR does not need any QA effort. no-changelog no-changelog Indicates no external facing user changes, therefore no changelog documentation needed release-7.68.0 Issue or pull request that will be included in release 7.68.0 size-M team-design-system All issues relating to design system in Mobile

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants