Skip to content

Update the agents table to the new style#94995

Merged
JS00001 merged 18 commits into
mainfrom
cmartins-agentsTable
Jul 9, 2026
Merged

Update the agents table to the new style#94995
JS00001 merged 18 commits into
mainfrom
cmartins-agentsTable

Conversation

@luacmartins

@luacmartins luacmartins commented Jun 30, 2026

Copy link
Copy Markdown
Contributor

Explanation of Change

Migrate the Agents page to the shared Table component.

Row taps on both web and mobile now open the edit agent RHP (which includes chat, copilot, and edit actions), replacing the inline action buttons on wide screens.

Fixed Issues

$ #94972

Tests

  1. Open Account > Agents with the custom agent beta enabled
  2. Confirm agents render with avatar, name, and email in the compact table style
  3. On web, tap anywhere on a row and confirm the edit agent RHP opens
  4. On mobile, tap a row and confirm the edit agent RHP opens (no inline chat/copilot/edit buttons on the list)
  5. Confirm New agent still works
  6. With 12+ agents, confirm search and sorting work
  7. Confirm the error dot still appears for agents with update errors
  • Verify that no errors appear in the JS console
Screenshot 2026-07-02 at 3 33 22 PM Screenshot 2026-07-02 at 3 33 31 PM

Offline tests

N/A

QA Steps

Same as tests

  • Verify that no errors appear in the JS console

@OSBotify

This comment has been minimized.

@codecov

codecov Bot commented Jun 30, 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/CONST/index.ts 94.81% <ø> (ø)
...c/components/Tables/AgentsTable/AgentsTableRow.tsx 100.00% <100.00%> (ø)
src/styles/variables.ts 100.00% <ø> (ø)
src/pages/settings/Agents/AgentsPage.tsx 88.88% <80.00%> (-5.85%) ⬇️
src/components/Tables/AgentsTable/index.tsx 0.00% <0.00%> (ø)
... and 39 files with indirect coverage changes

Introduces a shared Table-based component with sortable rows, search support, and row navigation to the edit agent RHP.
Replaces the FlatList and per-row action buttons with compact table rows that open the edit RHP on tap for both web and mobile.
Adds localized search placeholder copy used when the agents list exceeds the standard list item limit.
Use a type guard when building agent row data and mock table dependencies in unit tests so TableRow does not require ScreenWrapper context.
Avoids invalid type predicate narrowing when filtering out agents without personal details.
@luacmartins luacmartins force-pushed the cmartins-agentsTable branch from 4fa4018 to b5d46a2 Compare July 2, 2026 21:13
@OSBotify

OSBotify commented Jul 2, 2026

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/de.ts b/src/languages/de.ts
index 4f8a0ec10a4..09d46cf4456 100644
--- a/src/languages/de.ts
+++ b/src/languages/de.ts
@@ -2869,7 +2869,7 @@ ${amount} für ${merchant} – ${date}`,
     agentsPage: {
         title: 'Agenten',
         subtitle: `<muted-text>Agents übernehmen Ihre Workflows für Sie, sodass Sie täglich Stunden zurückgewinnen. <a href="${CONST.CUSTOM_AGENTS_HELP_URL}">Mehr erfahren</a>.</muted-text>`,
-        findAgent: 'Agent suchen',
+        findAgent: 'Agent finden',
         copilot: 'Co-Pilot',
         newAgent: 'Neue:r Agent:in',
         emptyAgents: {
diff --git a/src/languages/es.ts b/src/languages/es.ts
index f8c6344d972..1b9eb5998d9 100644
--- a/src/languages/es.ts
+++ b/src/languages/es.ts
@@ -2734,7 +2734,7 @@ ${amount} para ${merchant} - ${date}`,
         title: 'Agentes',
         subtitle: `<muted-text>Los agentes gestionan tus flujos de trabajo por ti, para que recuperes horas en tu día. <a href="${CONST.CUSTOM_AGENTS_HELP_URL}">Más información</a>.</muted-text>`,
         findAgent: 'Buscar agente',
-        copilot: 'Co-piloto',
+        copilot: 'Copiloto',
         newAgent: 'Nuevo agente',
         emptyAgents: {
             title: 'No se han creado agentes.',
diff --git a/src/languages/fr.ts b/src/languages/fr.ts
index fbd4a9ef6a5..f7005e775bd 100644
--- a/src/languages/fr.ts
+++ b/src/languages/fr.ts
@@ -2877,7 +2877,7 @@ ${amount} pour ${merchant} - ${date}`,
         title: 'Agents',
         subtitle: `<muted-text>Les agents gèrent vos workflows pour vous, afin que vous gagniez des heures dans votre journée. <a href="${CONST.CUSTOM_AGENTS_HELP_URL}">En savoir plus</a>.</muted-text>`,
         findAgent: 'Trouver un agent',
-        copilot: 'Co-pilot',
+        copilot: 'Copilote',
         newAgent: 'Nouvel agent',
         emptyAgents: {
             title: 'Aucun agent créé',
diff --git a/src/languages/it.ts b/src/languages/it.ts
index b331b0a211f..b3c1dc739ae 100644
--- a/src/languages/it.ts
+++ b/src/languages/it.ts
@@ -2865,7 +2865,7 @@ ${amount} per ${merchant} - ${date}`,
         title: 'Agenti',
         subtitle: `<muted-text>Gli agenti gestiscono i tuoi flussi di lavoro al posto tuo, così ti ritrovi ore in più nella tua giornata. <a href="${CONST.CUSTOM_AGENTS_HELP_URL}">Scopri di più</a>.</muted-text>`,
         findAgent: 'Trova agente',
-        copilot: 'Co-pilot',
+        copilot: 'Copilota',
         newAgent: 'Nuovo agente',
         emptyAgents: {
             title: 'Nessun agente creato',
diff --git a/src/languages/ja.ts b/src/languages/ja.ts
index 2c1d642896e..3fdf7b378c7 100644
--- a/src/languages/ja.ts
+++ b/src/languages/ja.ts
@@ -2833,8 +2833,8 @@ ${date} の ${merchant} への ${amount}`,
     agentsPage: {
         title: '担当者',
         subtitle: `<muted-text>エージェントがワークフローを代わりに処理するので、毎日の時間を数時間取り戻せます。<a href="${CONST.CUSTOM_AGENTS_HELP_URL}">詳しく見る</a>。</muted-text>`,
-        findAgent: '担当者を探す',
-        copilot: 'Co-pilot',
+        findAgent: 'エージェントを検索',
+        copilot: 'コパイロット',
         newAgent: '新しいエージェント',
         emptyAgents: {
             title: 'エージェントは作成されていません',
diff --git a/src/languages/nl.ts b/src/languages/nl.ts
index aacba6361cf..d287edef14b 100644
--- a/src/languages/nl.ts
+++ b/src/languages/nl.ts
@@ -2863,7 +2863,7 @@ ${amount} voor ${merchant} - ${date}`,
         title: 'Agenten',
         subtitle: `<muted-text>Agents verwerken je workflows voor je, zodat je uren per dag terugkrijgt. <a href="${CONST.CUSTOM_AGENTS_HELP_URL}">Meer informatie</a>.</muted-text>`,
         findAgent: 'Agent zoeken',
-        copilot: 'Co-pilot',
+        copilot: 'Co-piloot',
         newAgent: 'Nieuwe medewerker',
         emptyAgents: {
             title: 'Geen agents aangemaakt',
diff --git a/src/languages/pl.ts b/src/languages/pl.ts
index f96330d6e18..b9d7bcdf23f 100644
--- a/src/languages/pl.ts
+++ b/src/languages/pl.ts
@@ -2850,7 +2850,7 @@ ${amount} dla ${merchant} - ${date}`,
         title: 'Agenci',
         subtitle: `<muted-text>Agenci obsługują za ciebie twoje procesy, dzięki czemu odzyskujesz godziny w ciągu dnia. <a href="${CONST.CUSTOM_AGENTS_HELP_URL}">Dowiedz się więcej</a>.</muted-text>`,
         findAgent: 'Znajdź agenta',
-        copilot: 'Co-pilot',
+        copilot: 'Współpilot',
         newAgent: 'Nowy agent',
         emptyAgents: {
             title: 'Nie utworzono agentów',
diff --git a/src/languages/pt-BR.ts b/src/languages/pt-BR.ts
index 200c8a53233..1007826a2f9 100644
--- a/src/languages/pt-BR.ts
+++ b/src/languages/pt-BR.ts
@@ -2853,7 +2853,7 @@ ${amount} para ${merchant} - ${date}`,
         title: 'Agentes',
         subtitle: `<muted-text>Agentes cuidam dos seus fluxos de trabalho para você, para que você ganhe horas de volta no seu dia. <a href="${CONST.CUSTOM_AGENTS_HELP_URL}">Saiba mais</a>.</muted-text>`,
         findAgent: 'Encontrar agente',
-        copilot: 'Co-pilot',
+        copilot: 'Copiloto',
         newAgent: 'Novo agente',
         emptyAgents: {
             title: 'Nenhum agente criado',
diff --git a/src/languages/zh-hans.ts b/src/languages/zh-hans.ts
index 9f1952b61da..3a36fe53e9f 100644
--- a/src/languages/zh-hans.ts
+++ b/src/languages/zh-hans.ts
@@ -2766,7 +2766,7 @@ ${amount},商户:${merchant} - 日期:${date}`,
         title: '代理人',
         subtitle: `<muted-text>智能代理为你处理工作流程,让你每天多出数小时。<a href="${CONST.CUSTOM_AGENTS_HELP_URL}">了解详情</a>。</muted-text>`,
         findAgent: '查找代理',
-        copilot: 'Co-pilot',
+        copilot: '副驾驶',
         newAgent: '新代理人',
         emptyAgents: {
             title: '尚未创建代理',

Note

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

View workflow run

Invoke PressableWithFeedback render props in the mock and stub table row dependencies so action buttons render in tests.
@luacmartins luacmartins marked this pull request as ready for review July 2, 2026 22:10
@luacmartins luacmartins requested review from a team as code owners July 2, 2026 22:10
@melvin-bot melvin-bot Bot requested review from Krishna2323, heyjennahay and shawnborton and removed request for a team July 2, 2026 22:10
@melvin-bot

melvin-bot Bot commented Jul 2, 2026

Copy link
Copy Markdown

@shawnborton @Krishna2323 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]

@melvin-bot melvin-bot Bot removed the request for review from a team July 2, 2026 22:10

@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: af0cdb1569

ℹ️ 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/components/Tables/AgentsTable/AgentsTableRow.tsx
@Krishna2323

Krishna2323 commented Jul 5, 2026

Copy link
Copy Markdown
Contributor
  • Spacing between the subtitle and table is 12px, it should be 20px (same as Expense rules tab)
image
  • Should we show the full error message on the row instead of just the RBR, like we do in other tables?
Monosnap.screencast.2026-07-06.02-39-57.mp4

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

Code-wise, it looks good to me. It just needs a few minor fixes. I'll complete the checklist once those are done.

@JS00001

JS00001 commented Jul 7, 2026

Copy link
Copy Markdown
Contributor

@luacmartins jest is failing

@luacmartins

Copy link
Copy Markdown
Contributor Author

@JS00001 updated

@Krishna2323

Copy link
Copy Markdown
Contributor
  • Subtitle isn't displayed on native platforms
image

@Krishna2323

Copy link
Copy Markdown
Contributor

@luacmartins is this ready for review?

@luacmartins

Copy link
Copy Markdown
Contributor Author

No, not yet

@luacmartins

Copy link
Copy Markdown
Contributor Author

@Krishna2323 fixed
Simulator Screenshot - iPhone 17 Pro - 2026-07-08 at 13 49 58

@luacmartins luacmartins requested a review from JS00001 July 8, 2026 19:57
@github-actions

github-actions Bot commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

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

@github-actions

This comment has been minimized.

@Krishna2323

Krishna2323 commented Jul 9, 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 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)
  • 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)
  • 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.
  • 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
android_native.mp4
image
Android: mWeb Chrome
android_mWe.mp4
iOS: HybridApp
ios_native.mp4
iOS: mWeb Safari
ios_mWeb.mp4
MacOS: Chrome / Safari
web_chrome.mp4

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

@shawnborton

Copy link
Copy Markdown
Contributor

Feels pretty good to me 👍

@JS00001 JS00001 merged commit c064810 into main Jul 9, 2026
44 checks passed
@JS00001 JS00001 deleted the cmartins-agentsTable branch July 9, 2026 13:18
@github-actions

github-actions Bot commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

🚧 JS00001 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/JS00001 in version: 9.4.33-0 🚀

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

@MelvinBot

Copy link
Copy Markdown
Contributor

📝 Help site review — changes required

This PR migrates the Agents page to the shared Table component and changes the interaction model: tapping an agent's row now opens the Edit agent RHP (chat, Copilot, edit instructions, delete), and the inline Edit / Chat / Copilot buttons no longer appear on mobile/narrow layouts.

The existing help article Create-and-Use-Custom-Agents.md still instructed users to click those inline buttons, so it's now stale. I created a draft help site PR that updates the chat, Copilot, edit-instructions, and delete steps to describe tapping the agent's row to open Edit agent first — a path that works on every screen size.

Draft help site PR: #95846

What changed in the docs and why

Verified all labels against the merged code (src/languages/en.ts, src/pages/settings/Agents/EditAgentPage.tsx):

Flow Old doc step New doc step
After creating "appears… with Edit, Chat, and Copilot buttons" tap the row to open Edit agent
Chat "click the chat icon on the agent's row" open Edit agentChat with agent
Copilot "click Copilot" open Edit agentCopilot into account
Edit instructions "click Edit" → "Write custom instructions section" open Edit agentWrite custom instructions
Delete "click Edit" open Edit agentDelete agent

The Edit agent RHP menu items are exactly: Chat with agent, Copilot into account, Delete agent, plus Agent name and Write custom instructions.

@luacmartins, please review the linked help site PR and confirm it reflects the current behavior. Then mark the linked help site PR Ready for review.

@jponikarchuk

Copy link
Copy Markdown

Deploy Blocker #95860 was identified to be related to this PR.

@jponikarchuk

Copy link
Copy Markdown

This PR failing because of the issue #95860
This issue is reproducible in: Web, Android app

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.

7 participants