Skip to content

[$175] MenuItem decomposition Phase 3 — MenuItemWithTopDescription replacement preset #100312

Open

Description

@MelvinBot

Phase 3 — MenuItemWithTopDescription replacement preset

Part of the MenuItem decomposition rollout plan. Phase 1 landed in #97339 (MenuItemNavigation / MenuItemAction), Phase 2 in #98862 (MenuItemAvatarNavigation), Phase 4 is tracked in #100159. This is the biggest and most invasive phase.

Scope

Replace MenuItemWithTopDescription — today a 3-line wrapper that just sets shouldShowBasicTitle + shouldShowDescriptionOnTop on the monolith — with a real field-row preset built on the composition primitives, and migrate its call sites.

This is the form/detail row used across the whole app: label on top, value below, inline errorText / hintText, and helperText outside the pressable.

Already in flight: #100191 (draft) introduces MenuItemField (replacing MenuItemEmptyField), splits the text leaves into Title / Description / FieldName / FieldNamePlaceholder / FieldValue over two shared bases, re-keys the accessibility slots by line (top/bottom) rather than role, and migrates ~107 sites across 55 screens. This issue tracks the whole phase, of which that PR is the first slice.

Verified inventory

At c408634: 439 <MenuItemWithTopDescription call sites across 219 files — comfortably the largest cluster in the plan, and ~2.5× the direct MenuItem count.

Prop counts below are occurrences within a 14-line window after each opening tag, so treat them as close approximations rather than exact — but the ordering is what matters for batching.

Prop ~Sites Note
brickRoadIndicator ~105 The single most common prop on this shape, and the compound API has no leaf for it yet. Heavily concentrated in workspace/accounting connection rows.
interactive={false} ~96 Read-only detail rows — no press target, no chevron. Worth confirming these still render as a single a11y element.
numberOfLinesTitle ~54 Almost always 1 or 2; belongs on MenuItem.FieldValue, not on the preset.
errorText ~32 Renders inside the pressable at MenuItem.tsx:1274-1281.
hintText ~31 Also inside the pressable, MenuItem.tsx:1283-1291.
titleComponent ~30 Escape hatch — a caller-supplied node in the value slot. Candidate for MenuItem.Content children instead of a prop.
copyValue ~21 Long-press-to-copy affordance.
helperText ~17 Renders outside the pressable, MenuItem.tsx:1297-1304 — same inside/outside split shawnborton settled for the label.
shouldRenderAsHTML ~14 Plus shouldParseTitle (~6) and shouldParseHelperText.
furtherDetails ~8 Third text line.
shouldShowRightComponent ~4 Long-tail — may belong in Phase 6.

The gap this phase has to close

The compound surface exported from MenuItem/index.ts is currently Root / Row / Leading / Content / Trailing / Icon / Title / Description / DescriptionPlaceholder / Chevron / RightLabel. Three things the field shape needs have no primitive yet:

  1. MenuItem.BrickRoadIndicator — a Trailing leaf. It's in the plan's original API sketch but hasn't been built, and it's the most-used prop on this shape.
  2. MenuItem.Error / MenuItem.Hint — the inline FormHelpMessage pair, rendered inside Root below the row.
  3. A home for helperText — it sits outside the pressable, so it's a sibling of Root, exactly like the label in MenuItemWithLabel. Decide whether that's a preset concern or a MenuItem.HelperText leaf.

Work

  • Land MenuItemWithTopDescription decomposition - simplest usages #100191 — MenuItemField preset + the text-leaf split + the ~107 simplest migrations.
  • Add the missing primitives above, each with a Storybook comparison card.
  • Batch the remaining ~330 sites by prop shape, not by page — one PR per cluster, so each diff is the same decision reviewed once:
    1. plain name + value rows (largest, mostly covered by MenuItemWithTopDescription decomposition - simplest usages #100191)
    2. interactive={false} read-only rows
    3. brickRoadIndicator rows (the accounting-connection cluster)
    4. errorText / hintText rows
    5. helperText rows
    6. titleComponent / furtherDetails / HTML-parsing escape hatches
  • Extend the MenuItemComparison gallery with a card per prop shape as each cluster lands. Per the plan, the gallery is the primary visual-parity gate for this phase — reach is highest here, so if every scenario is covered visually the broad migration is safe.
  • Verify accessibility per cluster. Field rows invert the announce order relative to navigation rows (MenuItem.tsx:656 branches on shouldShowDescriptionOnTop), and brickRoadIndicator appends "your review is required" at :663. Both behaviors must survive.
  • Deprecate MenuItemWithTopDescription once the count reaches zero, and drop shouldShowBasicTitle / shouldShowDescriptionOnTop from the monolith.

Out of scope

  • The 3 HighlightableMenuItemWithTopDescription sites and HighlightableMenuItem / FocusableMenuItem / MenuItemList / PopoverMenu v2 rows — Phase 5.
  • Layout style props (outerWrapperStyle, innerContainerStyle, …) — Phase 4 ([$175] MenuItem decomposition Phase 4 — style-prop remnants #100159). Text-level style props (titleStyle, descriptionTextStyle, labelStyle, helperTextStyle, errorTextStyle) belong here, since they attach to the leaves this phase creates.
  • Rows with 10+ props that fit no preset — Phase 6.

Notes

  • Incremental and opt-in — the legacy <MenuItem … /> config API stays untouched.
  • Pure refactor: every migrated row must render identically to its old output. No behavioral or visual change.
  • Cross-cutting rule still applies: no preset grows a prop for a minority need. A row that outgrows MenuItemField drops to raw composition instead.

Parent: #96202

Upwork Automation - Do Not Edit
Issue OwnerCurrent Issue Owner: @Pujan92

Activity

  1. war-in commented on Sep 9, 2026

    @war-in
    Contributor

    @roryabraham the first part of this issue is approved by @Pujan92 and waiting for your review - #100191

    I'm currently working on the next MenuItemWithTopDescription batch here - #100704 (we need to wait for the previous PR to be merged)

  2. roryabraham commented on Sep 9, 2026

    @roryabraham
    Contributor

    #100191 merged

  3. melvin-bot commented on Sep 9, 2026

    @melvin-bot

    ⚠️ Looks like this issue was linked to a Deploy Blocker here

    If you are the assigned CME please investigate whether the linked PR caused a regression and leave a comment with the results.

    If a regression has occurred and you are the assigned CM follow the instructions here.

    If this regression could have been avoided please consider also proposing a recommendation to the PR checklist so that we can avoid it in the future.

  4. melvin-bot commented on Sep 9, 2026

    @melvin-bot

    ⚠️ Looks like this issue was linked to a Deploy Blocker here

    If you are the assigned CME please investigate whether the linked PR caused a regression and leave a comment with the results.

    If a regression has occurred and you are the assigned CM follow the instructions here.

    If this regression could have been avoided please consider also proposing a recommendation to the PR checklist so that we can avoid it in the future.

  5. war-in commented on Sep 10, 2026

    @war-in
    Contributor

    The above deploy blockers are just noise here. More details about the blocker here - #100771 (comment)

  6. 120 remaining items

  7. MelvinBot commented on Nov 15, 2026

    @MelvinBot
    ContributorAuthor

    Status — Nov 15: nine more migration PRs merged

    Since the Nov 3 update, these batches have merged:

    The Wallet deployment notice confirms production version 9.5.37-1 on Nov 13; its seven-day regression window runs through Nov 20. Other entries above are confirmed merged, not necessarily deployed.

    Next: inventory the remaining top-description rows and select the next batch, coordinating shared wrappers with Phase 5 and complex rows with Phase 6. No currently open PR was found linking this phase. The previous 66-site count is stale and was not recounted for this update.

    This remains code work, not just a payment hold. Current labels are Daily and Skip Payment.

  8. Pujan92 commented on Nov 15, 2026

    @Pujan92
    Contributor

    @MelvinBot create a PR - add an isCompact prop to MenuItem.Root that reproduces legacy viewMode={CONST.OPTION_MODE.COMPACT}: apply styles.alignItemsCenter and styles.optionRowCompact on the pressable, and share the flag through MenuItem context so MenuItem.Content uses StyleUtils.getMenuItemTextContainerStyle(isCompactPopover || isCompact) (no style prop on Content). Then migrate these 6 compact rows to the composable API, keeping each row's existing sentryLabel, onPress, selection/checkmark and right-side content, and removing their seatbelt entries: src/components/Search/FilterComponents/DatePresetFilterBase.tsx:423 and :432, src/components/Search/FilterComponents/ReportField/index.tsx:294, src/components/Search/FilterDropdowns/AmountPopup.tsx:159, src/pages/workspace/companyCards/WorkspaceCompanyCardStatementCloseDateSelectionList/index.tsx:157, and src/pages/home/UpcomingTravelSection/UpcomingTravelItem.tsx:113.

    Mark it ready for review and write QA steps in the description

  9. Pujan92 commented on Nov 15, 2026

    @Pujan92
    Contributor

    @MelvinBot create a PR - add an optional isLoading prop to the MenuItem icon leaves (MenuItem.Icon and MenuItem.IconNarrow, implemented once in src/components/MenuItem/leaves/leading/base/BaseMenuItemIcon.tsx) that reproduces legacy shouldShowLoadingSpinnerIcon: when true, render <ActivityIndicator color={theme.textSupporting} /> inside a View with the same slot style instead of the glyph, so the row's text doesn't shift. Then migrate these 4 rows to the composable API, keeping their existing sentryLabels and removing their seatbelt entries: in src/pages/Travel/DynamicTripDetailsPage.tsx:149 ("Modify trip", style={styles.mt3}) and :165 ("Trip support"), use MenuItem.Root with the same onPress wrapped in callIfAuthenticated, isDisabled={isLoading || isOffline}, a Leading MenuItem.Icon with isLoading, a MenuItem.Title, and a Trailing MenuItem.NewWindowIcon (not ExternalLink, since the URL is generated asynchronously); in src/pages/iou/request/step/IOURequestStepDistanceGPS/Waypoints/index.tsx:82 ("Start") and :92 ("Stop"), use a non-interactive MenuItem.Root (no onPress) with style={styles.pv3}, a Leading MenuItem.IconNarrow with isLoading, and MenuItemField.Content with the start/stop label as the name and the existing address/"..." title as the value.

    Mark it ready for review and write QA steps in the description

  10. MelvinBot commented on Nov 15, 2026

    @MelvinBot
    ContributorAuthor

    🤖 Web test steps verification results: ❌ fail

    All five assertions remain unverified because the app rendered a blank page and snapshots returned zero nodes.
    Blank dev NewDot blocking compact menu verification

    Step Status
    Custom date/range and preset checkmarksBlocked by blank app.
    ⚠️
    Amount modifiers and formatted valuesBlocked by blank app.
    ⚠️
    Report-field labels, values, and navigationBlocked by blank app.
    ⚠️
    Company-card custom close dateEmpty/filled states, error indicator, picker, and selection remain unverified.
    ⚠️
    Upcoming travelIcons, typography, cancellation styling, and navigation remain unverified.
    ⚠️

    Created Add compact sizing to composable MenuItem and migrate six rows, ready for review, assigned to Pujan92, with QA steps.

    Implemented isCompact, migrated all six sites, and removed their deprecation seatbelts. 148 targeted tests, lint, typecheck, direct compiler checks, formatting, and Storybook smoke passed. Full-suite timeout and browser limitations are documented in the PR.


    view run · no recording available

  11. MelvinBot commented on Nov 15, 2026

    @MelvinBot
    ContributorAuthor

    🤖 Web test steps verification results: ⚠️ partial

    Verification was blocked on dev NewDot web: no trip fixture was available in the exposed UI or setup tools, and GPS tracking requires the phone app. No behavioral pass is claimed.
    GPS tracking requires the phone app

    Step Status
    Travel titles and iconsNo trip fixture available.
    No trip fixture available for loading icon verification
    ⚠️
    Travel spinners and stable text positionBlocked by missing trip fixture.
    ⚠️
    Travel actions disabled offlineMissing fixture; offline emulation unavailable.
    ⚠️
    Travel actions disabled while loadingBlocked by missing trip fixture.
    ⚠️
    GPS read-only rows and labelsWeb directs users to the phone app.
    GPS tracking requires the phone app
    ⚠️
    GPS loading ellipses and spinnersGPS tracking unavailable on web.
    ⚠️
    GPS icon restoration and spacingGPS tracking unavailable on web.
    ⚠️

    Created Add loading states to MenuItem icons and migrate four rows, ready for review, assigned to Pujan92, with QA steps.

    Shared isLoading support and all four migrations are complete; seatbelts removed. 90 targeted tests, lint, typecheck, direct compiler checks, formatting, and Storybook smoke passed. Remaining verification limits are documented.


    view run · no recording available

  12. mallenexpensify commented on Nov 16, 2026

    @mallenexpensify
    Contributor

    Please comment and tag me if/when payment is due, thx

  13. melvin-bot commented on Nov 16, 2026

    @melvin-bot
  14. roryabraham commented on Nov 16, 2026

    @roryabraham
    Contributor

    @MelvinBot what code work remains on this issue?

  15. MelvinBot commented on Nov 16, 2026

    @MelvinBot
    ContributorAuthor

    There is still migration work—not just QA/payment. Recounted on current main at 51fc66d: 30 production <MenuItemWithTopDescription> sites across 24 files, excluding Storybook.

    What remains

    1. Land the existing compact-sizing PR. It is open, awaiting review and visual verification. It removes 2 of those sites; the other four migrations are ordinary legacy menu rows. That leaves 28 sites.

    2. Migrate the six smaller remaining rows:

    3. Assign the remaining 20 complex rows to this phase or Phase 6 — long-tail cleanup. These include money-request details, travel previews, picker components, card details, workspace/profile fields, and expense-rule rows. All have 10+ explicit props, but that alone doesn’t establish Phase 6 ownership—the agreed criterion also requires that they fit no preset.

    4. Resolve two wrapper dependencies with Phase 5 — shared wrappers: the highlightable wrapper and the NetSuite form wrapper. The latter appears unused and is a removal candidate.

    Finally, finish comparison-gallery/accessibility coverage and remove the already-deprecated legacy wrapper once its dependencies are gone.

    The original missing-primitives list is stale; those primitives exist, and loading-icon support has merged. The immediate next step is the six-row batch plus an explicit Phase 3/5/6 ownership split.


    view run

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

Metadata

Metadata

Labels

DailyKSv2Skip PaymentSkips all the payment process steps for an issue. Use it for fixed-price projects.

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions