Skip to content

chore: Added HeaderRoot to components-temp#26745

Merged
brianacnguyen merged 7 commits into
mainfrom
update/header-root
Mar 3, 2026
Merged

chore: Added HeaderRoot to components-temp#26745
brianacnguyen merged 7 commits into
mainfrom
update/header-root

Conversation

@brianacnguyen

@brianacnguyen brianacnguyen commented Mar 2, 2026

Copy link
Copy Markdown
Contributor

Description

This PR adds a new HeaderRoot component in app/component-library/components-temp/.

Reason for change: HeaderRoot provides a header layout with base styles similar to HeaderBase, a left section that renders either custom children or a title row (TitleStandard-style), and an end section with the same end content behavior as HeaderBase (endAccessory or endButtonIconProps).

What changed:

  1. New component: HeaderRoot

    • Location: app/component-library/components-temp/HeaderRoot/
    • Files:
      • HeaderRoot.tsx – main component (View root with base styles; left section flex-1 items-start with either children or title row; end section with endAccessory or reversed endButtonIconProps)
      • HeaderRoot.types.tsHeaderRootProps (children, title, titleProps, titleAccessory, endAccessory, endButtonIconProps, includesTopInset, style, testID, twClassName; extends ViewProps)
      • HeaderRoot.stories.tsx – Storybook entry "Components Temp / HeaderRoot" (Default, WithTitleAccessory, WithChildren, WithEndAccessory, WithEndButtonIconProps, MultipleEndButtons, IncludesTopInset)
      • HeaderRoot.test.tsx – unit test suite with full coverage (rendering, left section children vs title row, end section, includesTopInset, style/twClassName, titleProps)
      • index.ts – exports default and HeaderRootProps
    • Behavior: Left section renders either children or a title row (title + titleAccessory, like TitleStandard). End section matches HeaderBase (endAccessory or multiple ButtonIcons from endButtonIconProps in reverse order). No test ID constants; optional testID prop is passed through to the root.
  2. Storybook

    • Updated .storybook/storybook.requires.js to require HeaderRoot.stories.tsx.

No existing app code is updated; this is an additive change in the component-library.

Changelog

This PR is not end-user-facing; it adds an internal header component for use by other screens.

CHANGELOG entry: null

Related issues

Fixes: https://consensyssoftware.atlassian.net/browse/DSYS-498

Manual testing steps

Feature: HeaderRoot component

  Scenario: Lint and type check pass
    Given the branch is checked out
    When the author runs yarn lint and yarn lint:tsc
    Then both complete without errors

  Scenario: HeaderRoot unit tests pass
    Given the branch is checked out
    When the author runs yarn jest app/component-library/components-temp/HeaderRoot/HeaderRoot.test.tsx
    Then all tests pass

  Scenario: HeaderRoot story renders
    Given Storybook is running
    When the user opens "Components Temp / HeaderRoot"
    Then Default and other stories render (title, children, end accessories, multiple end buttons, top inset)

Screenshots/Recordings

Before

N/A – new component; no before state.

After

Simulator.Screen.Recording.-.iPhone.15.Pro.Max.-.2026-03-01.at.22.05.39.mov

Root pages after replacements

Simulator.Screen.Recording.-.iPhone.15.Pro.Max.-.2026-03-01.at.22.50.04.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
Additive UI-only change introducing a new temporary header component plus Storybook and unit tests; no existing runtime flows are modified.

Overview
Adds a new HeaderRoot component under components-temp that provides a standardized header layout with a left area that renders either children or a title row (optional titleAccessory), and a right area that renders endAccessory or a reversed list of endButtonIconProps.

Includes a comprehensive HeaderRoot.test.tsx, a new Storybook entry with multiple usage variants, and registers the story in .storybook/storybook.requires.js.

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

@brianacnguyen brianacnguyen self-assigned this Mar 2, 2026
@brianacnguyen brianacnguyen requested a review from a team as a code owner March 2, 2026 07:00
@brianacnguyen brianacnguyen added the team-design-system All issues relating to design system in Mobile label Mar 2, 2026
@github-actions

github-actions Bot commented Mar 2, 2026

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.

@github-actions github-actions Bot added the size-L label Mar 2, 2026
Comment thread app/component-library/components-temp/HeaderRoot/HeaderRoot.tsx
@github-actions

github-actions Bot commented Mar 3, 2026

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: 95%
click to see 🤖 AI reasoning details

E2E Test Selection:
This PR introduces a brand new HeaderRoot component in the component-library/components-temp directory. The changes are purely additive and include:

  1. A new React component (HeaderRoot.tsx) for rendering headers with flexible left/end sections
  2. TypeScript type definitions (HeaderRoot.types.ts)
  3. Comprehensive unit tests (HeaderRoot.test.tsx)
  4. Storybook stories for documentation (HeaderRoot.stories.tsx)
  5. Export index file (index.ts)
  6. Auto-generated storybook.requires.js update

Key findings:

  • The component is NOT used anywhere in the codebase - grep search confirms it's only referenced within its own directory
  • This is a temporary/experimental component in components-temp, not yet integrated into any screens or flows
  • No existing functionality is modified - this is purely additive code
  • No changes to controllers, Engine, navigation, or any critical paths
  • No changes to E2E test infrastructure or page objects

Since the component is completely isolated and not integrated into any user-facing flows, there is no risk of breaking existing E2E tests or functionality. No E2E tags are needed.

Performance Test Selection:
This PR adds a new HeaderRoot component that is not yet used anywhere in the application. Since the component is not integrated into any screens or user flows, it cannot impact app performance. The component is purely additive and isolated in the components-temp directory. 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.

Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.


const renderLeftSection = () => {
if (children != null && children !== undefined) {
return children;

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.

Falsy children bypass title rendering unexpectedly

Medium Severity

The children != null check passes for falsy ReactNode values like false, 0, and "". When a consumer uses a common conditional rendering pattern like {condition && <Content/>} inside <HeaderRoot title="...">, and the condition is false, children becomes false. Since false != null is true, the component enters the children branch and renders nothing — silently losing the title fallback. Other components in the codebase (e.g., TabsList) use React.Children.toArray(children) to properly filter out booleans, nulls, and undefined. Additionally, the && children !== undefined part of the condition is entirely redundant since != null already covers undefined via loose equality.

Fix in Cursor Fix in Web

@sonarqubecloud

sonarqubecloud Bot commented Mar 3, 2026

Copy link
Copy Markdown

@georgewrmarshall georgewrmarshall 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.

Really nice 🔥 Great recordings of usage in pages and nice PR size by not including those changes in this PR 👍

* Left section renders either children or a title row (mutually exclusive).
* End section matches HeaderBase (endAccessory or endButtonIconProps).
*/
export interface HeaderRootProps extends ViewProps {

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.

non-blocking: interface will need to be updated to type for MMDS. Should be caught by MMDS migration cursor rules 🤞

@brianacnguyen brianacnguyen added this pull request to the merge queue Mar 3, 2026
Merged via the queue into main with commit de41034 Mar 3, 2026
61 checks passed
@brianacnguyen brianacnguyen deleted the update/header-root branch March 3, 2026 03:04
@github-actions github-actions Bot locked and limited conversation to collaborators Mar 3, 2026
@metamaskbot metamaskbot added the release-7.69.0 Issue or pull request that will be included in release 7.69.0 label Mar 3, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

release-7.69.0 Issue or pull request that will be included in release 7.69.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.

3 participants