Skip to content

[$175] MenuItem decomposition Phase 4 — style-prop remnants #100159

Open

Description

@MelvinBot

Phase 4 — style-related remnants

Part of the MenuItem decomposition rollout plan. Phase 1 landed in #97339 (MenuItemNavigation / MenuItemAction); Phase 2 is tracked in #99408. This is the style-prop phase.

Scope

Most of the remaining call sites differ from a preset by nothing but a style prop — style, wrapperStyle, outerWrapperStyle, innerContainerStyle, containerStyle and their siblings. Migrate them by deciding, per prop, whether the style can move outside MenuItem or needs a named variant on the subcomponent that owns that box.

The decision this phase has to make first

The new primitives currently expose no style prop at all — MenuItemRoot.tsx:77-86 hardcodes its style array, and MenuItemRow / MenuItemContent do the same. That's the right default: a generic style passthrough on every subcomponent rebuilds the monolith one prop at a time.

So before migrating anything, settle the escape-hatch policy. For each style prop, one of:

  1. Move it to the caller — wrap the row in the caller's own View (preferred).
  2. Add a named variant to the subcomponent that owns that box.
  3. Delete it — the style is dead, or a no-op under the new layout.

Per the plan's cross-cutting rule: no preset grows a prop for a minority need.

Verified inventory

Counts are MenuItem-scoped call sites at 3a621ed, excluding the shared wrappers (Phase 5).

Prop Sites Finding
outerWrapperStyle 13 Every one is the identical expression shouldUseNarrowLayout ? styles.mhn5 : styles.mhn8. A single MenuItem.Root variant covers the whole cluster.
iconStyles ~15 Two clean clusters: [styles.ml3, styles.mr2] ×4 and the trip-reservation icon container. Rest are one-offs (styles.h7, styles.mr0, styles.wAuto).
titleContainerStyle 3 TripDetailsView, TripRoomPreview, DynamicReportDetailsPage — all gap/alignment. → MenuItem.Content variant.
titleWrapperStyle 2 DynamicSplitExpensePage, DynamicSplitExpenseEditPage — both styles.flex1.
rightIconWrapperStyle 2 DiscoverSection, UpcomingTravelItem — both styles.pl2.
innerContainerStyle 1 Only IndividualExpenseRulesSectionRevamp.tsx:237 (styles.gap5). The other 34 innerContainerStyle= hits in src are Modal/Popover, not MenuItem. Migrate the one, then drop the prop.
rootWrapperStyle 0 Declared at MenuItem.tsx:458 and threaded to :845, but no call site passes it. Straight deletion.
style / wrapperStyle / containerStyle long tail Not yet separated from non-MenuItem consumers — raw src counts (~358 wrapperStyle=, ~173 containerStyle=) are dominated by other components. The first PR should enumerate the MenuItem-scoped subset and group it; expect the same "one repeated expression per cluster" shape as outerWrapperStyle.

The full MenuItem style surface is declared at MenuItem.tsx:120-138.

All 13 outerWrapperStyle sites, for reference:

  • ReimbursementAccount/VerifiedBankAccountFlowEntryPoint ×5 — e.g. :299
  • ReimbursementAccount/USD/ConnectBankAccount/components/FinishChatCard ×3
  • ReimbursementAccount/ConnectedVerifiedBankAccount ×2
  • settings/Wallet/InternationalDepositAccount/subPages/AccountFlowEntryPoint ×2
  • ReimbursementAccount/NonUSD/Finish ×1

Work

  • Write down the escape-hatch policy (the three options above) so later phases and reviewers apply it consistently.
  • Delete rootWrapperStyle — dead prop, no consumers.
  • Migrate the single innerContainerStyle site, then remove the prop.
  • Add the MenuItem.Root bleed/full-width variant and migrate all 13 outerWrapperStyle sites in one PR — they share one expression, so it's one decision reviewed once.
  • One PR per remaining style prop, grouped by prop rather than by page, so each diff is a single repeated expression across its call sites.
  • For each migrated row: confirm the style can be applied outside MenuItem with no visual change. If it can't, add the variant and handle it inside the owning subcomponent.
  • Extend the Storybook MenuItemComparison gallery with a section per variant introduced — old config API vs. new composition side by side.

Out of scope

  • FocusableMenuItem, HighlightableMenuItem, HighlightableMenuItemWithTopDescription, MenuItemList, and the PopoverMenu v2 rows are Phase 5 — even though 2 of the 15 outerWrapperStyle= occurrences and both additionalIconStyles occurrences live in them.
  • Text-level style props (titleStyle, descriptionTextStyle, labelStyle, helperTextStyle, errorTextStyle) belong with the label/error/hint surface in Phase 3, unless one blocks a Phase 4 migration.

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.

Parent: #96202

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

Activity

  1. added
    ReviewingHas a PR in review
    and removed
    ReviewingHas a PR in review
    on Sep 2, 2026
  2. changed the title [-]MenuItem decomposition Phase 4 — style-prop remnants[/-] [+][Due for payment 2026-09-15] MenuItem decomposition Phase 4 — style-prop remnants[/+] on Sep 8, 2026
  3. melvin-bot commented on Sep 8, 2026

    @melvin-bot

    @Pujan92

    The solution for this issue has been 🚀 deployed to production 🚀 in version 9.4.73-3 and is now subject to a 7-day regression period 📆. Here is the list of pull requests that resolve this issue:

    If no regressions arise, payment will be issued on 2026-09-15. 🎊

    The following checklist (instructions) will need to be completed before the issue can be closed. Please copy/paste the Contributor+ Checklist from here into a new comment on this GH and complete it. If you have the K2 extension, you can simply click: [this button]. If no checklist is needed for this issue, you can click: [no checklist button]

  4. roryabraham commented on Sep 8, 2026

    @roryabraham
    Contributor

    @MelvinBot provide a status update on this issue. Is there more code work needed, or are we just in a waiting-for-payment holding pattern?

  5. MelvinBot commented on Sep 8, 2026

    @MelvinBot
    ContributorAuthor

    More code work is needed — this isn't a pure payment hold. #99915 delivered one of the eight items in the Work list (the 13-site outerWrapperStyle cluster). Every other style prop in the inventory is still on main untouched.

    The payment automation has already run ahead of the scope, though: the title carries [Due for payment 2026-09-15] and Pujan92's C+ checklist is still outstanding. So you have two things to reconcile.

    What's still open, verified at bc098e0

    Work item Status
    outerWrapperStyle × 13 ✅ Done in #99915 — moved to caller-owned Views, no new variant needed
    Delete rootWrapperStyle (dead prop) ❌ Still declared at MenuItem.tsx:396 and threaded to :780
    Migrate the one innerContainerStyle site, drop the prop ❌ Still at IndividualExpenseRulesSectionRevamp.tsx:258
    titleContainerStyle × 3 ❌ TripRoomPreview:105, TripDetailsView:160, DynamicReportDetailsPage:928 — plus a 4th the inventory missed, WorkspaceReceiptPartnersPage:260
    titleWrapperStyle × 2 ❌ DynamicSplitExpensePage:578, DynamicSplitExpenseEditPage:411
    rightIconWrapperStyle × 2 ❌ DiscoverSection:98, UpcomingTravelItem:133
    iconStyles (~15) ❌ 25 iconStyles= sites remain, including both target clusters — [styles.ml3, styles.mr2] at BankAccountPurpose:37 / CardTypeStep:92 and the trip-reservation container
    style / wrapperStyle / containerStyle long tail ❌ Never enumerated. #100585 (wrapperStyle) was opened and closed empty on Sep 8, so there's intent but no live PR
    Write down the escape-hatch policy ❌ Not in the repo — nothing under src/components/MenuItem/ or contributingGuides/ records the three options
    Extend the Storybook MenuItemComparison gallery ❌ #99915 didn't touch MenuItemComparison.stories.tsx

    Recommendation

    Pay this one out and split the remainder into Phase 4b. The title already has a payment date, so melvin-bot will close it on the 15th regardless — fighting that is more friction than filing a follow-up. This also matches how Phases 1 and 2 were handled: one issue per reviewable PR chunk rather than one issue per phase.

    Concretely:

    1. Pujan92 posts the C+ checklist so the Sep 15 payment isn't blocked. Nothing else is in the way — the last open item, m-natarajan's Test 3 / Step 6 question, was answered by war-in on Sep 8, and the PR shipped to production in 9.4.73-3.
    2. Open Phase 4b for the nine remaining items, with the escape-hatch policy write-up as the first deliverable — it gates the rest, and the outerWrapperStyle PR already established the precedent (option 1, move to caller) that the policy should codify.

    Reply with @MelvinBot create the Phase 4b issue and I'll file it against the parent, carrying the verified inventory above.

  6. war-in commented on Sep 9, 2026

    @war-in
    Contributor

    @roryabraham I'm going to take care of the other parts of that issue (enumerated by Melvin) in a future PRs. However, I'd rather wait for #100191 and the next MenuItemWithTopDescription-related PRs because they'll add more required leaves

  7. 84 remaining items

  8. Pujan92 commented on Nov 11, 2026

    @Pujan92
    Contributor

    @MelvinBot open a PR migrating 4 rows to the composable API: the GL code row in DynamicTagSettingsPage.tsx (MenuItemField, with a plain Icon lock as a child when GL codes are locked by the accounting connection, as in MerchantTypeRulePageBase b73f553), the "Disable" row in 2FA EnabledPage.tsx (MenuItem.Root, with a plain red Icon in MenuItem.Leading using styles.popoverMenuIcon, since MenuItem.Icon can't keep a fixed color), and "Create new connection" in CampfireExistingConnectionsPage.tsx / DualEntryExistingConnectionsPage.tsx (MenuItemNavigation, dropping iconStyles={styles.br2}, which is a no-op because the icon container has no background). Keep each row's existing sentryLabel unchanged and don't add or rename labels; gate presses via the presets or callIfAuthenticated(fn, session). Pure refactor, no new presets or props;

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

  9. MelvinBot commented on Nov 11, 2026

    @MelvinBot
    ContributorAuthor

    🤖 Web test steps verification results: ❌ fail

    Created MenuItem: migrate GL code, 2FA disable, and accounting connection rows, ready for review and assigned to Pujan92, with QA steps included. All four existing Sentry labels are unchanged.

    Browser verification was blocked by a blank dev session. Targeted tests passed: 9 suites, 253 tests; lint and Storybook smoke checks also passed. Other check limitations are documented in the PR.

    Blank dev NewDot web page

    Step Status
    GL code editable and accounting-locked statesNot verified: blank application prevented navigation.
    Blank dev NewDot web page
    ❌
    2FA Disable icon, navigation, and Xero warningNot verified: application controls were unavailable.
    ❌
    Campfire and DualEntry connection rowsNot verified: blank application prevented access to Connections.
    ❌

    view run · no recording available

  10. changed the title [-]MenuItem decomposition Phase 4 — style-prop remnants[/-] [+][$175] MenuItem decomposition Phase 4 — style-prop remnants[/+] on Nov 11, 2026
  11. melvin-bot commented on Nov 11, 2026

    @melvin-bot
  12. melvin-bot commented on Nov 13, 2026

    @melvin-bot

    @Pujan92

    The solution for this issue has been 🚀 deployed to production 🚀 in version 9.5.37-1 and is now subject to a 7-day regression period 📆. Here is the list of pull requests that resolve this issue:

  13. MelvinBot commented on Nov 15, 2026

    @MelvinBot
    ContributorAuthor

    Status — Nov 15: two more batches merged; latest deployment in regression

    Since the Nov 3 update:

    No currently open PR was found linking this phase. Next: refresh the remaining style-prop inventory and choose the next batch; these partial migrations do not complete the phase. The previous 49-direct-site count is stale and was not recounted here.

    Current labels are Daily and Skip Payment. A missing C+ checklist should not be treated as the blocker: roryabraham already confirmed no checklist is needed. Remaining code work is the reason to keep this open.

  14. roryabraham commented on Nov 16, 2026

    @roryabraham
    Contributor

    Next: refresh the remaining style-prop inventory

    @MelvinBot do this.

  15. MelvinBot commented on Nov 16, 2026

    @MelvinBot
    ContributorAuthor

    Refreshed style-prop inventory

    Verified on main at 51fc66d.

    49 direct legacy rows remain: 20 MenuItem and 29 MenuItemWithTopDescription. Of these, 31 have known layout-style overrides. This excludes stories, shared-wrapper implementations, and text-style props.

    Remaining props

    Counts include styles supplied through the two traced props-object spreads. Rows can appear under multiple props.

    Prop Sites Under 10 JSX attributes¹ 10+ attributes
    wrapperStyle 22 5 17
    style 9 1 8
    iconStyles 9 2 7
    innerContainerStyle 1 0 1
    hoveredStyle, badgeStyle, avatarImageStyles, tooltipWrapperStyle 1 each 0 1 each
    outerWrapperStyle, additionalIconStyles 0 direct sites — —

    rootWrapperStyle, containerStyle, titleContainerStyle, titleWrapperStyle, and rightIconWrapperStyle are no longer part of the legacy prop declaration.

    ¹ A spread counts as one JSX attribute, following the existing phase-counting convention. That makes two complex rows look artificially small, as detailed below.

    Complete under-10 style-bearing inventory

    Row Remaining override
    DynamicFlagCommentPage:148 style={[styles.pt2, styles.pb4, styles.ph5, styles.flexRow]}
    SupportTicketView:100 wrapperStyle={[styles.pv2]}
    CustomUnitDefaultCategorySelector:44 Forwarded wrapperStyle
    AttachmentPicker/index.native:655 Focus-dependent wrapperStyle from getItemBackgroundColorStyle(...); native-only
    PaymentMethodListItem:278–317 Spread supplies wrapperStyle: [styles.paymentMethod, listItemStyle] and iconStyles: item.iconStyles
    WorkflowsPaymentsTab:273–295 Spread supplies wrapperStyle: styles.ph0 and iconStyles: bankIcon.iconStyles

    The last two should be treated as long-tail work, not easy Phase 4 rows: their spread objects contain substantially more than ten properties.

    Larger clusters — overlap with Phase 6

    The remaining larger rows belong with Phase 6 — long-tail cleanup:

    • style: five [styles.moneyRequestMenuItem] sites, two styles.p0 approval-workflow sites, and one conditional deleted-card style.
    • wrapperStyle: the largest repeated family is six task-description rows across trip previews, money requests, and tasks. Three more use sectionMenuItemTopDescription; the rest are individual overrides or forwarded values.
    • iconStyles: three trip-reservation icon containers; the remaining larger sites are onboarding, settings, wallet transfer, and workspace-member card rows.
    • innerContainerStyle: still IndividualExpenseRulesSectionRevamp:248, using styles.gap5.

    Do not delete outerWrapperStyle or innerContainerStyle globally yet. Phase 5 still uses them in the Highlightable wrappers and PopoverMenu.

    Recommended next batch

    Start with the two non-forwarding web rows: Flag comment and Support ticket. Keep the category-selector forwarder separate, and move the two spread-heavy payment rows into the long-tail queue.

    This was a source inventory, not visual verification. Counts describe source sites—not rendered rows—and exclude unrestricted forwarded props whose values cannot be established statically.


    view run

  16. expensify-chore-bot commented on Nov 18, 2026

    @expensify-chore-bot

    @Pujan92 Huh... This is 4 days overdue. Who can take care of this?

  17. expensify-chore-bot commented on Nov 20, 2026

    @expensify-chore-bot

    @Pujan92 6 days overdue. This is scarier than being forced to listen to Vogon poetry!

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

Metadata

Metadata

Labels

DailyKSv2OverdueSkip 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