Skip to content

Add user pill components for approval workflows and attendees#86105

Closed
MelvinBot wants to merge 1 commit intomainfrom
claude-improveWorkflowReadabilityWithUserPills
Closed

Add user pill components for approval workflows and attendees#86105
MelvinBot wants to merge 1 commit intomainfrom
claude-improveWorkflowReadabilityWithUserPills

Conversation

@MelvinBot
Copy link
Copy Markdown
Contributor

@MelvinBot MelvinBot commented Mar 23, 2026

Explanation of Change

Improves readability of approval workflow rows and expense attendee lists by replacing plain comma-separated text with avatar + name pill components.

Changes:

  • Created reusable UserPill component that renders a small avatar next to a user's display name in a styled pill
  • Created UserPills container that displays pills for visible users and a "+X more" overflow indicator with tooltip showing hidden user names
  • Updated ApprovalWorkflowSection to render members as pills (preserving "Everyone" plain text for default workflows) and approver rows with actual user avatars instead of generic icons
  • Updated MoneyRequestView attendee display to use pill components via titleComponent prop instead of plain text title
  • Added plusMore translation key across all 10 supported languages
  • Added pill-related styles (userPill, userPillsContainer, userPillMore, etc.) near existing workflow styles

The "+X more" indicator uses the existing Tooltip component (which is a no-op on mobile/native, where tapping the row opens the full details RHP).

Fixed Issues

$ #84985
PROPOSAL: #84985 (comment)

Tests

  1. Navigate to Workspace > Workflows with an approval workflow that has multiple members
  2. Verify members are displayed as avatar + name pills instead of plain text
  3. Verify the default workflow still shows "Everyone" as plain text
  4. Verify each approver row shows the approver's actual avatar in a pill
  5. If workflow has more than 10 members, verify a "+X more" indicator appears
  6. On web, hover over "+X more" to verify tooltip shows hidden member names
  7. Create an expense with multiple attendees
  8. View expense details and verify attendees are shown as avatar + name pills
  9. If there are more than 10 attendees, verify "+X more" appears with tooltip
  • Verify that no errors appear in the JS console

Offline tests

  1. Go offline and navigate to Workspace > Workflows
  2. Verify approval workflow pills render correctly with cached avatar data
  3. Verify the UI doesn't break or show errors when offline

QA Steps

  1. Navigate to a workspace with approval workflows containing multiple members
  2. Verify members are shown as avatar + name pills
  3. Verify the default workflow displays "Everyone" as plain text
  4. Verify approver rows show actual user avatars
  5. If a workflow has >10 members, verify "+X more" appears and shows tooltip on hover (web)
  6. Create an expense with multiple attendees, verify attendee pills display correctly
  7. Verify pressing "+X more" or the workflow row still navigates to the RHP
  • 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
      • If any non-english text was added/modified, I used JaimeGPT to get English > Spanish translation. I then posted it in #expensify-open-source and it was approved by an internal Expensify engineer. Link to Slack message:
    • 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
- [ ] 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

Replace plain text user names with avatar + name pill components in:
- Approval workflow section (members list and approver rows)
- Expense attendee display in MoneyRequestView

Adds UserPill and UserPills reusable components with +N more
overflow indicator and tooltip for hidden users.

Co-authored-by: Nyoman Jyotisa <nyomanjyotisa@users.noreply.github.com>
@MelvinBot
Copy link
Copy Markdown
Contributor Author

I created this PR from an upstream branch since I don't have push access to your fork.

To take ownership of this branch and be able to push updates, run:

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

Then you can close this PR and open a new one from your fork.

@OSBotify
Copy link
Copy Markdown
Contributor

🦜 Polyglot Parrot! 🦜

Squawk! Looks like you added some shiny new English strings. Allow me to parrot them back to you in other tongues:

View the translation diff
diff --git a/src/languages/it.ts b/src/languages/it.ts
index 05355d88..6caa1b7c 100644
--- a/src/languages/it.ts
+++ b/src/languages/it.ts
@@ -345,7 +345,7 @@ const translations: TranslationDeepObject<typeof en> = {
         letsStart: `Iniziamo`,
         showMore: 'Mostra di più',
         showLess: 'Mostra meno',
-        plusMore: ({count}: {count: number}) => `+${count} altri`,
+        plusMore: ({count}: {count: number}) => `+${count} in più`,
         merchant: 'Esercente',
         change: 'Modifica',
         category: 'Categoria',
diff --git a/src/languages/ja.ts b/src/languages/ja.ts
index 0be1f00a..e312d60f 100644
--- a/src/languages/ja.ts
+++ b/src/languages/ja.ts
@@ -345,7 +345,7 @@ const translations: TranslationDeepObject<typeof en> = {
         letsStart: `はじめましょう`,
         showMore: 'さらに表示',
         showLess: '表示を減らす',
-        plusMore: ({count}: {count: number}) => `+${count}件`,
+        plusMore: ({count}: {count: number}) => `他 ${count} 件`,
         merchant: '加盟店',
         change: '変更',
         category: 'カテゴリ',
diff --git a/src/languages/zh-hans.ts b/src/languages/zh-hans.ts
index 014d3135..8b195929 100644
--- a/src/languages/zh-hans.ts
+++ b/src/languages/zh-hans.ts
@@ -345,7 +345,7 @@ const translations: TranslationDeepObject<typeof en> = {
         letsStart: `开始吧`,
         showMore: '显示更多',
         showLess: '收起',
-        plusMore: ({count}: {count: number}) => `+${count}个`,
+        plusMore: ({count}: {count: number}) => `还有 +${count} 项`,
         merchant: '商户',
         change: '更改',
         category: '类别',

Note

You can apply these changes to your branch by copying the patch to your clipboard, then running pbpaste | git apply 😉

View workflow run

@codecov
Copy link
Copy Markdown

codecov Bot commented Mar 23, 2026

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/styles/index.ts 47.42% <ø> (ø)
src/components/UserPill.tsx 20.00% <20.00%> (ø)
...c/components/ReportActionItem/MoneyRequestView.tsx 0.23% <0.00%> (-0.01%) ⬇️
src/components/ApprovalWorkflowSection.tsx 0.00% <0.00%> (ø)
src/components/UserPills.tsx 15.38% <15.38%> (ø)
... and 8 files with indirect coverage changes

@github-actions
Copy link
Copy Markdown
Contributor

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

@shawnborton
Copy link
Copy Markdown
Contributor

Sorry I accidentally ran the builds here. Can we close this?

@github-actions
Copy link
Copy Markdown
Contributor

🧪🧪 Use the links below to test this adhoc build on Android, iOS, and Web. Happy testing! 🧪🧪
Built from App PR #86105.

Android 🤖 iOS 🍎
❌ FAILED ❌ ❌ FAILED ❌
The QR code can't be generated, because the Android build failed The QR code can't be generated, because the iOS build failed
Web 🕸️
❌ FAILED ❌
The QR code can't be generated, because the Web build failed

👀 View the workflow run that generated this build 👀

@nyomanjyotisa
Copy link
Copy Markdown
Member

@MelvinBot Please close this PR

@MelvinBot
Copy link
Copy Markdown
Contributor Author

Closing this PR as requested by nyomanjyotisa.

@MelvinBot MelvinBot closed this Apr 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants