Skip to content

[SelectionList ListItem] Replace the isRecommended config prop on TravelDomainListItem with composition #101800

Open

Description

@MelvinBot

Problem

TravelDomainListItem takes an isRecommended boolean on its item type and uses it purely to decide whether to render a child component — a Badge:

This is configuration, not data. It also drags a travel-specific concern (the travel.domainSelector.recommended copy and the Badge import) into the shared SelectionList/ListItem layer, which is exactly what [$1000] [Tracking] SelectionList ListItem - Composition over Configuration is decomposing away.

Scope

There is exactly one consumer, so this is a small, self-contained change:

Proposed direction

Delete isRecommended and let the page own the badge. Two options worth weighing in the PR:

  1. Compose the row at the call site. DomainSelectorStep builds the row from SelectableListItem + ListItemComposed.Title + its own Badge, and TravelDomainListItem is either deleted from src/components/SelectionList/ListItem/ or moved next to the travel page as a local row. This keeps the shared ListItem layer free of travel copy.
  2. Pass the element as data. The page sets the Badge element on the item (actionElement / rightElement — the slots at ListItem/types.ts:60-66) and the shared row renders whatever it is given. Less churn, but the badge sits in the data array rather than in JSX.

Option 1 matches the composition direction in the tracking issue; option 2 is the cheaper fallback if the badge must stay inline between the title and the row end.

Acceptance criteria

  • isRecommended no longer exists on any SelectionList ListItem type.
  • Badge and travel.domainSelector.recommended are no longer referenced from src/components/SelectionList/.
  • The domain selector still shows the "Recommended" badge on the most frequent admin email domain, and only on that row.
  • Existing tests for the travel domain selector still pass, with coverage added for the composed row.

Context

Follow-up from roryabraham's review comment on SelectionList ListItem decomposition - sweep and flag deletion, raised as NAB because the prop already existed.

Part of [$1000] [Tracking] SelectionList ListItem - Composition over Configuration.

Issue OwnerCurrent Issue Owner: @truph01

Activity

  1. added and removed
    ReviewingHas a PR in review
    on Oct 1, 2026
  2. melvin-bot commented on Oct 1, 2026

    @melvin-bot

    @roryabraham @jmusial

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

  3. roryabraham commented on Oct 2, 2026

    @roryabraham
    Contributor

    Done. $175 will be due to @truph01

  4. truph01 commented on Oct 14, 2026

    @truph01
    Contributor

    Contributor+ Checklist:

    • [Contributor] The offending PR and associated issue have been commented on, pointing out the bug it caused and why, so the author and reviewers can learn from the mistake.

      Link to the comment on the PR:
      Link to the comment on the Issue:

    • [Contributor] If the regression was CRITICAL (e.g. interrupts a core flow) A discussion in #expensify-open-source has been started about whether any other steps should be taken (e.g. updating the PR review checklist) in order to catch this type of bug sooner.

      Link to discussion:

    • [Contributor] If it was decided to create a regression test for the bug, please propose the regression test steps using the template below to ensure the same bug will not reach production again.

    Regression Test Proposal

    Precondition:

    Test:

    Precondition: paid group workspace, 2+ private email domains, isTravelVerified beta on, account validated.

    1. Open app > Workspace settings > More features > toggle Travel on.
    2. Navigate to Workspace > Travel > press "Let's gol" to enter the enable travel flow.
    3. Verify that on the "domain" step each row shows a radio on the left with the domain text.
    4. Verify that only the most frequent admin email domain shows the "Recommended" badge at the right edge of its row.

    Do we agree 👍 or 👎

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

Metadata

Metadata

Labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions