Skip to content

Use attendee pill pattern for traveler display in trip details#91342

Merged
flodnv merged 9 commits into
mainfrom
claude-tripDetailsPillPattern
May 25, 2026
Merged

Use attendee pill pattern for traveler display in trip details#91342
flodnv merged 9 commits into
mainfrom
claude-tripDetailsPillPattern

Conversation

@MelvinBot

@MelvinBot MelvinBot commented May 21, 2026

Copy link
Copy Markdown
Contributor

Explanation of Change

Replace the MenuItem-based passenger/guest/driver rows in all four trip detail screens (Flight, Train, Hotel, Car) with MenuItemWithTopDescription + UserPills to use the attendee pill pattern. This provides visual consistency with how users are displayed elsewhere in the app (e.g., expense attendees, approval workflows) and resolves the inconsistent label indentation between trip types.

Fixed Issues

$#91334
PROPOSAL:#91334 (comment)

Tests

Precondition: You must have a workspace with booked trips that include a flight, train, hotel, and car rental.

  1. Navigate to the workspace with the booked trip
  2. Open the trip summary and select the flight
  3. Verify the Passenger row displays as a pill chip (avatar + name)
  4. Go back to the trip summary and select the train
  5. Verify the Passenger row displays as a pill chip
  6. Go back to the trip summary and select the hotel
  7. Verify the Guest row displays as a pill chip
  8. Go back to the trip summary and select the car rental
  9. Verify the Driver row displays as a pill chip
  • Verify that no errors appear in the JS console

Offline tests

Same as tests

QA Steps

// TODO: These must be filled out, or the issue title must include "[No QA]."
Same as tests

  • 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 followed proper code patterns (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 shown in the product is localized by adding it to src/languages/* files and using the translation method
    • I verified all numbers, amounts, dates and phone numbers shown in the product are using the localization methods
    • 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)
    • I verified proper file naming conventions were followed for any new files or renamed files. All non-platform specific files are named after what they export and are not named "index.js". All platform-specific files are named for the platform the code supports as outlined in the README.
    • I verified the JSDocs style guidelines (in STYLE.md) were followed
  • 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)
  • I verified all code is DRY (the PR doesn't include any logic written more than once, with the exception of tests)
  • I verified any variables that can be defined as constants (ie. in CONST.ts or at the top of the file that uses the constant) are defined as such
  • I verified that if a function's arguments changed that all usages have also been updated correctly
  • 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 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 a new page is added, I verified it's using the ScrollView component to make it scrollable when more elements are added to the page.
  • 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

Replace MenuItem-based passenger/guest/driver rows with
MenuItemWithTopDescription + UserPills across all four trip detail
screens (Flight, Train, Hotel, Car) for consistency with how users
are displayed elsewhere in the app.

Co-authored-by: Eskalifer1 <Eskalifer1@users.noreply.github.com>
@codecov

codecov Bot commented May 21, 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/pages/Travel/FlightTripDetails.tsx 100.00% <100.00%> (ø)
src/pages/Travel/HotelTripDetails.tsx 96.66% <100.00%> (-0.21%) ⬇️
src/pages/Travel/CarTripDetails.tsx 0.00% <0.00%> (ø)
src/pages/Travel/TrainTripDetails.tsx 0.00% <0.00%> (ø)
... and 266 files with indirect coverage changes

@Eskalifer1

Copy link
Copy Markdown
Contributor

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Delightful!

ℹ️ About Codex in GitHub

Codex has been enabled to automatically 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment on lines +90 to +100
<UserPills
users={[
{
avatar: personalDetails?.avatar,
displayName,
accountID: personalDetails?.accountID,
email: personalDetails?.login ?? reservation.travelerPersonalInfo?.email,
},
]}
/>
}

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.

@MelvinBot Why do we use UserPills in this case? We always have only 1 user here.

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.

UserPills is used here intentionally — it was specified in the approved proposal. The goal is visual consistency with how users are displayed elsewhere in the app (e.g., expense attendees in AttendeeField.tsx, approval workflows). Even though there's only 1 user, UserPills renders the user as a bordered pill chip with avatar + name + tooltip on hover, which is the standard attendee pattern. A single-element array is fine — the component handles it cleanly.

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.

@MelvinBot I asked why we're using UserPills here instead of just UserPill, since we only ever have one user?

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.

Fair point. UserPills was chosen to match the exact pattern from AttendeeField.tsx (which also uses UserPills), but you're right that since there's always exactly 1 traveler here, UserPill would work and be slightly simpler. The only thing UserPills adds on top is a container View with flexRow/flexWrap/userPillsContainer styles — not strictly needed for a single pill. Happy to switch to UserPill directly if you'd prefer that.

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.

@MelvinBot So, let's switch to using a simple UserPill. After all, we definitely don't need UserPills in this case. But I'd really like to keep the container's styling so that it looks just like we're using UserPills, even though we're only using UserPill.

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.

Done — switched all 4 trip detail files to use UserPill directly, wrapped in a View with the same container styles (flexRow, flexWrap, userPillsContainer) so the visual appearance is identical.

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.

@MelvinBot I don't like that we end up with duplicate code in all four places—any ideas on how to fix this?

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.

Good point — here's a suggested approach:

Create a new SingleUserPill component that wraps UserPill in the same userPillsContainer from UserPills, but accepts a single user object instead of an array — no mapping, no hiddenCount logic:

// src/components/SingleUserPill.tsx
import React from 'react';
import {View} from 'react-native';
import useThemeStyles from '@hooks/useThemeStyles';
import type {AvatarSource} from '@libs/UserAvatarUtils';
import UserPill from './UserPill';

type SingleUserPillProps = {
    avatar?: AvatarSource;
    displayName: string;
    accountID?: number;
    email?: string;
};

function SingleUserPill({avatar, displayName, accountID, email}: SingleUserPillProps) {
    const styles = useThemeStyles();

    return (
        <View style={[styles.flexRow, styles.flexWrap, styles.userPillsContainer]}>
            <UserPill
                avatar={avatar}
                displayName={displayName}
                accountID={accountID}
                email={email}
            />
        </View>
    );
}

SingleUserPill.displayName = 'SingleUserPill';

export default SingleUserPill;

Then the trip detail files would use it as:

<MenuItemWithTopDescription
    description={translate('travel.carDetails.driver')}
    interactive={false}
    titleComponent={
        <SingleUserPill
            avatar={personalDetails?.avatar}
            displayName={displayName}
            accountID={personalDetails?.accountID}
            email={personalDetails?.login ?? reservation.travelerPersonalInfo?.email}
        />
    }
/>

This gives identical visual output (same container styles from styles/index.ts:5597) with a cleaner API for the single-user case. Want me to implement this?

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.

@MelvinBot Yes, implement that approach with SingleUserPill. Add a description to the props right away using the /** */ pattern

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.

Done — created SingleUserPill component at src/components/SingleUserPill.tsx that wraps UserPill with the userPillsContainer styles. All 4 trip detail files now use SingleUserPill directly. Props have /** */ JSDoc descriptions.

Switch from the UserPills wrapper component to a direct UserPill
with the same container styling (flexRow, flexWrap, userPillsContainer)
since there is always exactly one traveler per trip detail screen.

Co-authored-by: Eskalifer1 <Eskalifer1@users.noreply.github.com>
@MelvinBot

Copy link
Copy Markdown
Contributor Author

Extract a shared TravelerField component (e.g., src/pages/Travel/TravelerField.tsx) that takes label, personalDetails, displayName, and email as props:

function TravelerField({label, personalDetails, displayName, email}: TravelerFieldProps) {
    return (
        <MenuItemWithTopDescription
            description={label}
            interactive={false}
            titleComponent={
                <UserPills
                    users={[{avatar: personalDetails?.avatar, displayName, accountID: personalDetails?.accountID, email}]}
                />
            }
        />
    );
}

Then each trip detail file reduces to:

{!!displayName && (
    <TravelerField
        label={translate('travel.carDetails.driver')}
        personalDetails={personalDetails}
        displayName={displayName}
        email={personalDetails?.login ?? reservation.travelerPersonalInfo?.email}
    />
)}

Want me to implement this? If so, add me as an assignee and reply @MelvinBot implement this.

@Eskalifer1

Copy link
Copy Markdown
Contributor

@MelvinBot No, I think this needs to be a global solution. After all, there are cases where there will be only one user and not only in Travel, and using UserPills is inappropriate because it adds unnecessary logic to display an additional element when hiddenCount > 0, and it also works with an array, which isn't the best idea when we know for sure there will be only one user.

We need a new component that will render a single UserPill, but will have the same container as UserPills, so that these two components look identical from the outside. Can you suggest a solution?

Create a new SingleUserPill component that wraps UserPill with the
userPillsContainer styles, replacing the duplicated View+UserPill
pattern across all four trip detail files.

Co-authored-by: Eskalifer1 <Eskalifer1@users.noreply.github.com>
@Eskalifer1

Copy link
Copy Markdown
Contributor

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: fde4067fd4

ℹ️ About Codex in GitHub

Codex has been enabled to automatically 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread src/pages/Travel/FlightTripDetails.tsx Outdated
Comment on lines +139 to +143
<MenuItemWithTopDescription
description={translate('travel.flightDetails.passenger')}
interactive={false}
wrapperStyle={styles.pb3}
labelStyle={styles.mb2}
titleComponent={
<SingleUserPill

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Include traveler name in accessibility label

Switching these rows to titleComponent removed the string title without adding an explicit accessibilityLabel, so MenuItem now computes the label from description only (e.g., just “Passenger”) and no longer announces the actual traveler name to screen readers. This regresses non-visual navigation for the traveler/guest/driver rows in all four trip detail screens (CarTripDetails.tsx, FlightTripDetails.tsx, HotelTripDetails.tsx, TrainTripDetails.tsx) whenever displayName is shown.

Useful? React with 👍 / 👎.

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.

@MelvinBot let's fix that

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.

Fixed — added accessibilityLabel with both the label and traveler name (e.g., "Passenger John Doe") to all 4 trip detail files.

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.

Fixed. The issue was that MenuItem bumps the description font to fontSizeNormal (15px) when no title prop is set (we use titleComponent instead). Added descriptionTextStyle={{fontSize: variables.fontSizeLabel}} to all four trip detail screens to restore the original 13px size.

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.

Good call — replaced the inline {fontSize: variables.fontSizeLabel} with {[styles.textLabelSupporting, styles.mb1]}, which is the same descriptionTextStyle the other MenuItemWithTopDescription items on these pages already use. Also removed the now-unused variables import from Car, Hotel, and Train.

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.

You're right — textLabelSupporting is already in MenuItem's base descriptionTextStyles, so passing it again was redundant. Switched all 4 traveler rows to just {fontSize: variables.fontSizeLabel} (which is the only override needed to counteract the fontSizeNormal bump when no title prop is set). Removed mb1 as well.

Co-authored-by: Eskalifer1 <Eskalifer1@users.noreply.github.com>
@Eskalifer1

Copy link
Copy Markdown
Contributor

@codex review

@Eskalifer1

Copy link
Copy Markdown
Contributor

@MelvinBot I see in all other places where UserPills is used added props titleStyle={styles.flex1}. Do we need it here? Why it was added in other places? Don't add it yer. Just ansswer the question

@MelvinBot

Copy link
Copy Markdown
Contributor Author

titleStyle={styles.flex1} is a prop on MenuItemWithTopDescription, not on UserPills — it makes the title area expand to fill available horizontal space. It matters when shouldShowRightIcon is true, because without flex1 the title content could overlap the right chevron icon.

In our trip detail screens, interactive={false} and there's no right icon, so the title area already has all the space — flex1 wouldn't change the layout. It's not needed here.

For reference: AttendeeField.tsx:62 uses it because that menu item is interactive with a right arrow icon (shouldShowRightIcon={!isReadOnly} at line 42).

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Keep them coming!

ℹ️ About Codex in GitHub

Codex has been enabled to automatically 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

@Eskalifer1

Copy link
Copy Markdown
Contributor

@MelvinBot Update Test,Offline Test and QA section(we need to adress all 4(Flight, Train, Hotel, Car))

@MelvinBot

Copy link
Copy Markdown
Contributor Author

Updated the Tests, Offline Tests, and QA sections to cover all 4 trip types (Flight, Train, Hotel, Car).

@Eskalifer1

Eskalifer1 commented May 22, 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 shown in the product is localized by adding it to src/languages/* files and using the translation method
    • I verified all numbers, amounts, dates and phone numbers shown in the product are using the localization methods
    • 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)
    • I verified proper file naming conventions were followed for any new files or renamed files. All non-platform specific files are named after what they export and are not named "index.js". All platform-specific files are named for the platform the code supports as outlined in the README.
    • I verified the JSDocs style guidelines (in STYLE.md) were followed
  • 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)
  • I verified all code is DRY (the PR doesn't include any logic written more than once, with the exception of tests)
  • I verified any variables that can be defined as constants (ie. in CONST.ts or at the top of the file that uses the constant) are defined as such
  • 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.
  • If a new page is added, I verified it's using the ScrollView component to make it scrollable when more elements are added to the page.
  • 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
91334-android-native.mov
Android: mWeb Chrome
91334-android-web.mov
iOS: HybridApp
91334-ios-native.mov
iOS: mWeb Safari
91334-ios-web.mov
MacOS: Chrome / Safari
2026-05-22.15.01.40.mov

@Eskalifer1

Copy link
Copy Markdown
Contributor

@MelvinBot Let's update Test section as that:
Precondition: You must have a workspace with booked trips that include a flight, train, hotel, and car rental.

  1. Navigate to the workspace with the booked trip
  2. Open the trip summary and select the flight
  3. Verify the Passenger row displays as a pill chip (avatar + name)
  4. Go back to the trip summary and select the train
  5. Verify the Passenger row displays as a pill chip
  6. Go back to the trip summary and select the hotel
  7. Verify the Guest row displays as a pill chip
  8. Go back to the trip summary and select the car rental
  9. Verify the Driver row displays as a pill chip

Offline section:
Same as tests

QA:
Same as tests

@MelvinBot

Copy link
Copy Markdown
Contributor Author

Updated the Tests, Offline tests, and QA Steps sections as requested.

@Eskalifer1

Copy link
Copy Markdown
Contributor

@MelvinBot Before we made these changes, the text (such as passenger for Flight or Train) had a font-size of 13px, which matched all the other elements on the page. But after we made the changes, this text now has a font-size of 15px, which stands out compared to the other elements

When MenuItemWithTopDescription has no title prop (using titleComponent
instead), MenuItem defaults the description font to fontSizeNormal (15px).
Add descriptionTextStyle with fontSizeLabel (13px) to restore the
original label font size.

Co-authored-by: Eskalifer1 <Eskalifer1@users.noreply.github.com>
@MelvinBot

Copy link
Copy Markdown
Contributor Author

⚠️ MelvinBot CI Fix Loop Detected

MelvinBot has made 5 consecutive commits trying to fix CI failures. Automatic CI fix dispatches are now paused for this PR.

Next steps: A human should review the recent commits and resolve the conflicting CI errors manually.

@Eskalifer1

Copy link
Copy Markdown
Contributor

@MelvinBot I don't think adding the style like this {{fontSize: variables.fontSizeLabel}} is the best idea. Maybe we could use the same style as all the other titles on this page?

@Eskalifer1

Copy link
Copy Markdown
Contributor

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Breezy!

ℹ️ About Codex in GitHub

Codex has been enabled to automatically 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

@Eskalifer1

Copy link
Copy Markdown
Contributor

@MelvinBot You lied—I can still see this part. Remove it.

- [ ] I verified that similar component doesn't exist in the codebase - [ ] I verified that all props are defined accurately and each prop has a `/** comment above it */` - [ ] I verified that each file is named correctly - [ ] I verified that each component has a clear name that is non-ambiguous and the purpose of the component can be inferred from the name alone - [ ] I verified that the only data being stored in component state is data necessary for rendering and nothing else - [ ] In component if we are not using the full Onyx data that we loaded, I've added the proper selector in order to ensure the component only re-renders when the data it is using changes - [ ] 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) - [ ] I verified that component 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`) - [ ] I verified that all JSX used for rendering exists in the render method - [ ] I verified that each 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
Screenshots/Videosundefined

@MelvinBot

Copy link
Copy Markdown
Contributor Author

Removed the stale checklist items and Screenshots/Videosundefined from the PR description. Sorry about that!

@Eskalifer1

Copy link
Copy Markdown
Contributor

@MelvinBot use the following text, which I will send as the PR Body. Replace the current text entirely with it—without editing, deleting, or adding anything. Since I pasted it exactly as is, without any further changes

Explanation of Change

Replace the MenuItem-based passenger/guest/driver rows in all four trip detail screens (Flight, Train, Hotel, Car) with MenuItemWithTopDescription + UserPills to use the attendee pill pattern. This provides visual consistency with how users are displayed elsewhere in the app (e.g., expense attendees, approval workflows) and resolves the inconsistent label indentation between trip types.

Fixed Issues

$#91334
PROPOSAL:#91334 (comment)

Tests

Precondition: You must have a workspace with booked trips that include a flight, train, hotel, and car rental.

  1. Navigate to the workspace with the booked trip
  2. Open the trip summary and select the flight
  3. Verify the Passenger row displays as a pill chip (avatar + name)
  4. Go back to the trip summary and select the train
  5. Verify the Passenger row displays as a pill chip
  6. Go back to the trip summary and select the hotel
  7. Verify the Guest row displays as a pill chip
  8. Go back to the trip summary and select the car rental
  9. Verify the Driver row displays as a pill chip
  • Verify that no errors appear in the JS console

Offline tests

Same as tests

QA Steps

// TODO: These must be filled out, or the issue title must include "[No QA]."
Same as tests

  • 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 followed proper code patterns (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 shown in the product is localized by adding it to src/languages/* files and using the translation method
    • I verified all numbers, amounts, dates and phone numbers shown in the product are using the localization methods
    • 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)
    • I verified proper file naming conventions were followed for any new files or renamed files. All non-platform specific files are named after what they export and are not named "index.js". All platform-specific files are named for the platform the code supports as outlined in the README.
    • I verified the JSDocs style guidelines (in STYLE.md) were followed
  • 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)
  • I verified all code is DRY (the PR doesn't include any logic written more than once, with the exception of tests)
  • I verified any variables that can be defined as constants (ie. in CONST.ts or at the top of the file that uses the constant) are defined as such
  • I verified that if a function's arguments changed that all usages have also been updated correctly
  • 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 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 a new page is added, I verified it's using the ScrollView component to make it scrollable when more elements are added to the page.
  • 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

@MelvinBot

Copy link
Copy Markdown
Contributor Author

Done — PR body has been replaced with the provided text.

@Eskalifer1

This comment was marked as outdated.

@Eskalifer1 Eskalifer1 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 commented May 22, 2026

Copy link
Copy Markdown

We did not find an internal engineer to review this PR, trying to assign a random engineer to #91334 as well as to this PR... Please reach out for help on Slack if no one gets assigned!

@melvin-bot melvin-bot Bot requested a review from flodnv May 22, 2026 18:40

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

@Eskalifer1

Copy link
Copy Markdown
Contributor

@MelvinBot Let's revert the changes with a new component and use UserPills as you mentioned in your proposal

Remove the SingleUserPill wrapper component and switch all 4 trip
detail files to use UserPills with a single-element array, as
originally proposed.

Co-authored-by: Eskalifer1 <Eskalifer1@users.noreply.github.com>
@MelvinBot MelvinBot requested a review from a team as a code owner May 25, 2026 10:37
@melvin-bot melvin-bot Bot requested review from Eskalifer1 and flodnv and removed request for a team May 25, 2026 10:37
@melvin-bot

melvin-bot Bot commented May 25, 2026

Copy link
Copy Markdown

@Eskalifer1 @flodnv One of you needs to 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]

@Eskalifer1

Copy link
Copy Markdown
Contributor

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Another round soon, please!

ℹ️ About Codex in GitHub

Codex has been enabled to automatically 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

@Eskalifer1 Eskalifer1 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!

icon={personalDetails?.avatar ?? icons.FallbackAvatar}
iconType={CONST.ICON_TYPE_AVATAR}
description={personalDetails?.login ?? reservation.travelerPersonalInfo?.email}
<MenuItemWithTopDescription

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

The MenuItemWithTopDescription + UserPills block (lines 86-103) is duplicated nearly identically across all four trip detail files (CarTripDetails, FlightTripDetails, HotelTripDetails, TrainTripDetails). The only difference is the translation key for the description/accessibilityLabel (e.g., travel.carDetails.driver vs travel.flightDetails.passenger). This is ~18 lines repeated 4 times.

Extract a shared component such as TravelerMenuItem that accepts the label translation key (or already-translated label string) along with personalDetails and reservation:

function TravelerMenuItem({label, personalDetails, reservation}: TravelerMenuItemProps) {
    const styles = useThemeStyles();
    const displayName = personalDetails?.displayName ?? reservation.travelerPersonalInfo?.name;
    if (!displayName) return null;
    return (
        <MenuItemWithTopDescription
            description={label}
            descriptionTextStyle={styles.fontSizeLabel}
            interactive={false}
            accessibilityLabel={`${label} ${displayName}`}
            titleComponent={
                <UserPills
                    users={[{
                        avatar: personalDetails?.avatar,
                        displayName,
                        accountID: personalDetails?.accountID,
                        email: personalDetails?.login ?? reservation.travelerPersonalInfo?.email,
                    }]}
                />
            }
        />
    );
}

Then each trip detail file just uses:

<TravelerMenuItem label={translate('travel.carDetails.driver')} personalDetails={personalDetails} reservation={reservation} />

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

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 don't think this should be done within the scope of this PR, since the same logic applied before - we just changed our approach

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.

Yeah, I had the same thoughts before AI posted this comment.

@flodnv flodnv merged commit cf13013 into main May 25, 2026
56 checks passed
@flodnv flodnv deleted the claude-tripDetailsPillPattern branch May 25, 2026 11:16
@OSBotify

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

Copy link
Copy Markdown
Contributor

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

@OSBotify

Copy link
Copy Markdown
Contributor

🚀 Deployed to staging by https://github.com/flodnv in version: 9.3.81-1 🚀

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

Bundle Size Analysis (Sentry):

@MelvinBot

Copy link
Copy Markdown
Contributor Author

No help site changes are required. I reviewed all travel-related articles under docs/articles/travel/ (managing-trips, booking-travel, etc.) and docs/articles/expensify-classic/expenses/Trips.md. None of them describe the visual presentation of traveler/passenger/guest/driver names in trip detail screens — they focus on high-level booking workflows and trip management steps. The switch from MenuItem rows to UserPills is a UI implementation detail that doesn't affect any documented instructions.

@OSBotify

Copy link
Copy Markdown
Contributor

🚀 Deployed to production by https://github.com/luacmartins in version: 9.3.81-2 🚀

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

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.

4 participants