Skip to content

Add compact sizing to composable MenuItem and migrate six rows - #106945

Open
MelvinBot wants to merge 1 commit into
mainfrom
claude-compactMenuItemRows
Open

MelvinBot wants to merge 1 commit into
mainfrom
claude-compactMenuItemRows

Conversation

@MelvinBot

Copy link
Copy Markdown
Contributor

Explanation of Change

Adds isCompact to MenuItem.Root to preserve legacy compact sizing while migrating the six requested JSX sites to composition:

  • Search Custom date and Custom range, report-field filter rows, and Amount modifier rows.
  • Company-card statement custom close date, including its empty state and error indicator.
  • Home Upcoming travel, including the reservation icon, bold destination, subtitle, cancelled styling, and existing ungated navigation.

The pressable applies alignItemsCenter and optionRowCompact. Context shares compactness with MenuItem.Content, which uses getMenuItemTextContainerStyle(isCompactPopover || isCompact) without adding a style prop. MenuItem.Trailing uses the same flag so a chevron's normal minimum height cannot enlarge an otherwise compact row. Existing Sentry labels, actions/authentication gates, chevrons, and selection lists/checkmarks are preserved. Removes the five deprecation seatbelt entries covering the six sites.

AI Tests

  • Passed: 148 targeted tests across 8 suites, including 9 new compact-sizing cases covering breakpoints, compact popovers, content/trailing spacing, density changes, and presses.
  • Passed: full lint, changed-file lint, typecheck, spell check, direct React Compiler checks of changed components, Storybook smoke, unused-style check, and the commit hook's oxfmt run on all 10 changed TSX files.
  • Full Jest was attempted and timed out after 240 seconds; no failing suite was reported before timeout. The targeted suites above passed separately.
  • Compiler check-changed could not resolve origin/ because the base-ref variable is empty in this environment; direct per-component compiler checks passed instead.
  • The legacy prettier npm script no longer exists; formatting was performed successfully by the oxfmt commit hook.
  • Inline review completed with no remaining violations or correctness concerns.
  • Browser verification was blocked by a blank dev NewDot page (zero UI nodes). All five screen groups and narrow/wide visual parity remain unverified; this is not a confirmed product regression. Native platforms, offline behavior, and screen-reader interaction were not tested.
Contributor branch ownership

This PR uses an upstream branch because Melvin cannot push to Pujan92's fork. To copy it to your fork:

git remote add upstream https://github.com/Expensify/App.git
git fetch upstream claude-compactMenuItemRows
git checkout -b claude-compactMenuItemRows upstream/claude-compactMenuItemRows
git push -u origin claude-compactMenuItemRows

You can then close this PR and open one from your fork if desired.

Fixed Issues

$ #100312
PROPOSAL: #100312 (comment)

Tests

// TODO: The human co-author must fill out the tests they ran. Automated checks and the blocked browser attempt are recorded in AI Tests above.

  • Verify that no errors appear in the JS console

Offline tests

  1. After loading the affected screens, disconnect the network. Verify date, amount, and report-field pickers still open and update their local selections, with the same labels, chevrons, and compact spacing.
  2. For a loaded company-card feed, change the custom statement close day offline and verify pending/error feedback remains intact; reconnect and confirm the update syncs.

QA Steps

Run these checks on wide desktop web and narrow mobile web, then on supported native platforms. These are proposed QA steps, not completed manual verification. Compare row heights, text spacing, and hover/pressed feedback with the current production build.

  1. Sign in and open Reports/Search → Date. Confirm Custom date and Custom range have compact spacing and right chevrons when empty. Select a preset and confirm only its existing checkmark is selected.
  2. Open Custom date, choose a date and the supported On/Before/After modifier, and apply. Reopen the filter and confirm its formatted description. Open Custom range, choose both dates and apply; reopen, edit, and clear it. Confirm navigation and descriptions are unchanged and no extra row height appears in empty states.
  3. Open Search → Amount. For each of the five comparison modifiers, open the amount editor, enter an amount, apply, and reopen. Verify formatted values, currency behavior, back navigation, chevrons, and compact row spacing with and without values.
  4. Use a workspace with text, list, and date report fields. Open Search filters → Report fields. Verify each row's name, empty/filled value, right chevron, compact spacing, and navigation to its corresponding editor. Apply a value and confirm it remains visible when reopened.
  5. As a workspace admin with a company-card feed, open Company cards → feed settings → Statement close date. Select Custom day of month. Before choosing a day, save and verify the required error and row's red indicator. Open the compact Custom close date row, choose a day, and confirm its value, chevron, and the selected option's checkmark. Save and reopen; verify the day persists. Other close-date options must still work.
  6. With upcoming reservations available, open Home → Upcoming travel. Check the reservation icon, relative-time/type subtitle above the bold destination, card insets, and right chevron. Open a trip and confirm correct trip details. Repeat with a cancelled reservation and confirm its cancellation label, icon, and muted bold destination remain unchanged.
  7. Tab through the migrated rows and activate them with the keyboard. Check accessible names follow the visible text order, existing selection/error announcements remain available, and an ordinary noncompact menu row has unchanged spacing.
  • Verify that no errors appear in the JS console

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

Browser testing was blocked before any product assertion could be verified:

Blank dev NewDot blocking compact menu verification

Co-authored-by: Pujan Shah <Pujan92@users.noreply.github.com>
@MelvinBot
MelvinBot requested review from a team as code owners November 15, 2026 12:19
@melvin-bot melvin-bot Bot added Melvin-Test-Android Melvin-Test-Web Triggers Melvin to run the testing steps of the PR on web labels Nov 15, 2026
@expensify-chore-bot
expensify-chore-bot Bot requested review from a team, Pujan92 and twisterdotcom and removed request for a team November 15, 2026 12:19
@expensify-chore-bot

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]

@expensify-chore-bot
expensify-chore-bot Bot removed the request for review from a team November 15, 2026 12:19
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 15, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-15T12:22:07.053560Z 871036f PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@MelvinBot

MelvinBot commented Nov 15, 2026 •

Copy link
Copy Markdown
Contributor Author

🤖 Web test steps verification results: ⚠️ partial

Tested dev NewDot web at 1440×1000 and 390×844, but verification remained incomplete after Date-filter interaction failures; no product regression or production visual parity was established.
Spend rendered at a 390×844 narrow web viewport

Step Status
Date rows and preset selectionCustom date, Custom range and preset radios appeared. Automation could not activate the preset because the target lacked usable bounds or was covered by a dialog. Spacing, chevrons and exclusive selection remain unverified.
❌
Custom date/range editing and persistenceBlocked before entering the editors. Modifiers, descriptions, persistence, clearing and empty-state height were not verified.
❌
Amount modifiers and editorsNot reached before the interaction safety budget was exhausted.
❌
Report-field filtersNot reached; text, list and date field fixtures were not established.
❌
Company-card statement close dateNot reached; an administered company-card feed fixture was not established.
❌
Upcoming travel and cancelled reservationsHome showed no Upcoming travel or reservations, and no reservation-fixture tool was available. Presentation and navigation remain unverified.
Wide desktop Home without Upcoming travel
❌
Keyboard and accessibility behaviorDate presets exposed radio names and custom rows exposed button names. Keyboard traversal, activation, announcements and ordinary-row spacing were not verified.
❌
No JavaScript console errorsUnverified: console inspection was unavailable through the supported testing interface. Interaction failures do not establish JavaScript errors.
❌
Offline search pickersNetwork control was unavailable. Narrow web rendered Spend, but narrow picker behavior and offline selections were not verified.
Spend rendered at a 390×844 narrow web viewport
❌
Offline statement close date and synchronizationBlocked by unavailable network control and the missing company-card feed fixture. Pending/error feedback and synchronization were not tested.
❌

view run · view recording

/** Whether the row responds to interactions */
isInteractive: boolean;

isCompact: boolean;

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-10 (docs)

The new isCompact member is added to MenuItemConfig with no /** ... */ comment, while every sibling in this type is documented. Its meaning is non-obvious: unlike isCompactPopover, it selects legacy compact row sizing independently of the compact-popover breakpoint, which is exactly the kind of sibling distinction that needs a comment.

Document it the same way the prop is documented in MenuItemRoot.tsx:

/** Whether the row uses legacy compact sizing, independently of compact-popover styling */
isCompact: boolean;

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

@codecov

codecov Bot commented Nov 15, 2026 •

Copy link
Copy Markdown

@MelvinBot

MelvinBot commented Nov 15, 2026 •

Copy link
Copy Markdown
Contributor Author

🤖 Android test steps verification results: ⚠️ partial

Date and Amount flows were partially verified on standalone Android NewDot before the testing step limit was reached; no product defect was established. Production visual comparison was unavailable.
Visible Amount titles precede their formatted descriptions

Step Status
Date compact rows and preset selectionSelecting This month checked only that preset. Custom rows exposed right chevrons, and the empty Custom date appeared compact beside the filled range. Both custom rows together while empty remain unverified.
This month is the sole checked preset
Compact custom date and range rows with right chevrons
⚠️
Custom date and rangeOn, Before and After descriptions applied correctly, and reopening retained the date. A November 3–10 range applied, reopened and was edited to November 4–10. Clearing and reopening after editing were not completed.
Applied range displayed as Nov 3–10, 2026
⚠️
Amount modifiersAll five rows opened their editors and displayed formatted applied values. USD-to-EUR currency changes and Back navigation worked. Inclusive bounds persisted after reopening; chevrons and compact empty rows were present. Individual editor reopening was not repeated for every modifier.
Reopened Amount picker with compact empty rows and persisted inclusive bounds
⚠️
Workspace report fieldsNot exercised before the testing step limit; fixture availability remains unknown.
⚠️
Statement close dateNot exercised before the testing step limit; company-card feed fixture availability remains unknown.
⚠️
Upcoming travelThe initial Home screen did not expose Upcoming travel. No reservation fixture was established, so active/cancelled presentation and navigation remain untested.
⚠️
Keyboard and accessibilityAccessibility read-back exposed Date selection states and Amount button names with titles before formatted values. Keyboard activation, spoken/error announcements and noncompact-row comparison remain unverified.
Visible Amount titles precede their formatted descriptions
⚠️
No JavaScript console errorsNo visible crash or error overlay appeared during completed flows. Console access was denied, so absence of JavaScript errors cannot be confirmed.
⚠️
Offline local pickersOffline testing was blocked because airplane-mode control was denied. Offline selections and spacing remain unverified.
⚠️
Offline statement close date and synchronizationNot exercised: offline controls were denied and no company-card feed fixture was established.
⚠️

view run · view recording

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

No product review required. This is a component migration.

This branch has not been deployed

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

Labels

Melvin-Test-Android Melvin-Test-Web Triggers Melvin to run the testing steps of the PR on web

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants