Repository navigation
Conversation
…tners, workflows, root workspace pages
Restored to part2's current (legacy HeaderWithBackButton) state - these files are Central Pane root screens now migrated via HeaderCentralPane directly on Guccio163/header/centralPane, so keeping them migrated here too would duplicate and conflict with that work. Rest of this batch is untouched.
…labs/expensify-app-fork into Guccio163/header/batch8
…WithBackButtonAndTitle Pulls the part2 changes into this batch branch. WorkspaceInitialPage used isHeadline directly on Header.Title; switched it to fold textHeadlineH2 into its existing titleStyles array since the primitive no longer carries the isHeadline prop. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
…-fork into Guccio163/header/batch8
…-fork into Guccio163/header/batch8
WorkspaceInitialPage now renders a manual Header composition with WorkspaceAvatar/UserAvatar/AccountAvatarButton instead of passing an avatar through the old HeaderWithBackButton, so the test's blanket mock of that component no longer swallows them; they rendered for real and crashed on the missing OnyxListItemProvider. Mock the three avatar components directly instead. WorkspaceOverviewCurrencyPage now renders HeaderWithBackButtonAndTitle from the composed Header API, so the mock needed to move to the new module path; the real Header then pulled in a navigation-context hook chain the test's mocks don't support.
Codecov Report✅ Changes either increased or maintained existing code coverage, great job!
|
|
@gijoe0295 Please copy/paste the Reviewer Checklist from here into a new comment on this PR and complete it. If you have the K2 extension, you can simply click: [this button] |
|
PR doesn’t need product input as a refactor PR. Unassigning and unsubscribing myself. |
# Conflicts: # src/pages/workspace/DynamicWorkspaceInvitePage.tsx # src/pages/workspace/WorkspaceConfirmationOwnerSelectorPage.tsx # src/pages/workspace/WorkspaceConfirmationSuccessPage.tsx # src/pages/workspace/WorkspaceInitialPage.tsx # src/pages/workspace/WorkspaceNewRoomPage.tsx # src/pages/workspace/WorkspaceOverviewCurrencyPage.tsx # src/pages/workspace/receiptPartners/DynamicInviteReceiptPartnerPolicyPage.tsx # src/pages/workspace/workflows/WorkspaceAutoReportingFrequencyPage.tsx # src/pages/workspace/workflows/WorkspaceAutoReportingMonthlyOffsetPage.tsx
…-fork into Guccio163/header/batch8 # Conflicts: # src/pages/workspace/WorkspaceOverviewCurrencyPage.tsx # src/pages/workspace/workflows/approvals/WorkspaceWorkflowsApprovalsApprovalLimitPage.tsx
# Conflicts: # src/components/CategoryPicker/index.tsx # src/hooks/useSearchBulkActions.ts
gijoe0295
left a comment
There was a problem hiding this comment.
Please update PR description regarding the new padding. Some test steps also seem outdated. Use an AI agent to help.
Reviewer Checklist
Screenshots/VideosAndroid: HybridAppAndroid: mWeb ChromeiOS: HybridAppScreen.Recording.2026-12-02.at.15.02.04.moviOS: mWeb SafariScreen.Recording.2026-12-02.at.15.00.05.movMacOS: Chrome / SafariScreen.Recording.2026-12-02.at.14.57.15.mov |
| <Header.BackButton onPress={() => Navigation.goBack(route.params?.backTo ?? ROUTES.WORKSPACES_LIST.route)} /> | ||
| {policy ? ( | ||
| <WorkspaceAvatar | ||
| containerStyles={[StyleUtils.getWidthAndHeightStyle(StyleUtils.getAvatarSize(CONST.AVATAR_SIZE.SMALL)), styles.mr3]} |
There was a problem hiding this comment.
❌ CONSISTENCY-3 (docs)
The avatar container styles [StyleUtils.getWidthAndHeightStyle(StyleUtils.getAvatarSize(CONST.AVATAR_SIZE.SMALL)), styles.mr3] (and the size={CONST.AVATAR_SIZE.SMALL} prop) are duplicated verbatim across the WorkspaceAvatar and UserAvatar branches of the ternary. Duplicating the same style expression in both branches means a future tweak has to be made in two places and the copies can drift.
Hoist the shared values into a single local and reuse them in both branches:
const avatarContainerStyles = [StyleUtils.getWidthAndHeightStyle(StyleUtils.getAvatarSize(CONST.AVATAR_SIZE.SMALL)), styles.mr3];
// ...
{policy ? (
<WorkspaceAvatar
containerStyles={avatarContainerStyles}
size={CONST.AVATAR_SIZE.SMALL}
source={policy.avatarURL ?? ''}
name={policy.name ?? ''}
avatarID={policy.id ?? CONST.DEFAULT_NUMBER_ID}
/>
) : (
<UserAvatar
containerStyles={avatarContainerStyles}
size={CONST.AVATAR_SIZE.SMALL}
source={expensifyIcons.ExpensifyAppIcon}
accountID={CONST.DEFAULT_NUMBER_ID}
/>
)}Reviewed at: dcf0f6a | Please rate this suggestion with 👍 or 👎 to help us improve! Reactions are used to monitor reviewer efficiency.
Explanation of Change
Batch 8 of the
HeaderWithBackButton→ composedHeadermigration. Migrates the 21 call-sites under the looseworkspace/*.tsxfiles,workspace/receiptPartners/andworkspace/workflows/(incl.approvals/).20 call-sites use the
HeaderWithBackButtonAndTitlepreset; three of them passsubtitle.WorkspaceInitialPage.tsxcomposesHeaderdirectly:Header.BackButton, the workspace (or user) avatar,Header.Titlewith the headline style, the help button on narrow layouts andAccountAvatarButton. The only visual difference is intentional: the title ends 12px (instead of 16px) before the next item or the right edge of the header.Fixed Issues
$ #101537
Tests
Setup (once): sign in with a brand-new account and finish onboarding. Open the Workspaces tab > New workspace > Confirm. A new workspace is on the Collect plan; turn on the workspace features a step needs in Workspaces > your workspace > More features. Everything below is on web in a wide window unless a step says otherwise. "Narrow" means a window narrower than 800px (or a phone). The left menu of a workspace lists: Overview, Members, Agents, Rooms, Reports, Connections, Categories, Tags, Taxes, Workflows, Rules, Distance rates, Travel, Expensify Card, Company cards, Per diem, Time, Invoices, More features (only the features that are turned on).
Header types in this PR (what they must look like):
1. Back + title: workspace Overview, Workflows, Rooms
Expected: back button + title only, nothing on the right. Same as main, except that a truncated title ends 12px from the header's right edge (main: 16px) - intentional. The back button returns to the previous screen.
2. Invite members: back + title + subtitle
Expected: back + title + subtitle, nothing on the right. Same as main, except that a truncated title ends 12px from the header's right edge (main: 16px) - intentional.
3. Workspace home on narrow layout
Expected: back + avatar + name on the left, help + account avatar on the right, no search button. The name box ends 12px before the help icon (main: 16px) - intentional.
Offline tests
QA Steps
Same as tests
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectionAvatar, 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.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-morefeatures-headline-help-header.mp4
android-overview-pagewithsections-header.mp4
android-workspace-initial-avatar-header.mp4
Android: mWeb Chrome
iOS: Native
ios-morefeatures-headline-help-header.mp4
ios-overview-pagewithsections-header.mp4
ios-workspace-initial-avatar-header.mp4
iOS: mWeb Safari
MacOS: Chrome / Safari
b8-web.mp4