Skip to content

MenuItem decomposition - description text style - #102263

Merged
roryabraham merged 18 commits into
Expensify:mainfrom
software-mansion-labs:war-in/menuitem-decomposition-description-text-style
Oct 8, 2026
Merged

roryabraham merged 18 commits into
Expensify:mainfrom
software-mansion-labs:war-in/menuitem-decomposition-description-text-style

Conversation

@war-in

@war-in war-in commented Sep 25, 2026 •

Copy link
Copy Markdown
Contributor

Explanation of Change

Migrates rows using descriptionTextStyle/shouldIconUseAutoWidthStyle to the composable MenuItem API. Element values go in MenuItemField.Content, the one-off 15px names become 13px, and new MenuItem.IconNarrow replaces auto-width icons. The a11y context splits label/announcement registries, so rows with an explicit label keep announcements.

Fixed Issues

$ #100159
PROPOSAL:

Tests

  1. Open a trip room with flight, train, car and hotel reservations and tap each reservation to open its details

  2. Verify that take-off/landing, departs/arrives, pick-up/drop-off and check-in/check-out show a small field name above the large time, with the location text under the flight, train and car rows

  3. Verify that the passenger/driver/guest row shows the name above the user pill, and that the hotel address and flight times can still be copied (hover button on web, long press on mobile)

  4. Go to Workspace > Distance rates, open a rate

  5. Verify that Name, Rate, Start date, End date and Tax reclaimable on show their field names at the same size as the Tax rate row

  6. Go to Workspace > Rules, start creating a "Flag for review" rule and tap Save without picking a category

  7. Verify that the Category row shows the folder icon right next to the text (no wide gap) and the "This field is required" error under the row

  8. Go to Search and open the Display popup on a wide screen, then on a narrow screen

  9. Verify that the "Edit columns" row has a compact icon on the wide screen and the regular icon on the narrow screen, and that tapping it opens the columns editor

  10. With a screen reader on, create an expense in a workspace that requires attendees, clear the attendees and try to submit

  11. Verify that the Attendees row is announced with its attendee names followed by "Your review is required"

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 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 war-in changed the title MenuItem decomposition - description text style [HOLD #102170] MenuItem decomposition - description text style Sep 25, 2026
@codecov

codecov Bot commented Sep 25, 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/index.ts 100.00% <ø> (ø)
src/components/MenuItem/layout/MenuItemRoot.tsx 96.77% <100.00%> (-0.20%) ⬇️
...omponents/MenuItem/leaves/leading/MenuItemIcon.tsx 100.00% <100.00%> (ø)
.../MenuItem/leaves/leading/base/BaseMenuItemIcon.tsx 100.00% <100.00%> (ø)
...micReportDetailsPage/ReportDetailsTitleSection.tsx 93.61% <ø> (ø)
...usinessInfo/subSteps/TypeBusiness/TypeBusiness.tsx 8.33% <ø> (+0.33%) ⬆️
src/pages/Travel/FlightTripDetails.tsx 100.00% <100.00%> (ø)
src/pages/Travel/HotelTripDetails.tsx 96.77% <100.00%> (ø)
.../pages/settings/Wallet/ExpensifyCardPage/index.tsx 70.81% <ø> (ø)
...yCard/DynamicWorkspaceExpensifyCardDetailsPage.tsx 0.00% <ø> (ø)
... and 16 more
... and 719 files with indirect coverage changes

…xt-style

# Conflicts:
#	src/components/MenuItem/index.ts
#	src/components/MoneyRequestConfirmationList/sections/AttendeeField.tsx
@war-in war-in changed the title [HOLD #102170] MenuItem decomposition - description text style MenuItem decomposition - description text style Sep 30, 2026
@war-in
war-in marked this pull request as ready for review September 30, 2026 14:43
@war-in
war-in requested review from a team as code owners September 30, 2026 14:43
@melvin-bot
melvin-bot Bot requested review from Pujan92 and garrettmknight and removed request for a team September 30, 2026 14:43
@melvin-bot

melvin-bot Bot commented Sep 30, 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 September 30, 2026 14:43
@war-in

war-in commented Sep 30, 2026

Copy link
Copy Markdown
Contributor Author

@Pujan92 PR's ready for review!

const {translate} = useLocalize();
const styles = useThemeStyles();
const {isLargeScreenWidth} = useResponsiveLayout();
const {isLargeScreenWidth, isSmallScreenWidth} = useResponsiveLayout(); // eslint-disable-line rulesdir/prefer-shouldUseNarrowLayout-instead-of-isSmallScreenWidth

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.

❌ CONSISTENCY-5 (docs)

This line disables the rulesdir/prefer-shouldUseNarrowLayout-instead-of-isSmallScreenWidth rule with eslint-disable-line but carries no comment explaining why isSmallScreenWidth is used here instead of the preferred shouldUseNarrowLayout. Unjustified disables hide the violation from the seatbelt baseline permanently, so a reviewer or future maintainer can't tell whether the suppression is intentional or an oversight.

Either add a justification comment explaining why the raw isSmallScreenWidth is genuinely needed here (e.g. the icon variant must key off the actual screen width, not the RHP-aware narrow-layout flag), or, if this is a temporary convenience, drop the disable and widen the baseline with SEATBELT_INCREASE instead so the violation stays visible. For example:

// isSmallScreenWidth is intentional here: the icon width must follow the real viewport, not the RHP narrow-layout flag
const {isLargeScreenWidth, isSmallScreenWidth} = useResponsiveLayout(); // eslint-disable-line rulesdir/prefer-shouldUseNarrowLayout-instead-of-isSmallScreenWidth

Reviewed at: f96ed56 | Please rate this suggestion with 👍 or 👎 to help us improve! Reactions are used to monitor reviewer efficiency.

war-in added 2 commits October 1, 2026 10:22
…xt-style

# Conflicts:
#	src/pages/workspace/rules/FlagForReviewRules/FlagForReviewRulePageBase.tsx
#	src/pages/workspace/rules/MerchantTypeRules/MerchantTypeRulePageBase.tsx
#	src/pages/workspace/rules/RequireFieldsRules/RequireFieldsRulePageBase.tsx
@garrettmknight
garrettmknight removed their request for review October 1, 2026 14:53
@Pujan92

Pujan92 commented Oct 2, 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-08.at.17.09.32.mov

@Pujan92

Pujan92 commented Oct 2, 2026

Copy link
Copy Markdown
Contributor

@war-in conflicts and some checks are failing

war-in added 2 commits October 5, 2026 11:20
…xt-style

# Conflicts:
#	src/pages/DynamicReportDetailsPage/index.tsx
#	src/pages/workspace/recruiting/approver/MergeATSFinalApproverMenuItem.tsx
@war-in

war-in commented Oct 5, 2026

Copy link
Copy Markdown
Contributor Author

@Pujan92 done 🫡

Comment thread src/components/MoneyRequestConfirmationList/sections/AttendeeField.tsx Outdated
<BaseMenuItemIcon
src={src}
fill={iconFill}
additionalStyles={[styles.popoverMenuIcon, isCompactPopover && styles.wAuto]}

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.

I didn't get this conversion, is it to prevent conditional styling?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, I split it so callers pick the width explicitly. DistanceCounter needs a narrow icon outside a compact popover, which the old leaf couldn't do

Comment thread src/pages/iou/request/step/IOURequestStepDistanceGPS/Waypoints/index.tsx Outdated
@Pujan92

Pujan92 commented Oct 6, 2026

Copy link
Copy Markdown
Contributor

Perf test is failing

@war-in

war-in commented Oct 6, 2026

Copy link
Copy Markdown
Contributor Author

@Pujan92 review addressed

@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 8, 2026 11:40
</MenuItem.Trailing>
)}
</MenuItem.Row>
{shouldDisplayAttendeesError && (

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.

NAB/Follow-up: shouldDisplayAttendeesError is a configuration prop.

<MenuItem.Leading>
<MenuItem.IconNarrow src={icons.Crosshair} />
</MenuItem.Leading>
<MenuItemField.Content name={translate('common.distance')}>

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.

NAB/unrelated follow-up: This code doesn't really work with internationalization. In some locales, we might not have a space between the amount and the unit, or the unit might come before the amount, or the amount and the unit might come before whatever common.distance is. This should really be a full phrase in en.ts and the other language files, with its parts styled richly as needed by react-native-render-html.

@MelvinBot create a follow-up issue for this. Assign to me, label Monthly.

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.

Created Make the GPS distance counter label a fully localized phrase. It's assigned to roryabraham and labeled Monthly.

The issue also notes that the unit is the raw mi / km value and is never translated.

@roryabraham
roryabraham merged commit 4c0f7e5 into Expensify:main Oct 8, 2026
35 of 36 checks passed
@OSBotify

OSBotify commented Oct 8, 2026

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

github-actions Bot commented Oct 8, 2026

Copy link
Copy Markdown
Contributor

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

@OSBotify OSBotify mentioned this pull request Oct 8, 2026
90 tasks done
@OSBotify

OSBotify commented Oct 8, 2026

Copy link
Copy Markdown
Contributor

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

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

@MelvinBot

Copy link
Copy Markdown
Contributor

No help site update needed. This PR only changes how existing rows are built and styled (font sizes, icon widths, accessibility announcements), and it doesn't change any feature, label, or workflow that an article describes.

@jponikarchuk

Copy link
Copy Markdown

This PR failing because of the issue #103560
This issue is reproducible in: All platforms

@war-in

war-in commented Oct 9, 2026

Copy link
Copy Markdown
Contributor Author

@jponikarchuk looking!

@OSBotify

OSBotify commented Oct 9, 2026

Copy link
Copy Markdown
Contributor

🚀 Deployed to production by https://github.com/puneetlath in version: 9.5.6-6 🚀

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