Skip to content

MenuItem decomposition - migratable batch - #103973

Merged
roryabraham merged 11 commits into
Expensify:mainfrom
software-mansion-labs:war-in/menuitem-decomposition-migratable-batch
Oct 30, 2026
Merged

roryabraham merged 11 commits into
Expensify:mainfrom
software-mansion-labs:war-in/menuitem-decomposition-migratable-batch

Conversation

@war-in

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

Copy link
Copy Markdown
Contributor

Explanation of Change

Migrates 64 legacy MenuItem / MenuItemWithTopDescription rows in 38 files to the composable API (presets or MenuItem.Root). No new API. Row style overrides are replaced by fixing the parent layout: ProfilePage rows leave avatarSectionWrapper, Rules/Invoicing use MenuItemSectionRoot, outer margins move to wrapper Views.

Fixed Issues

$ #100159
PROPOSAL:

Tests

  1. Open any user's profile (e.g. click an avatar in a chat, or Settings > Profile > view your public profile)

  2. Hover the status, email/phone, display name, pronouns and local time rows, and long-press / right-click the email row

  3. Verify that the rows line up with the page edges as before, the email row offers "Copy to clipboard", and the display name row is pressable (with a chevron) only when the member has no display name set

  4. Open a workspace > Workflows / Rules (expense report rules section) and Invoices (invoicing details section), and an accounting connection (Campfire, Xero, NetSuite, QuickBooks Online, Sage Intacct or Certinia) > Export / Advanced

  5. Press each migrated field row (e.g. "Auto-approve reports under", "Company name", export rows), then go back

  6. Verify that each row shows the same label, value, chevron and red dot (when a setting has an error) as on main, opens the same page, and that read-only rows (e.g. preferred exporter) have no chevron and do nothing on press

  7. Open a chat > report details and check the Settings, Members, Invite, Leave, Private notes, Mark as incomplete and Track expense rows; then open an expense > More > Split

  8. Press each row, and on the split page press "Add split" and "Make splits even"

  9. Verify that every row navigates or acts as before, the Members row shows the member count before the chevron, and the split rows add a split and evenly redistribute the amounts

Offline tests

N/A

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 verified any copy / text that was added to the app 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 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 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

@codecov

codecov Bot commented Oct 14, 2026 •

Copy link
Copy Markdown

…position-migratable-batch

# Conflicts:
#	src/components/DynamicForm/components/DynamicFormFieldRow.tsx
#	src/components/MenuItem/presets/MenuItemField.tsx
#	src/pages/ProfilePage.tsx
#	src/pages/workspace/expensifyCard/DynamicWorkspaceExpensifyCardDetailsPage.tsx
#	src/pages/workspace/rules/ExpenseReportRulesSection.tsx
@war-in
war-in marked this pull request as ready for review October 21, 2026 10:06
@war-in
war-in requested review from a team as code owners October 21, 2026 10:06
@melvin-bot
melvin-bot Bot requested review from Pujan92 and removed request for a team October 21, 2026 10:06
@melvin-bot

melvin-bot Bot commented Oct 21, 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 requested review from dylanexpensify and removed request for a team October 21, 2026 10:06

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

Performance related, product input not required

@Pujan92

Pujan92 commented Oct 30, 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-30.at.20.14.06.mov
Screenshot 2026-10-30 at 20 16 18

Uploading Screen Recording 2026-10-30 at 22.25.54.mov…

@Pujan92

Pujan92 commented Oct 30, 2026

Copy link
Copy Markdown
Contributor

@war-in conflicts

…omposition-migratable-batch

# Conflicts:
#	src/components/Search/FilterDropdowns/SearchFooterPopup.tsx
#	src/pages/DynamicReportDetailsPage/ReportDetailsMenuMarkAsIncompleteItem.tsx
#	src/pages/iou/request/step/IOURequestEditReportCommon.tsx
#	src/pages/settings/Subscription/SubscriptionPlan/SubscriptionPlanCardActionButton.tsx
#	src/pages/workspace/accounting/campfire/advanced/CampfireAdvancedPage.tsx
@war-in

war-in commented Oct 30, 2026

Copy link
Copy Markdown
Contributor Author

@Pujan92 done!

@Pujan92

Pujan92 commented Oct 30, 2026

Copy link
Copy Markdown
Contributor

@MelvinBot review

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

LGTM!

@melvin-bot
melvin-bot Bot requested a review from roryabraham October 30, 2026 17:02
@MelvinBot

Copy link
Copy Markdown
Contributor

Code review

I found no bugs in the code. I compared each of the 64 migrated rows against its legacy props. Chevrons, red dots, press handlers, read-only rows, copy-to-clipboard, offline wrappers, sentry labels and the anonymous-user guard all behave as before. Nothing else uses the removed cardPaddingTop token. The test changes don't weaken any assertions.

These small visual differences are worth checking against main during your manual test. None of them blocks the PR:

  1. Split edit Description row: the row no longer gets styles.moneyRequestMenuItem, so its padding may change slightly. It now matches the Category and Date rows on the same page. DynamicSplitExpenseEditPage.tsx:450-468
  2. Accounting helper text (Certinia, Intacct, QBO, Xero): it changed from mutedNormalTextLabel text to MenuItem.HelpText (formHelp). Spacing is kept, but the font may look slightly different. For example, see CertiniaExportPage.tsx:144-148.
  3. Invoicing details section: the bottom padding grows from 20px to cardPadding (+4px narrow, +12px wide). This now matches the sibling invoice sections. WorkspaceInvoicingDetailsSection.tsx:35-71
  4. Profile status row: legacy MenuItem rendered titles that mix text and custom emoji through TextWithEmojiFragment (MenuItem.tsx:769-779). MenuItemField renders plain text. Standard Unicode status emoji look the same, so this only matters if a status can contain a custom emoji. ProfilePage.tsx:279-281
What I checked
  • Read-only rows: interactive={false} / shouldShowRightIcon: false became "no onPress". MenuItemField shows a chevron and is pressable only when onPress is set. This covers the Campfire, Certinia and Xero export rows, the SearchFooterPopup Total and Currency rows, the subscription plan row, and the ScheduleCall row.
  • Anonymous-user guard: MenuItemNavigation, MenuItemAction and MenuItemField wrap onPress in callFunctionIfActionIsAllowed. These MenuItem.Root rows wrap it by hand: Members, Private notes, Add split, Make splits even, Auto report and Campfire accounting method. Debug and Leave stay unguarded, as they were before.
  • Report details: the Members count moved from subtitle into the trailing cell. The trailing cell's gap2 replaces the old ph2. The Private notes red dot and its screen-reader text are kept. Report ID rows use MenuItem.Copy, which keeps long-press copy and selection blocking on touch devices.
  • ProfilePage spacing: rows moved out of avatarSectionWrapper, and the display name margin changed from mb8 to mb3. The vertical gap is still 32px, and the horizontal inset is still 20px.
  • ExpenseReportRulesSection: on wide screens it looks the same. On narrow screens the old rows reached 8px past the card padding and were clipped. The new rows line up with the card edge.
  • MenuItemField accessibility label: the explicit [name, value].join(', ') gives the same label as before for every existing caller. Red-dot and error text are still added.
  • Tests: the ReportDetailsMenuItemsTest mock moved to the MenuItemTitle leaf, which every row still renders through. The removed MenuItemWithTopDescription mock in ExpenseReportRulesSectionTest did nothing, because ToggleSettingOptionRow is mocked to null.

I reviewed the code only. I didn't run the app or the tests.


view run

@roryabraham

roryabraham commented Oct 30, 2026 •

Copy link
Copy Markdown
Contributor

Reassure failure is unrelated, not going to block merge on it.

@roryabraham
roryabraham merged commit fbfc491 into Expensify:main Oct 30, 2026
37 of 40 checks passed
@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

✋ 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

@OSBotify

Copy link
Copy Markdown
Contributor

🚀 Deployed to staging by https://github.com/roryabraham in version: 9.5.27-0 🚀

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

@MelvinBot

Copy link
Copy Markdown
Contributor

No help site update needed. This PR moves existing menu rows to the new MenuItem component API. It keeps the same labels, values, and navigation, so no help article becomes inaccurate.

@OSBotify

OSBotify commented Nov 2, 2026

Copy link
Copy Markdown
Contributor

🚀 Deployed to production by https://github.com/blimpich in version: 9.5.27-2 🚀

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