Skip to content

chore: Updated headers for settings general page#25356

Merged
brianacnguyen merged 3 commits intomainfrom
header/settings-general
Jan 30, 2026
Merged

chore: Updated headers for settings general page#25356
brianacnguyen merged 3 commits intomainfrom
header/settings-general

Conversation

@brianacnguyen
Copy link
Copy Markdown
Contributor

@brianacnguyen brianacnguyen commented Jan 29, 2026

Description

This PR updates the General Settings page and SelectComponent modal to use the HeaderCenter component for consistent header styling across the app.

Changes:

  1. GeneralSettings page: Replaced the dynamic navigation header (getNavigationOptionsTitle) with an inline HeaderCenter component, following the pattern established in the parent Settings page
  2. Navigation config: Set headerShown: false at the stack level for GeneralSettings screens in MainNavigator.js
  3. SafeAreaView: Wrapped GeneralSettings content in SafeAreaView for proper safe area handling
  4. SelectComponent modal: Updated the "Base currency" (and other select) modal header to use HeaderCenter with a close button

Changelog

CHANGELOG entry: Updated General Settings page and select modal headers to use consistent HeaderCenter component styling

Related issues

Fixes: https://consensyssoftware.atlassian.net/jira/software/c/projects/MDP/boards/2972?assignee=62afb43d33a882e2be47c36f&quickFilter=3325&selectedIssue=MDP-697

Manual testing steps

Feature: General Settings Header

  Scenario: User navigates to General Settings
    Given the user is on the Settings page

    When user taps on "General"
    Then the General Settings page opens with a centered "General" title header
    And a back arrow button is visible on the left

  Scenario: User opens currency selector modal
    Given the user is on the General Settings page

    When user taps on the currency dropdown
    Then a modal opens with "Base currency" as the centered title
    And a close (X) button is visible on the right
    When user taps the close button
    Then the modal closes

Screenshots/Recordings

Before

After

Simulator.Screen.Recording.-.iPhone.15.Pro.Max.-.2026-01-28.at.17.22.54.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
Low risk UI/navigation refactor that mainly changes header rendering and related tests; minimal impact to underlying settings behavior.

Overview
Unifies header UI for General Settings and select modals. GeneralSettings now renders its own HeaderCenter (wrapped in SafeAreaView) instead of configuring a React Navigation header, and MainNavigator forces headerShown: false for GeneralSettings screens.

SelectComponent’s modal header is replaced with HeaderCenter (adds close button handling). Tests were migrated from Enzyme to Testing Library and snapshots updated to reflect the new header structure and navigation interactions.

Written by Cursor Bugbot for commit 95f4c98. This will update automatically on new commits. Configure here.

@brianacnguyen brianacnguyen self-assigned this Jan 29, 2026
@brianacnguyen brianacnguyen added the No QA Needed Apply this label when your PR does not need any QA effort. label Jan 29, 2026
@brianacnguyen brianacnguyen requested a review from a team as a code owner January 29, 2026 01:26
@brianacnguyen brianacnguyen added the team-design-system All issues relating to design system in Mobile label Jan 29, 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.

onBack={() => navigation.goBack()}
includesTopInset
/>
<ScrollView style={styles.content}>
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Nothing changed below this line. just indentation changes messing up with git dif

@github-actions github-actions bot added size-L and removed size-M labels Jan 30, 2026
@github-actions
Copy link
Copy Markdown
Contributor

🔍 Smart E2E Test Selection

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

E2E Test Selection:
The changes are primarily UI/UX refactoring for the GeneralSettings screen and SelectComponent modal:

  1. GeneralSettings/index.js: Refactored to use SafeAreaView and HeaderCenter component instead of navigation-managed header. The component now manages its own header with headerShown: false in the navigator.

  2. SelectComponent/index.js: Replaced custom accessory bar with HeaderCenter component for the modal picker. This component is only used within GeneralSettings.

  3. MainNavigator.js: Changed GeneralSettings navigation options to { headerShown: false } since the component now manages its own header.

  4. Test files: Updated unit tests from enzyme to React Testing Library with new test cases.

Why no E2E tags needed:

  • No E2E tests directly test the GeneralSettings screen functionality (currency conversion, language selection, search engine, etc.)
  • The SelectComponent is only used within GeneralSettings
  • The changes don't affect the main Settings view navigation or other Settings sub-screens
  • Tests that navigate through Settings (SmokeIdentity, FlaskBuildTests) go to other sub-screens like Contacts, BackupAndSync, or Snaps - not GeneralSettings
  • The navigation structure remains the same; only the header rendering approach changed
  • These are purely visual/layout changes with no functional impact on tested flows

Performance Test Selection:
The changes are UI refactoring for the GeneralSettings screen and SelectComponent modal. They involve layout restructuring (SafeAreaView, HeaderCenter) and style changes, but don't affect: (1) list rendering performance, (2) data loading or state management, (3) app startup/initialization, (4) critical user flows like login, swaps, or sends. The GeneralSettings screen is not a performance-critical path and the changes are primarily about header management and layout structure, not rendering performance.

View GitHub Actions results

Copy link
Copy Markdown

@cursor cursor bot left a comment

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.

it('renders header with correct title', () => {
const { getByText } = renderComponent();
expect(getByText('General')).toBeTruthy();
});
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Test uses weak matcher for element presence assertion

Low Severity · Bugbot Rules

The new test 'renders header with correct title' uses toBeTruthy() to assert element presence. This violates the testing guidelines which state: "Do not use weak matchers like toBeDefined or toBeTruthy to assert element presence. Use toBeOnTheScreen()." The assertion on line 88 expect(getByText('General')).toBeTruthy() needs to use toBeOnTheScreen() instead.

Fix in Cursor Fix in Web

@codecov-commenter
Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 25.00000% with 3 lines in your changes missing coverage. Please review.
✅ Project coverage is 80.29%. Comparing base (93cc2a9) to head (95f4c98).
⚠️ Report is 86 commits behind head on main.

Files with missing lines Patch % Lines
...components/Views/Settings/GeneralSettings/index.js 25.00% 3 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main   #25356      +/-   ##
==========================================
+ Coverage   80.06%   80.29%   +0.22%     
==========================================
  Files        4278     4263      -15     
  Lines      110125   109955     -170     
  Branches    23093    23418     +325     
==========================================
+ Hits        88172    88287     +115     
+ Misses      15827    15480     -347     
- Partials     6126     6188      +62     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@sonarqubecloud
Copy link
Copy Markdown

@brianacnguyen brianacnguyen added this pull request to the merge queue Jan 30, 2026
Merged via the queue into main with commit 62ccea0 Jan 30, 2026
58 checks passed
@brianacnguyen brianacnguyen deleted the header/settings-general branch January 30, 2026 16:41
@github-actions github-actions bot locked and limited conversation to collaborators Jan 30, 2026
@metamaskbot metamaskbot added the release-7.65.0 Issue or pull request that will be included in release 7.65.0 label Jan 30, 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. release-7.65.0 Issue or pull request that will be included in release 7.65.0 size-L team-design-system All issues relating to design system in Mobile

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants