Repository navigation
Conversation
…-fork into Guccio163/header/headerComposedImplementation
Codecov Report✅ Changes either increased or maintained existing code coverage, great job!
|
…-fork into Guccio163/header/headerComposedImplementation
…-fork into Guccio163/header/headerComposedImplementation
…-fork into Guccio163/header/headerComposedImplementation
|
Sorry. On my list tomorrow morning. |
…-fork into Guccio163/header/headerComposedImplementation
…enuItemButton.tsx Co-authored-by: Joe Ph <joeph0295@gmail.com>
|
Hi @gijoe0295, thank you for your review! I applied some of your suggestions and responded to some (if I don't fully agree). I'm not sure how we should name the Actions/Right folder, so I'm leaving this for discussion. If you don't mind I think we should go forward with this PR like I suggested here and once it's ready for @mountiny I'll start with the follow-up. WDYT @gijoe0295 ? |
|
@gijoe0295 thanks for a thorough review! Can you please continue? thank you |
Reviewer Checklist
Screenshots/VideosAndroid: HybridAppAndroid: mWeb ChromeiOS: HybridAppiOS: mWeb SafariMacOS: Chrome / SafariScreen.Recording.2026-08-31.at.13.20.16.mov |
…-fork into Guccio163/header/headerComposedImplementation
…b.com:software-mansion-labs/expensify-app-fork into Guccio163/header/headerComposedImplementation
|
🚧 mountiny has triggered a test Expensify/App build. You can view the workflow run here. |
|
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
|
🧪🧪 Use the links below to test this adhoc build on Android, iOS, and Web. Happy testing! 🧪🧪
|
|
🚀 Deployed to staging by https://github.com/mountiny in version: 9.4.65-0 🚀
|
|
No help site changes are required for this PR, so I did not create a draft docs PR. This is an internal refactor with no user-facing surface:
Since no docs PR exists, there is nothing to label |
|
🚀 Deployed to production by https://github.com/francoisl in version: 9.4.65-3 🚀
Bundle Size Analysis (Sentry): |
Explanation of Change
First step of the HeaderWithBackButton
composition over configurationmigration; This branch is the "build the replacement" phase; swapping real callers over is a later PR.Current
HeaderWithBackButtonComposed/index.tsxform is not the end goal — it's scaffolding. It reassembles the legacy render from small named primitives while keeping the exact same flat prop API as the original, so:Header.Left/Header.Right+ block children) can be designed with minimal wrapper overhead.Introduced primitives:
HeaderBackButton,HeaderIcon,HeaderTitle,HeaderThreeDotsMenu,HeaderCloseButtonTooltip,HeaderDownloadButton,HeaderMenuItemButtonTooltip.HeaderTooltipIconButton— Back/Download/Close/MenuItem were all Tooltip+Pressable+Icon differing only in onPress-wrapping, fill, and ref logic, so the shared skeleton got extracted and the four now delegate to it.zones/HeaderRight+zones/HeaderActionswrap the right-side cluster: outer separates it from the center content, inner packs custom children + download together and applies its padding unconditionally so the gap to whatever follows never needs to know what that is.Parts kept inline, not extracted:
AvatarWithDisplayName(report avatar),Avatar(policy avatar),SearchButton,SidePanelButtonare rendered directly inindex.tsx, not through dedicated primitives, because extracting them into separate primitives would be either a no-op wrapper or they are used only once so it's redundant to create a separate primitive wrapper just for this.Parts removed entirely (confirmed via census across all 531 real legacy call sites that these never actually render/apply, then deleted along with their plumbing):
HeaderRotateButton/shouldShowRotateButton/isRotating/onRotateButtonPress— the one real caller passes it as a prop that always resolves tofalse.HeaderPinButton/shouldShowPinButton— always explicitfalseor absent, nevertrue.shouldOverlay,shouldNavigateToTopMostReport,shouldDisableThreeDotsButton,threeDotsMenuIcon/threeDotsMenuIconFill— each 100% unused across every call site.progressBarPercentage,stepCounter-driven bar,HeaderProgressBar) — already removed upstream onmainwhile this PR was being developed.Parts restructured (ensuring unchanged behavior):
pl2on the outer header container (a leftover from when the progress bar also needed container-level padding logic). Now that the progress bar is gone, it's a negative margin (mln3) onHeaderBackButtonitself — self-contained, doesn't need the container to coordinate with anything.SearchButton/SidePanelButtonmoved from being siblings outside the right-side wrapper View to siblings inside it. Verified with DOM measurements and screenshots: zero visual difference either way, because the gap between them and whatever precedes them comes from padding on the actions-wrapper regardless of where they sit. Moved purely so the whole right side is one visibly single group in the tree, instead of "half of it is wrapped, half isn't" — easier to explain and reason about, not a rendering change.Tooling accommodation:
knip.jsongotindex.tsxadded as an entry point, since nothing imports this folder yet — without it, Knip would flag the whole thing as dead code.Fixed Issues
$ #96611
PROPOSAL:
Tests
NoQA PR, so tests are code-wise: check if the whole HeaderWithBackButton component's pieces are swapped correctly with primitive components in the new HeaderWithBackButtonComposed/index.tsx file.
Offline tests
QA Steps
Same as tests
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectiontoggleReportand notonIconClick)src/languages/*files and using the translation methodSTYLE.md) were followedAvatar, I verified the components usingAvatarare working as expected)StyleUtils.getBackgroundAndBorderStyle(theme.componentBG))npm run compress-svg)Avataris modified, I verified thatAvataris working as expected in all cases)Designlabel and/or tagged@Expensify/designso the design team can review the changes.ScrollViewcomponent to make it scrollable when more elements are added to the page.mainbranch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTeststeps.Screenshots/Videos
Android: Native
Android: mWeb Chrome
iOS: Native
iOS: mWeb Safari
MacOS: Chrome / Safari