chore: Added HeaderRoot to components-temp#26745
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. |
…to update/header-root
…to update/header-root
…to update/header-root
🔍 Smart E2E Test Selection
click to see 🤖 AI reasoning detailsE2E Test Selection:
Key findings:
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: |
There was a problem hiding this comment.
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; |
There was a problem hiding this comment.
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.
|
georgewrmarshall
left a comment
There was a problem hiding this comment.
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 { |
There was a problem hiding this comment.
non-blocking: interface will need to be updated to type for MMDS. Should be caught by MMDS migration cursor rules 🤞





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
childrenor a title row (TitleStandard-style), and an end section with the same end content behavior as HeaderBase (endAccessory or endButtonIconProps).What changed:
New component: HeaderRoot
app/component-library/components-temp/HeaderRoot/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.ts–HeaderRootProps(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 andHeaderRootPropschildrenor a title row (title + titleAccessory, like TitleStandard). End section matches HeaderBase (endAccessory or multiple ButtonIcons from endButtonIconProps in reverse order). No test ID constants; optionaltestIDprop is passed through to the root.Storybook
.storybook/storybook.requires.jsto requireHeaderRoot.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
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
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
HeaderRootcomponent undercomponents-tempthat provides a standardized header layout with a left area that renders eitherchildrenor a title row (optionaltitleAccessory), and a right area that rendersendAccessoryor a reversed list ofendButtonIconProps.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.