Skip to content

MenuItem decomposition - remove titleContainerStyle - #103040

Merged
roryabraham merged 11 commits into
Expensify:mainfrom
software-mansion-labs:war-in/menuitem-remove-title-container-style
Oct 19, 2026
Merged

roryabraham merged 11 commits into
Expensify:mainfrom
software-mansion-labs:war-in/menuitem-remove-title-container-style

Conversation

@war-in

@war-in war-in commented Oct 5, 2026 •

Copy link
Copy Markdown
Contributor

Explanation of Change

Removes titleContainerStyle from the legacy MenuItem. Trip reservation rows move their gap1 onto their own title (mt1). The report details name rows and the receipt partner rows move to the composable MenuItem API. The Uber row is extracted into UberConnectionRow, with the badge, the red dot and the menu in Trailing.

Fixed Issues

$ #100159
PROPOSAL:

Tests

  1. Open a trip room with flight and hotel reservations (including a cancelled one)
  2. Verify that each reservation shows the date line above the title with the same spacing as before, and that cancelled ones are greyed out

  1. Open the details of a #room, a thread, a group chat and a workspace chat
  2. Verify that the room and thread names are large and centered (threads clamp to 2 lines), with a chevron only when you can rename
  3. Verify that the group chat shows a "Group name" label above a left-aligned name, and that a room shows a separate "Workspace" row
  4. Use a name with an emoji, tap the name row, and verify that it renders correctly and opens the rename page

  1. Go to Workspace > More features, enable Receipt partners, then open Receipt partners on a wide screen and on a narrow screen
  2. Verify that the Uber row shows the avatar, title, description, the "Claim offer" badge (inline on wide, below the text on narrow) and the Set up button
  3. Tap the badge and verify that the claim offer page opens. After connecting, verify that the three-dots menu offers Disconnect
  4. With an invalid credentials state, verify that the error text and the red dot show, and that the menu offers "Enter credentials"

Offline tests

  1. Go to Workspace > Receipt partners and go offline
  2. Verify that the Set up button is disabled, and that "Enter credentials" in the three-dots menu is disabled when shown

QA Steps

Same as tests

PR Author Checklist

  • I linked the correct issue in the ### Fixed Issues section above
  • I wrote clear testing steps that cover the changes made in this PR
    • I added steps for local testing in the Tests section
    • I added steps for the expected offline behavior in the Offline steps section
    • I added steps for Staging and/or Production testing in the QA steps section
    • I added steps to cover failure scenarios (i.e. verify an input displays the correct error message if the entered data is not correct)
    • I turned off my network connection and tested it while offline to ensure it matches the expected behavior (i.e. verify the default avatar icon is displayed if app is offline)
    • I tested this PR with a High Traffic account against the staging or production API to ensure there are no regressions (e.g. long loading states that impact usability).
  • I included screenshots or videos for tests on all platforms
  • I ran the tests on all platforms & verified they passed on:
    • Android: Native
    • Android: mWeb Chrome
    • iOS: Native
    • iOS: mWeb Safari
    • MacOS: Chrome / Safari
  • I verified there are no console errors (if there's a console error not related to the PR, report it or open an issue for it to be fixed)
  • I followed proper code patterns (see Reviewing the code)
    • I verified that comments were added to code that is not self explanatory
    • I verified that any new or modified comments were clear, correct English, and explained "why" the code was doing something instead of only explaining "what" the code was doing.
    • I verified any copy / text that was added to the app is grammatically correct in English. It adheres to proper capitalization guidelines (note: only the first word of header/labels should be capitalized), and is either coming verbatim from figma or has been approved by marketing (in order to get marketing approval, ask the Bug Zero team member to add the Waiting for copy label to the issue)
  • If a new code pattern is added I verified it was agreed to be used by multiple Expensify engineers
  • I followed the guidelines as stated in the Review Guidelines
  • I tested other components that can be impacted by my changes (i.e. if the PR modifies a shared library or component like Avatar, I verified the components using Avatar are working as expected)
  • If a new CSS style is added I verified that:
    • A similar style doesn't already exist
    • The style can't be created with an existing StyleUtils function (i.e. StyleUtils.getBackgroundAndBorderStyle(theme.componentBG))
  • If new assets were added or existing ones were modified, I verified that:
    • The assets are optimized and compressed (for SVG files, run npm run compress-svg)
    • The assets load correctly across all supported platforms.
  • If the PR modifies code that runs when editing or sending messages, I tested and verified there is no unexpected behavior for all supported markdown - URLs, single line code, code blocks, quotes, headings, bold, strikethrough, and italic.
  • If the PR modifies a generic component, I tested and verified that those changes do not break usages of that component in the rest of the App (i.e. if a shared library or component like Avatar is modified, I verified that Avatar is working as expected in all cases)
  • If the PR modifies a component related to any of the existing Storybook stories, I tested and verified all stories for that component are still working as expected.
  • If the PR modifies a component or page that can be accessed by a direct deeplink, I verified that the code functions as expected when the deeplink is used - from a logged in and logged out account.
  • If the PR modifies the UI (e.g. new buttons, new UI components, changing the padding/spacing/sizing, moving components, etc) or modifies the form input styles:
    • I verified that all the inputs inside a form are aligned with each other.
    • I added Design label and/or tagged @Expensify/design so the design team can review the changes.
  • If the PR adds or modifies the UI:
    • I asked an AI agent to review the changes for accessibility issues and addressed its findings.
    • I tested with a screen reader (VoiceOver on macOS) and verified all new/changed elements are reachable with a logical focus order.
    • I verified all new/changed elements have meaningful accessible names and roles.
    • I verified state changes are announced (e.g. checked/unchecked, expanded/collapsed, selected).
  • I added unit tests for any new feature or bug fix in this PR to help automatically prevent regressions in this user flow.
  • If the main branch was merged into this PR after a review, I tested again and verified the outcome was still expected according to the Test steps.

Screenshots/Videos

Android: Native
Android: mWeb Chrome
iOS: Native
iOS: mWeb Safari
MacOS: Chrome / Safari

war-in added 4 commits October 5, 2026 15:35
The 4px gap the column added between the date line and the title now
lives on the caller's own titleComponent as mt1. The justifyContentStart
was a no-op: the column's content is always at least its 40px min height.
Pixel-identical in Storybook across hotel, car, flight, cancelled and
centered-icon variants.
The name row now composes MenuItem.Root, Row, Content and Trailing. Its
headline is the caller's own Text, which keeps the custom emoji path
through TextWithEmojiFragment. The centered variant puts the title and
further details in a caller View with alignItemsCenter, where it used
titleContainerStyle before. That View takes mrn3 while the chevron
shows. Row's gap3 would otherwise narrow the area the title centers in
and change where it wraps.

The workspace row underneath becomes a MenuItemField.

Pixel-identical in Storybook for these variants. Centered short, long
workspace chat, two-line thread, custom emoji, no rename permission,
and push row with and without rename permission, including a long
unbroken workspace name.
Each integration now renders as MenuItemSectionRoot JSX. The page no
longer builds a MenuItem config object for it. On wide layouts the Uber
badge sits in Trailing. On narrow layouts it sits in its own line under
the Row, with legacy's ml13 and mt2. The error renders through
FormHelpMessage with mt3, as before.

Legacy's badge spacing came from its mr2 and the brick road dot's ml1.
Trailing's gap2 matches the first. The badge takes mr1 when the dot
shows, which matches the second.

Pixel-identical in Storybook, wide and narrow, with and without the
badge, the brick road dot and the error, and with a long description.
The prop has no callers left. Adds gallery cards for the two composable
shapes that replaced its last two call sites.
@codecov

codecov Bot commented Oct 5, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Looks like you've decreased code coverage for some files. Please write tests to increase, or at least maintain, the existing level of code coverage. See our documentation here for how to interpret this table.

Files with missing lines Coverage Δ
src/components/MenuItem/MenuItem.tsx 90.97% <100.00%> (-0.70%) ⬇️
...rc/components/ReportActionItem/TripDetailsView.tsx 77.00% <ø> (-0.23%) ⬇️
...amicReportDetailsPage/ReportDetailsNameSection.tsx 100.00% <100.00%> (+4.16%) ⬆️
...rc/components/ReportActionItem/TripRoomPreview.tsx 58.10% <0.00%> (+0.77%) ⬆️
...e/receiptPartners/WorkspaceReceiptPartnersPage.tsx 0.00% <0.00%> (ø)
...ceiptPartners/connectionRows/UberConnectionRow.tsx 0.00% <0.00%> (ø)
... and 56 files with indirect coverage changes

@war-in

war-in commented Oct 5, 2026

Copy link
Copy Markdown
Contributor Author

@codex review
@claude review
@MelvinBot review

@MelvinBot

Copy link
Copy Markdown
Contributor

Code review

I found no blocking issues. The refactor keeps the old behavior in all three areas, and CI is green apart from the approval check.

Two optional notes:

  1. Test coverage for the centered header. ReportDetailsNameSectionTest.tsx:63-85 covers the group-chat field and a non-renamable workspace chat. It doesn't cover a room's separate "Workspace" row, the "in …" subtitle, or the 2-line clamp for threads at ReportDetailsNameSection.tsx:115. Codecov shows 39% patch coverage.
  2. Unreachable guard. In UberConnectionRow.tsx:59, getReceiptPartnersIntegrationData(UBER) always returns an object, so if (!integrationData) never fires. It's harmless as a type narrowing.
What I checked
  • titleContainerStyle removal: typecheck passes, so nothing else uses it. In both trip files the description sits on top, so mt1 on the title gives the same 4px that gap1 did. Dropping justifyContentStart in TripDetailsView causes no visible change, because the text column is at least as tall as the 40px icon.
  • Report name section:
    • Rename gating is the same as before: chevron, mt3, and onPress only when canRename.
    • The old common.name description is safe to drop, because it only ever showed for field rows and money request reports never take that branch.
    • The subtitle rules match the old furtherDetails logic: no subtitle for group chats, bare vs. "in …" prefix, 0 lines and centered for workspace chats, 2 lines otherwise.
    • ReportNameText copies the legacy title rendering: convertToLTR, the custom-emoji fragment, breakWord, preWrap, mw100.
    • The old shouldCheckActionAllowedOnPress={false} matches the raw onPress on MenuItem.Root.
    • The accessibility label is unchanged. The legacy label also left out furtherDetails.
  • Uber row:
    • The three-dots menu shows under the same conditions as before: canWrite, with Enter credentials taking precedence over Disconnect. Read-only users still get the Set up button with the read-only modal.
    • The Set up button's loading and disabled states are unchanged, and so is the claim-offer badge press gating.
    • The brick road indicator still announces "your review is required".
    • The error message keeps the red dot off, as before.
    • Removing the OfflineWithFeedback wrapper loses nothing. The old pendingAction came from the integration data object, which never has that field, so it was always undefined.
    • Disconnect still refetches the page afterward.

view run

@war-in
war-in marked this pull request as ready for review October 5, 2026 15:58
@war-in
war-in requested review from a team as code owners October 5, 2026 15:58
@melvin-bot
melvin-bot Bot requested review from Pujan92 and trjExpensify and removed request for a team October 5, 2026 15:58
@melvin-bot

melvin-bot Bot commented Oct 5, 2026

Copy link
Copy Markdown

@Pujan92 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]

@melvin-bot
melvin-bot Bot removed the request for review from a team October 5, 2026 15:58
@trjExpensify

Copy link
Copy Markdown
Contributor

PR doesn’t need product input as a refactor PR. Unassigning and unsubscribing myself.

@trjExpensify
trjExpensify removed their request for review October 6, 2026 18:50
@Pujan92

Pujan92 commented Oct 9, 2026

Copy link
Copy Markdown
Contributor

Conflicts 😅

war-in added 2 commits October 9, 2026 15:22
# Conflicts:
#	src/pages/DynamicReportDetailsPage/ReportDetailsNameSection.tsx
@war-in

war-in commented Oct 9, 2026

Copy link
Copy Markdown
Contributor Author

@Pujan92 fixed!

@Pujan92

Pujan92 commented Oct 9, 2026 •

Copy link
Copy Markdown
Contributor

Reviewer Checklist

  • I have verified the author checklist is complete (all boxes are checked off).
  • I verified the correct issue is linked in the ### Fixed Issues section above
  • I verified testing steps are clear and they cover the changes made in this PR
    • I verified the steps for local testing are in the Tests section
    • I verified the steps for Staging and/or Production testing are in the QA steps section
    • I verified the steps cover any possible failure scenarios (i.e. verify an input displays the correct error message if the entered data is not correct)
    • I turned off my network connection and tested it while offline to ensure it matches the expected behavior (i.e. verify the default avatar icon is displayed if app is offline)
  • I checked that screenshots or videos are included for tests on all platforms
  • I included screenshots or videos for tests on all platforms
  • I verified that the composer does not automatically focus or open the keyboard on mobile unless explicitly intended. This includes checking that returning the app from the background does not unexpectedly open the keyboard.
  • I verified tests pass on all platforms & I tested again on:
    • Android: HybridApp
    • Android: mWeb Chrome
    • iOS: HybridApp
    • iOS: mWeb Safari
    • MacOS: Chrome / Safari
  • If there are any errors in the console that are unrelated to this PR, I either fixed them (preferred) or linked to where I reported them in Slack
  • I verified proper code patterns were followed (see Reviewing the code)
    • I verified that any callback methods that were added or modified are named for what the method does and never what callback they handle (i.e. toggleReport and not onIconClick).
    • I verified that comments were added to code that is not self explanatory
    • I verified that any new or modified comments were clear, correct English, and explained "why" the code was doing something instead of only explaining "what" the code was doing.
    • I verified any copy / text that was added to the app is grammatically correct in English. It adheres to proper capitalization guidelines (note: only the first word of header/labels should be capitalized), and is either coming verbatim from figma or has been approved by marketing (in order to get marketing approval, ask the Bug Zero team member to add the Waiting for copy label to the issue)
  • If a new code pattern is added I verified it was agreed to be used by multiple Expensify engineers
  • I verified that this PR follows the guidelines as stated in the Review Guidelines
  • I verified other components that can be impacted by these changes have been tested, and I retested again (i.e. if the PR modifies a shared library or component like Avatar, I verified the components using Avatar have been tested & I retested again)
  • If a new component is created I verified that:
    • A similar component doesn't exist in the codebase
    • All props are defined accurately and each prop has a /** comment above it */
    • The file is named correctly
    • The component has a clear name that is non-ambiguous and the purpose of the component can be inferred from the name alone
    • The only data being stored in the state is data necessary for rendering and nothing else
    • For Class Components, any internal methods passed to components event handlers are bound to this properly so there are no scoping issues (i.e. for onClick={this.submit} the method this.submit should be bound to this in the constructor)
    • Any internal methods bound to this are necessary to be bound (i.e. avoid this.submit = this.submit.bind(this); if this.submit is never passed to a component event handler like onClick)
    • All JSX used for rendering exists in the render method
    • The component has the minimum amount of code necessary for its purpose, and it is broken down into smaller components in order to separate concerns and functions
  • If any new file was added I verified that:
    • The file has a description of what it does and/or why is needed at the top of the file if the code is not self explanatory
  • If a new CSS style is added I verified that:
    • A similar style doesn't already exist
    • The style can't be created with an existing StyleUtils function (i.e. StyleUtils.getBackgroundAndBorderStyle(theme.componentBG)
  • If the PR modifies code that runs when editing or sending messages, I tested and verified there is no unexpected behavior for all supported markdown - URLs, single line code, code blocks, quotes, headings, bold, strikethrough, and italic.
  • If the PR modifies a generic component, I tested and verified that those changes do not break usages of that component in the rest of the App (i.e. if a shared library or component like Avatar is modified, I verified that Avatar is working as expected in all cases)
  • If the PR modifies a component related to any of the existing Storybook stories, I tested and verified all stories for that component are still working as expected.
  • If the PR modifies a component or page that can be accessed by a direct deeplink, I verified that the code functions as expected when the deeplink is used - from a logged in and logged out account.
  • If the PR modifies the UI (e.g. new buttons, new UI components, changing the padding/spacing/sizing, moving components, etc) or modifies the form input styles:
    • I verified that all the inputs inside a form are aligned with each other.
    • I added Design label and/or tagged @Expensify/design so the design team can review the changes.
  • For any bug fix or new feature in this PR, I verified that sufficient unit tests are included to prevent regressions in this flow.
  • If the main branch was merged into this PR after a review, I tested again and verified the outcome was still expected according to the Test steps.
  • I have checked off every checkbox in the PR reviewer checklist, including those that don't apply to this PR.

Screenshots/Videos

Android: HybridApp
Android: mWeb Chrome
iOS: HybridApp
iOS: mWeb Safari
MacOS: Chrome / Safari
Screen.Recording.2026-10-15.at.19.58.21.mov
Screenshot 2026-10-15 at 19 56 05 Screenshot 2026-10-15 at 19 52 18

@melvin-bot
melvin-bot Bot requested a review from roryabraham October 15, 2026 14:29
@Pujan92

Pujan92 commented Oct 15, 2026

Copy link
Copy Markdown
Contributor

@war-in resolve conflicts again 🙏

# Conflicts:
#	src/pages/workspace/receiptPartners/WorkspaceReceiptPartnersPage.tsx
@war-in

war-in commented Oct 15, 2026

Copy link
Copy Markdown
Contributor Author

@Pujan92 done!

@roryabraham
roryabraham merged commit 5845ac0 into Expensify:main Oct 19, 2026
34 of 35 checks passed
@OSBotify

Copy link
Copy Markdown
Contributor

✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release.

@github-actions

Copy link
Copy Markdown
Contributor

🚧 roryabraham has triggered a test Expensify/App build. You can view the workflow run here.

@OSBotify

Copy link
Copy Markdown
Contributor

🚀 Deployed to staging by https://github.com/roryabraham in version: 9.5.15-1 🚀

platform result
🕸 web 🕸 success ✅
🤖 android 🤖 success ✅
🍎 iOS 🍎 success ✅

@MelvinBot

Copy link
Copy Markdown
Contributor

No help site update is needed. This PR refactors how MenuItem lays out rows (trip reservations, report details name rows, and Receipt partners). It keeps the same labels, buttons, and behavior, so no sentence in docs/articles becomes incorrect.


view run

@OSBotify

Copy link
Copy Markdown
Contributor

🚀 Deployed to production by https://github.com/grgia in version: 9.5.15-3 🚀

platform result
🕸 web 🕸 success ✅
🤖 android 🤖 success ✅
🍎 iOS 🍎 success ✅

Bundle Size Analysis (Sentry):

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants