Skip to content

feat: [90250] add agent avatar functionality#90689

Merged
NicolasBonet merged 27 commits into
mainfrom
feat/90250-add-agent-avatar-functionality
May 15, 2026
Merged

feat: [90250] add agent avatar functionality#90689
NicolasBonet merged 27 commits into
mainfrom
feat/90250-add-agent-avatar-functionality

Conversation

@NicolasBonet
Copy link
Copy Markdown
Contributor

@NicolasBonet NicolasBonet commented May 14, 2026

Explanation of Change

Fixed Issues

$ #90250
PROPOSAL: https://expensify.enterprise.slack.com/docs/T03SC9DTT/F0AKV1FPD41?focus_section_id=temp:C:PDZ6783461e5cc6405c96fb1f944

Tests

  1. Go to Account > Agents and tap an agent's Edit button.
  2. Verify a circular avatar appears at the top of the RHP showing the agent's current avatar.
  3. Tap the avatar.
  4. Verify the picker shows only bot avatars (not the regular human preset grid).
  5. Pick a different avatar and tap Save.
  6. Verify the avatar updates in the Edit page, the Agents list, and any chats the agent participates in.
  7. Copilot into the agent account, go to Account > Profile, tap the avatar, and verify the picker again shows only bot avatars.
  8. Now, upload a photo and save from the Account -> Profile
  9. Go back to the user account
  10. Go to Accounts -> Agents and tap the Add Agent button
  11. Click in Upload Photo and select a valid image.
  12. Verify the avatar updates in the Agents page, the Agents list, and any chats the agent participates in.
  • Verify that no errors appear in the JS console

Offline tests

If you choose offline mode the avatar update can stale while connection is recovered.

QA Steps

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
      • 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.
  • 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/Videos

Android: Native
ScreenRecording_05-13-2026.11-47-59_1.MP4
Android: mWeb Chrome
iOS: Native
iOS: mWeb Safari
MacOS: Chrome / Safari
ScreenRecording_05-13-2026.11-47-59_1.MP4

@OSBotify

This comment has been minimized.

@NicolasBonet NicolasBonet force-pushed the feat/90250-add-agent-avatar-functionality branch 2 times, most recently from dbb0d28 to d40662a Compare May 14, 2026 16:54
@NicolasBonet NicolasBonet changed the title Feat/90250 add agent avatar functionality feat: [90250] add agent avatar functionality May 14, 2026
@github-actions
Copy link
Copy Markdown
Contributor

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

@NicolasBonet NicolasBonet marked this pull request as ready for review May 14, 2026 17:18
@NicolasBonet NicolasBonet requested review from a team as code owners May 14, 2026 17:18
@melvin-bot melvin-bot Bot requested review from ZhenjaHorbach and trjExpensify and removed request for a team May 14, 2026 17:18
@melvin-bot
Copy link
Copy Markdown

melvin-bot Bot commented May 14, 2026

@ZhenjaHorbach Please 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]

@codecov
Copy link
Copy Markdown

codecov Bot commented May 14, 2026

Codecov Report

✅ Changes either increased or maintained existing code coverage, great job!

Files with missing lines Coverage Δ
src/CONST/index.ts 92.30% <ø> (ø)
src/SCREENS.ts 100.00% <ø> (ø)
src/components/AvatarSelector.tsx 100.00% <100.00%> (ø)
src/components/Icon/DefaultBotAvatars.ts 100.00% <ø> (ø)
src/libs/API/types.ts 100.00% <ø> (ø)
src/libs/Avatars/PresetAvatarCatalog.ts 75.75% <100.00%> (+10.24%) ⬆️
...igation/linkingConfig/RELATIONS/SETTINGS_TO_RHP.ts 100.00% <ø> (ø)
src/libs/Navigation/linkingConfig/config.ts 76.92% <ø> (ø)
src/libs/actions/Agent.ts 78.43% <100.00%> (+9.85%) ⬆️
src/pages/settings/Agents/AgentsPage.tsx 94.44% <100.00%> (+0.10%) ⬆️
... and 10 more
... and 11 files with indirect coverage changes

@github-actions

This comment has been minimized.

Copy link
Copy Markdown

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

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: fb8d37d1bc

ℹ️ About Codex in GitHub

Your team has set up Codex to 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 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/pages/settings/Profile/Avatar/AvatarPage.tsx Outdated
@github-actions
Copy link
Copy Markdown
Contributor

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

@NicolasBonet NicolasBonet requested review from ShridharGoel, puneetlath and yuwenmemon and removed request for trjExpensify May 14, 2026 18:02
@NicolasBonet NicolasBonet force-pushed the feat/90250-add-agent-avatar-functionality branch from 25f70a9 to 5e32c4e Compare May 14, 2026 18:04
@ShridharGoel
Copy link
Copy Markdown
Contributor

@NicolasBonet Optimistic handling got missed here, can you add it?

Screen.Recording.2026-05-14.at.11.55.00.PM.mov

@ShridharGoel
Copy link
Copy Markdown
Contributor

Looks like some backend changes are pending for the scenario when avatar is changed via the agent copilot mode.

Screen.Recording.2026-05-14.at.11.59.24.PM.mov

@ShridharGoel
Copy link
Copy Markdown
Contributor

ShridharGoel commented May 14, 2026

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 there are no new alerts related to the canBeMissing param for useOnyx
  • 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
Screen.Recording.2026-05-15.at.12.07.31.AM.mov
Android: mWeb Chrome
Screen.Recording.2026-05-15.at.12.08.17.AM.mov
iOS: HybridApp
iOS: mWeb Safari
Screen.Recording.2026-05-15.at.12.03.32.AM.mov
MacOS: Chrome / Safari
Screen.Recording.2026-05-15.at.12.02.24.AM.mov

@NicolasBonet NicolasBonet force-pushed the feat/90250-add-agent-avatar-functionality branch from 803c382 to e587dd0 Compare May 14, 2026 20:03
@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/de.ts b/src/languages/de.ts
index 5eb15103..4e1a485b 100644
--- a/src/languages/de.ts
+++ b/src/languages/de.ts
@@ -2746,7 +2746,7 @@ ${amount} für ${merchant} – ${date}`,
             genericUpdate: 'Beim Aktualisieren dieses Agenten ist ein Problem aufgetreten',
             updateName: 'Beim Aktualisieren des Namens dieser Vertretung ist ein Problem aufgetreten',
             updatePrompt: 'Beim Aktualisieren der Anweisungen dieses Agenten ist ein Problem aufgetreten',
-            updateAvatar: 'Beim Aktualisieren des Avatars dieser Vertretung ist ein Problem aufgetreten',
+            updateAvatar: 'Beim Aktualisieren des Avatars dieses Agenten ist ein Problem aufgetreten',
         },
     },
     addAgentPage: {
@@ -2754,7 +2754,7 @@ ${amount} für ${merchant} – ${date}`,
         agentName: 'Name der Ansprechperson',
         instructions: 'Eigene Anweisungen schreiben',
         createAgent: 'Agent erstellen',
-        editAvatar: 'Profilbild wechseln',
+        editAvatar: 'Avatar bearbeiten',
         defaultAgentName: (displayName: string) => `Agent*in von ${displayName}`,
         defaultPrompt:
             'Lehne Ausgaben ab, die für Glücksspiele, Kinobesuche oder andere offensichtlich nicht geschäftliche Zwecke sind.\n\nErinnere den:die Nutzer:in daran, immer ein Belegfoto beizufügen, auf dem das Trinkgeld klar erkennbar ist.\n\nGenehmige den Bericht, wenn er früheren Berichten derselben Person sehr ähnlich ist.\n\nLehne Berichte mit mehr als 500 $ an Reisekosten ab.',
diff --git a/src/languages/es.ts b/src/languages/es.ts
index 5684e269..e620b8ae 100644
--- a/src/languages/es.ts
+++ b/src/languages/es.ts
@@ -2618,7 +2618,7 @@ ${amount} para ${merchant} - ${date}`,
             genericUpdate: 'Hubo un problema al actualizar este agente',
             updateName: 'Hubo un problema al actualizar el nombre de este agente',
             updatePrompt: 'Hubo un problema al actualizar las instrucciones de este agente',
-            updateAvatar: 'Hubo un problema al actualizar el avatar de este agente',
+            updateAvatar: 'Se ha producido un problema al actualizar el avatar de este agente',
         },
     },
     addAgentPage: {
@@ -2626,7 +2626,7 @@ ${amount} para ${merchant} - ${date}`,
         agentName: 'Nombre del agente',
         instructions: 'Escribe instrucciones personalizadas',
         createAgent: 'Crear agente',
-        editAvatar: 'Cambiar avatar',
+        editAvatar: 'Editar avatar',
         defaultAgentName: (displayName: string) => `Agente de ${displayName}`,
         defaultPrompt:
             'Rechazar gastos por juegos de azar, películas u otras razones claramente no comerciales.\n\nRecordar al usuario que siempre incluya una imagen del recibo que muestre claramente la propina.\n\nAprobar el informe si es muy similar a informes anteriores del mismo usuario.\n\nRechazar informes con más de $500 en gastos de viaje.',
diff --git a/src/languages/fr.ts b/src/languages/fr.ts
index 7e66d676..af9163d9 100644
--- a/src/languages/fr.ts
+++ b/src/languages/fr.ts
@@ -2752,7 +2752,7 @@ ${amount} pour ${merchant} - ${date}`,
             genericUpdate: 'Un problème est survenu lors de la mise à jour de cet agent',
             updateName: 'Un problème est survenu lors de la mise à jour du nom de cet agent',
             updatePrompt: 'Un problème est survenu lors de la mise à jour des instructions de cet agent',
-            updateAvatar: "Un problème est survenu lors de la mise à jour de l'avatar de cet agent",
+            updateAvatar: 'Un problème est survenu lors de la mise à jour de l’avatar de cet agent',
         },
     },
     addAgentPage: {
@@ -2760,7 +2760,7 @@ ${amount} pour ${merchant} - ${date}`,
         agentName: 'Nom de l’agent',
         instructions: 'Rédiger des instructions personnalisées',
         createAgent: 'Créer un agent',
-        editAvatar: "Changer d'avatar",
+        editAvatar: 'Modifier l’avatar',
         defaultAgentName: (displayName: string) => `Agent de ${displayName}`,
         defaultPrompt:
             'Rejeter les dépenses liées aux jeux d’argent, aux films ou à d’autres motifs manifestement non professionnels.\n\nRappeler à l’utilisateur d’inclure systématiquement une image du reçu où le pourboire est clairement visible.\n\nApprouver le rapport s’il est très similaire aux rapports précédents du même utilisateur.\n\nRejeter les rapports contenant plus de 500 $ de frais de déplacement.',
diff --git a/src/languages/it.ts b/src/languages/it.ts
index e9498117..f9d3439d 100644
--- a/src/languages/it.ts
+++ b/src/languages/it.ts
@@ -2742,7 +2742,7 @@ ${amount} per ${merchant} - ${date}`,
             genericUpdate: "Si è verificato un problema durante l'aggiornamento di questo agente",
             updateName: "Si è verificato un problema durante l'aggiornamento del nome di questo agente",
             updatePrompt: "Si è verificato un problema durante l'aggiornamento delle istruzioni di questo agente",
-            updateAvatar: "Si è verificato un problema durante l'aggiornamento dell'avatar di questo agente",
+            updateAvatar: 'Si è verificato un problema durante l’aggiornamento dell’avatar di questo agente',
         },
     },
     addAgentPage: {
@@ -2750,7 +2750,7 @@ ${amount} per ${merchant} - ${date}`,
         agentName: 'Nome agente',
         instructions: 'Scrivi istruzioni personalizzate',
         createAgent: 'Crea agente',
-        editAvatar: 'Cambia avatar',
+        editAvatar: 'Modifica avatar',
         defaultAgentName: (displayName: string) => `Agente di ${displayName}`,
         defaultPrompt:
             "Rifiuta le spese relative a gioco d'azzardo, cinema o altri motivi chiaramente non legati all'attività.\n\nRicorda all'utente di includere sempre un'immagine della ricevuta in cui la mancia sia ben visibile.\n\nApprova il report se è molto simile ai report precedenti dello stesso utente.\n\nRifiuta i report con più di 500 $ di spese di viaggio.",
diff --git a/src/languages/ja.ts b/src/languages/ja.ts
index f432558b..3332e8fe 100644
--- a/src/languages/ja.ts
+++ b/src/languages/ja.ts
@@ -2722,7 +2722,7 @@ ${date} の ${merchant} への ${amount}`,
         agentName: 'エージェント名',
         instructions: 'カスタム指示を作成',
         createAgent: 'エージェントを作成',
-        editAvatar: 'アバターを切り替え',
+        editAvatar: 'アバターを編集',
         defaultAgentName: (displayName: string) => `${displayName} さんの代理人`,
         defaultPrompt:
             'ギャンブル、映画、またはその他明らかにビジネス目的ではない理由による経費は却下します。\n\nチップの金額が明確にわかるレシート画像を必ず添付するよう、ユーザーにリマインドします。\n\n同じユーザーの過去のレポートと非常によく似ている場合は、そのレポートを承認します。\n\n出張費が500ドルを超えるレポートは却下します。',
diff --git a/src/languages/nl.ts b/src/languages/nl.ts
index 7a2511da..c7f418f6 100644
--- a/src/languages/nl.ts
+++ b/src/languages/nl.ts
@@ -2738,7 +2738,7 @@ ${amount} voor ${merchant} - ${date}`,
             genericUpdate: 'Er is een probleem opgetreden bij het bijwerken van deze agent',
             updateName: 'Er is een probleem opgetreden bij het bijwerken van de naam van deze agent',
             updatePrompt: 'Er is een probleem opgetreden bij het bijwerken van de instructies van deze agent',
-            updateAvatar: 'Er is een probleem opgetreden bij het bijwerken van de avatar van deze agent',
+            updateAvatar: 'Er is een probleem opgetreden bij het bijwerken van de avatar van deze medewerker',
         },
     },
     addAgentPage: {
@@ -2746,7 +2746,7 @@ ${amount} voor ${merchant} - ${date}`,
         agentName: 'Naam medewerker',
         instructions: 'Schrijf aangepaste instructies',
         createAgent: 'Agent aanmaken',
-        editAvatar: 'Profielavatar wisselen',
+        editAvatar: 'Avatar bewerken',
         defaultAgentName: (displayName: string) => `Agent van ${displayName}`,
         defaultPrompt:
             'Wijs declaraties af die zijn voor gokken, films of andere duidelijk niet-zakelijke redenen.\n\nHerinner de gebruiker eraan altijd een bonafbeelding toe te voegen waarop de fooi duidelijk is.\n\nKeur het verslag goed als het sterk lijkt op eerdere verslagen van dezelfde gebruiker.\n\nWijs verslagen af met meer dan $500 aan reiskosten.',
diff --git a/src/languages/pl.ts b/src/languages/pl.ts
index c88084c9..09a38b6e 100644
--- a/src/languages/pl.ts
+++ b/src/languages/pl.ts
@@ -2741,7 +2741,7 @@ ${amount} dla ${merchant} - ${date}`,
         agentName: 'Nazwa agenta',
         instructions: 'Napisz niestandardowe instrukcje',
         createAgent: 'Utwórz agenta',
-        editAvatar: 'Zmień awatar',
+        editAvatar: 'Edytuj awatar',
         defaultAgentName: (displayName: string) => `Agent ${displayName}`,
         defaultPrompt:
             'Odrzucaj wydatki związane z hazardem, filmami lub innymi oczywistymi celami niezwiązanymi z działalnością biznesową.\n\nPrzypominaj użytkownikowi, aby zawsze dołączał zdjęcie paragonu, na którym wysokość napiwku jest wyraźnie widoczna.\n\nZatwierdź raport, jeśli jest bardzo podobny do wcześniejszych raportów tego samego użytkownika.\n\nOdrzucaj raporty zawierające więcej niż 500 USD wydatków na podróże.',
diff --git a/src/languages/pt-BR.ts b/src/languages/pt-BR.ts
index f415f972..ce8b53f5 100644
--- a/src/languages/pt-BR.ts
+++ b/src/languages/pt-BR.ts
@@ -2741,7 +2741,7 @@ ${amount} para ${merchant} - ${date}`,
         agentName: 'Nome do agente',
         instructions: 'Escrever instruções personalizadas',
         createAgent: 'Criar agente',
-        editAvatar: 'Trocar avatar',
+        editAvatar: 'Editar avatar',
         defaultAgentName: (displayName: string) => `Agente de ${displayName}`,
         defaultPrompt:
             'Rejeite despesas relacionadas a jogos de azar, cinema ou outros motivos claramente não relacionados ao negócio.\n\nLembre o usuário de sempre incluir uma imagem do recibo em que a gorjeta fique clara.\n\nAprove o relatório se ele for muito semelhante a relatórios anteriores do mesmo usuário.\n\nRejeite relatórios com mais de US$ 500 em despesas de viagem.',
diff --git a/src/languages/zh-hans.ts b/src/languages/zh-hans.ts
index fe8909d0..6e697eae 100644
--- a/src/languages/zh-hans.ts
+++ b/src/languages/zh-hans.ts
@@ -2664,7 +2664,7 @@ ${amount},商户:${merchant} - 日期:${date}`,
             genericUpdate: '更新此代理时出现问题',
             updateName: '更新此代理名称时出现问题',
             updatePrompt: '更新此代理的说明时出现问题',
-            updateAvatar: '更新此代理的头像时出现问题',
+            updateAvatar: '更新此代理人的头像时出现问题',
         },
     },
     addAgentPage: {
@@ -2672,7 +2672,7 @@ ${amount},商户:${merchant} - 日期:${date}`,
         agentName: '代理名称',
         instructions: '编写自定义说明',
         createAgent: '创建代理',
-        editAvatar: '切换头像',
+        editAvatar: '编辑头像',
         defaultAgentName: (displayName: string) => `${displayName} 的代理人`,
         defaultPrompt:
             '拒绝与赌博、电影或其他明显非商务原因相关的报销。\n\n提醒用户务必附上一张能清楚显示小费金额的收据图片。\n\n如果报销报告与同一用户之前的报告非常相似,则批准该报告。\n\n拒绝包含超过 500 美元差旅费用的报销报告。',

Note

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

View workflow run

@github-actions
Copy link
Copy Markdown
Contributor

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

…cks for name, prompt, and avatar into a single boolean
…tyles in AvatarSelector and EditAgentAvatarPage
…n and improve navigation handling in AddAgentAvatarPage
…ction and refine mock implementations in related tests
@NicolasBonet NicolasBonet force-pushed the feat/90250-add-agent-avatar-functionality branch from 4bdc823 to e61227f Compare May 15, 2026 17:45

const initialPresetID = getInitialPresetID();

const handleSave = useCallback((params: OnSaveParams) => {
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.

❌ CLEAN-REACT-PATTERNS-0 (docs)

React Compiler is enabled and this file compiles successfully. The useCallback on line 25 is redundant -- the compiler automatically memoizes closures based on their captured variables. Manual memoization adds noise and can interfere with the compiler's optimization model.

Remove useCallback and use a plain function:

const handleSave = (params: OnSaveParams) => {
    if ('customExpensifyAvatarID' in params) {
        setPendingAvatar({type: 'preset', id: params.customExpensifyAvatarID});
    } else {
        setPendingAvatar({type: 'file', file: params.file, uri: params.uri});
    }
    Navigation.goBack(ROUTES.SETTINGS_AGENTS_ADD);
};

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


const [personalDetails] = useOnyx(ONYXKEYS.PERSONAL_DETAILS_LIST, {selector: (list) => list?.[accountID]});

const initialBotAvatar = useMemo(() => {
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.

❌ CLEAN-REACT-PATTERNS-0 (docs)

React Compiler is enabled and this file compiles successfully. The useMemo wrapping initialBotAvatar is redundant -- the compiler automatically caches derived values based on their dependencies.

Remove useMemo and compute the value directly:

const initialBotAvatar = initialPresetID ? (botAvatars.find((av) => botAvatarIDs.get(av) === initialPresetID) ?? null) : null;

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

onSave({file: imageData.file, uri: imageData.uri});
return;
}
updateAgentAvatar(accountID, {file: imageData.file, uri: imageData.uri}, personalDetails?.avatar);
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.

❌ PERF-2 (docs)

The handleSave function is missing a return statement after the updateAgentAvatar + Navigation.goBack calls on lines 134-135. When imageData.file is truthy and onSave is falsy, the code calls updateAgentAvatar and Navigation.goBack but then falls through to the if (selectedBotAvatar) check on line 138. While these states are mutually exclusive in practice (selecting a file clears selectedBotAvatar), the missing return makes the control flow unclear and fragile.

Add a return after Navigation.goBack(fallbackRoute) on line 135:

if (imageData.file) {
    if (onSave) {
        onSave({file: imageData.file, uri: imageData.uri});
        return;
    }
    updateAgentAvatar(accountID, {file: imageData.file, uri: imageData.uri}, personalDetails?.avatar);
    Navigation.goBack(fallbackRoute);
    return; // <-- add early return
}

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

@NicolasBonet NicolasBonet merged commit 8cacc02 into main May 15, 2026
39 checks passed
@NicolasBonet NicolasBonet deleted the feat/90250-add-agent-avatar-functionality branch May 15, 2026 20:11
@github-actions
Copy link
Copy Markdown
Contributor

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

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

@OSBotify
Copy link
Copy Markdown
Contributor

🚀 Deployed to staging by https://github.com/NicolasBonet in version: 9.3.76-0 🚀

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

@MelvinBot
Copy link
Copy Markdown
Contributor

No help site changes are required for this PR.

This PR adds agent avatar functionality (setting/editing avatars for custom agents under Account > Agents). I searched App/docs/articles/ and found no existing help site article covering the custom Agents feature. The only agent-related articles are about Concierge Support Agent and an internal AgentZero reference — neither is related to the custom Agents settings feature modified by this PR.

Since the base Agents feature isn't documented on the help site yet, there's no article to update with the new avatar functionality.

@OSBotify
Copy link
Copy Markdown
Contributor

🚀 Deployed to production by https://github.com/roryabraham in version: 9.3.77-3 🚀

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.

5 participants