You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Due for payment 2026-06-18] [$75] Remove Agent Icons from User Avatar Selection #91980
That ordered list is built from PRESET_AVATAR_CATALOG, which spreads DEFAULTS, SEASON_F1, andBOT_AVATARS together — the bot/Agent icons (bot-avatar--blue/green/ice/pink/tangerine/yellow) are bundled into the same catalog that powers the user picker:
So bot avatars are visually leaking into the user picker through the shared ordered catalog, even though they're only ever meant to be selectable from the agent picker.
What changes do you think we should make in order to solve the problem?
I'd exclude BOT_AVATARS entries from PRESET_AVATAR_CATALOG_ORDERED (the grid source) while keeping them in PRESET_AVATAR_CATALOG itself — the catalog is still used by UserAvatarUtils.getAvatarLocal/URL and Agent.resolveAvatarURI to render existing bot-avatar selections, so we can't remove the entries entirely without breaking already-saved agent avatars.
In src/libs/Avatars/PresetAvatarCatalog.ts, narrow the source of IDs that feed the ordered list to exclude bot avatar IDs:
const buildOrderedAvatars = (): Array<{id: PresetAvatarID} & AvatarEntry> => {
- const allIDS = Object.keys(PRESET_AVATAR_CATALOG) as PresetAvatarID[];+ // BOT_AVATARS power the Agent avatar picker (EditAgentAvatarPage) directly via `botAvatars`;+ // they must not appear in the user avatar selector grid.+ const allIDS = Object.keys(PRESET_AVATAR_CATALOG).filter((id) => !(id in BOT_AVATARS)) as PresetAvatarID[];
const explicit = DISPLAY_ORDER.filter((id) => id in PRESET_AVATAR_CATALOG);
const explicitSet = new Set<PresetAvatarID>(explicit);
const leftovers = allIDS.filter((id) => !explicitSet.has(id)).sort();
const finalIDOrder = [...explicit, ...leftovers];
return finalIDOrder.map((id) => ({
id,
...PRESET_AVATAR_CATALOG[id],
}));
};
DISPLAY_ORDER already doesn't include any bot-avatar--* entry, so this single filter is enough — bot IDs were only reaching the grid through the leftovers fallback. PRESET_AVATAR_CATALOG, getAvatarLocal, getAvatarURL, resolveAvatarURI, and isPresetAvatarID are all untouched, so existing agent avatars and saved bot-avatar references keep resolving correctly.
The screenshot also implicitly verifies the "Edit profile picture" header — that's AvatarPage, which is the only consumer of AvatarSelector (grep confirms no other usage), so this change is fully scoped to the user picker.
What alternative solutions did you explore? (Optional)
Remove ...BOT_AVATARS from PRESET_AVATAR_CATALOG. Simplest one-line change, but it breaks UserAvatarUtils.getAvatarLocal/URL (src/libs/UserAvatarUtils.ts#L147, #L242) and Agent.resolveAvatarURI (src/libs/actions/Agent.ts#L27) for any user or agent that already has a bot avatar saved — those lookups would silently fall through to fallback rendering. Rejected.
Add an excludeIDs / kind prop to AvatarSelector. Pushes filtering to the call site so each consumer scopes its own list. More flexible, but EditAgentAvatarPage doesn't even use AvatarSelector, so there's only one caller — the extra API surface buys nothing today. Rejected as YAGNI; can be revisited if a third selector emerges.
Filter inside AvatarSelector itself. Works, but bakes Agent-feature knowledge into a generic UI component. Keeping the filter in the catalog file co-locates it with the BOT_AVATARS definition, which is the more honest place.
ℹ️ Already resolved. This was fixed and merged via Expensify/App#92002 ("[Avatars] Split out Agent Avatars from User Avatars", merged 2026-06-10). The analysis below is for the record and confirms the root cause and the fix that shipped.
Root cause: The user avatar picker (Settings → Profile → Profile picture) and the Agent avatar picker both drew from a single shared catalog. AvatarSelector iterated the full preset catalog, which spread the bot/Agent icons (bot-avatar--blue/green/ice/pink/tangerine/yellow) into the same ordered list as the user defaults. Bot IDs weren't in the explicit display order, so they leaked into the grid via the alphabetical "leftovers" fallback — hence Agent icons showed up in the user picker.
Fix that shipped: Rather than filtering bot IDs out of one shared catalog (the approach in the accepted proposal), PR #92002 split the monolithic catalog into two independent ones:
UserAvatarCatalog.ts exports USER_AVATARS (defaults + Season F1 only — no bot avatars).
AgentAvatarCatalog.ts exports AGENT_AVATARS (the six bot-avatar--* entries) for the Agent picker.
Why the split was preferred over the proposed filter
The accepted proposal suggested keeping one PRESET_AVATAR_CATALOG and excluding BOT_AVATARS only from the ordered list that feeds the grid, to avoid breaking existing saved bot-avatar lookups. That works, but it leaves Agent-feature knowledge embedded in the shared catalog and relies on a filter that future edits could regress. The shipped solution removes the coupling entirely — user and agent avatars live in separate catalogs with separate ID types, so the two pickers can never share entries again. Existing saved bot-avatar references resolve through the dedicated AGENT_AVATARS catalog and AgentAvatarCatalog.types, so nothing breaks.
No further action needed — closing-the-loop note only.
The solution for this issue has been 🚀 deployed to production 🚀 in version 9.4.5-6 and is now subject to a 7-day regression period 📆. Here is the list of pull requests that resolve this issue:
@brunovjk The PR fixing this issue has been merged! The following checklist (instructions) will need to be completed before the issue can be closed. Please copy/paste the BugZero Checklist from here into a new comment on this GH and complete it. If you have the K2 extension, you can simply click: [this button]. If no checklist is needed for this issue, you can click: [no checklist button]
[Contributor] The offending PR and associated issue have been commented on, pointing out the bug it caused and why, so the author and reviewers can learn from the mistake.
Link to the comment on the PR: No PR directly introduced this issue.
Link to the comment on the Issue:
[Contributor] If the regression was CRITICAL (e.g. interrupts a core flow) A discussion in #expensify-open-source has been started about whether any other steps should be taken (e.g. updating the PR review checklist) in order to catch this type of bug sooner.
Link to discussion:
[Contributor] If it was decided to create a regression test for the bug, please propose the regression test steps using the template below to ensure the same bug will not reach production again.
Regression Test Proposal
Test:
Go to /settings/profile/avatar and click to edit avatar
Activity
David-2002065 commentedon May 28, 2026
Proposal
What is the root cause of that problem?
The user avatar grid in Settings → Profile → Profile picture is driven by
AvatarSelector, which iteratesPRESET_AVATAR_CATALOG_ORDERED:https://github.com/Expensify/App/blob/main/src/components/AvatarSelector.tsx#L7https://github.com/Expensify/App/blob/main/src/components/AvatarSelector.tsx#L50-L71That ordered list is built from
PRESET_AVATAR_CATALOG, which spreadsDEFAULTS,SEASON_F1, andBOT_AVATARStogether — the bot/Agent icons (bot-avatar--blue/green/ice/pink/tangerine/yellow) are bundled into the same catalog that powers the user picker:https://github.com/Expensify/App/blob/main/src/libs/Avatars/PresetAvatarCatalog.ts#L93-L100https://github.com/Expensify/App/blob/main/src/libs/Avatars/PresetAvatarCatalog.ts#L192-L208The Agent avatar picker, on the other hand, does not consume
PRESET_AVATAR_CATALOG_ORDERED— it rendersbotAvatarsdirectly fromDefaultBotAvatars:https://github.com/Expensify/App/blob/main/src/pages/settings/Agents/Fields/EditAgentAvatarPage.tsx#L195-L221So bot avatars are visually leaking into the user picker through the shared ordered catalog, even though they're only ever meant to be selectable from the agent picker.
What changes do you think we should make in order to solve the problem?
I'd exclude
BOT_AVATARSentries fromPRESET_AVATAR_CATALOG_ORDERED(the grid source) while keeping them inPRESET_AVATAR_CATALOGitself — the catalog is still used byUserAvatarUtils.getAvatarLocal/URLandAgent.resolveAvatarURIto render existing bot-avatar selections, so we can't remove the entries entirely without breaking already-saved agent avatars.In
src/libs/Avatars/PresetAvatarCatalog.ts, narrow the source of IDs that feed the ordered list to exclude bot avatar IDs:const buildOrderedAvatars = (): Array<{id: PresetAvatarID} & AvatarEntry> => { - const allIDS = Object.keys(PRESET_AVATAR_CATALOG) as PresetAvatarID[]; + // BOT_AVATARS power the Agent avatar picker (EditAgentAvatarPage) directly via `botAvatars`; + // they must not appear in the user avatar selector grid. + const allIDS = Object.keys(PRESET_AVATAR_CATALOG).filter((id) => !(id in BOT_AVATARS)) as PresetAvatarID[]; const explicit = DISPLAY_ORDER.filter((id) => id in PRESET_AVATAR_CATALOG); const explicitSet = new Set<PresetAvatarID>(explicit); const leftovers = allIDS.filter((id) => !explicitSet.has(id)).sort(); const finalIDOrder = [...explicit, ...leftovers]; return finalIDOrder.map((id) => ({ id, ...PRESET_AVATAR_CATALOG[id], })); };DISPLAY_ORDERalready doesn't include anybot-avatar--*entry, so this single filter is enough — bot IDs were only reaching the grid through theleftoversfallback.PRESET_AVATAR_CATALOG,getAvatarLocal,getAvatarURL,resolveAvatarURI, andisPresetAvatarIDare all untouched, so existing agent avatars and saved bot-avatar references keep resolving correctly.The screenshot also implicitly verifies the "Edit profile picture" header — that's
AvatarPage, which is the only consumer ofAvatarSelector(grepconfirms no other usage), so this change is fully scoped to the user picker.What alternative solutions did you explore? (Optional)
...BOT_AVATARSfromPRESET_AVATAR_CATALOG. Simplest one-line change, but it breaksUserAvatarUtils.getAvatarLocal/URL(src/libs/UserAvatarUtils.ts#L147,#L242) andAgent.resolveAvatarURI(src/libs/actions/Agent.ts#L27) for any user or agent that already has a bot avatar saved — those lookups would silently fall through to fallback rendering. Rejected.excludeIDs/kindprop toAvatarSelector. Pushes filtering to the call site so each consumer scopes its own list. More flexible, butEditAgentAvatarPagedoesn't even useAvatarSelector, so there's only one caller — the extra API surface buys nothing today. Rejected as YAGNI; can be revisited if a third selector emerges.AvatarSelectoritself. Works, but bakes Agent-feature knowledge into a generic UI component. Keeping the filter in the catalog file co-locates it with theBOT_AVATARSdefinition, which is the more honest place.grgia commentedon Jun 1, 2026
In review
grgia commentedon Jun 4, 2026
In Review
grgia commentedon Jun 11, 2026
Merged
grgia commentedon Jun 11, 2026
Adding Bug label for payment to @brunovjk
MelvinBot commentedon Jun 11, 2026
Issue Analysis
Root cause: The user avatar picker (Settings → Profile → Profile picture) and the Agent avatar picker both drew from a single shared catalog.
AvatarSelectoriterated the full preset catalog, which spread the bot/Agent icons (bot-avatar--blue/green/ice/pink/tangerine/yellow) into the same ordered list as the user defaults. Bot IDs weren't in the explicit display order, so they leaked into the grid via the alphabetical "leftovers" fallback — hence Agent icons showed up in the user picker.Fix that shipped: Rather than filtering bot IDs out of one shared catalog (the approach in the accepted proposal), PR #92002 split the monolithic catalog into two independent ones:
UserAvatarCatalog.tsexportsUSER_AVATARS(defaults + Season F1 only — no bot avatars).AgentAvatarCatalog.tsexportsAGENT_AVATARS(the sixbot-avatar--*entries) for the Agent picker.AvatarSelector.tsx:7now importsUSER_AVATARSand iteratesUSER_AVATARS.orderedat line 50, so it is structurally impossible for an Agent icon to appear in the user grid.Why the split was preferred over the proposed filter
The accepted proposal suggested keeping one
PRESET_AVATAR_CATALOGand excludingBOT_AVATARSonly from the ordered list that feeds the grid, to avoid breaking existing saved bot-avatar lookups. That works, but it leaves Agent-feature knowledge embedded in the shared catalog and relies on a filter that future edits could regress. The shipped solution removes the coupling entirely — user and agent avatars live in separate catalogs with separate ID types, so the two pickers can never share entries again. Existing saved bot-avatar references resolve through the dedicatedAGENT_AVATARScatalog andAgentAvatarCatalog.types, so nothing breaks.No further action needed — closing-the-loop note only.
2 remaining items
melvin-bot commentedon Jun 11, 2026
Reviewinglabel has been removed, please complete the "BugZero Checklist".melvin-bot commentedon Jun 11, 2026
The solution for this issue has been 🚀 deployed to production 🚀 in version 9.4.5-6 and is now subject to a 7-day regression period 📆. Here is the list of pull requests that resolve this issue:
If no regressions arise, payment will be issued on 2026-06-18. 🎊
For reference, here are some details about the assignees on this issue:
melvin-bot commentedon Jun 11, 2026
@brunovjk The PR fixing this issue has been merged! The following checklist (instructions) will need to be completed before the issue can be closed. Please copy/paste the BugZero Checklist from here into a new comment on this GH and complete it. If you have the K2 extension, you can simply click: [this button]. If no checklist is needed for this issue, you can click: [no checklist button]
brunovjk commentedon Jun 15, 2026
BugZero Checklist:
[Contributor] The offending PR and associated issue have been commented on, pointing out the bug it caused and why, so the author and reviewers can learn from the mistake.
Link to the comment on the PR: No PR directly introduced this issue.
Link to the comment on the Issue:
[Contributor] If the regression was CRITICAL (e.g. interrupts a core flow) A discussion in #expensify-open-source has been started about whether any other steps should be taken (e.g. updating the PR review checklist) in order to catch this type of bug sooner.
Link to discussion:
[Contributor] If it was decided to create a regression test for the bug, please propose the regression test steps using the template below to ensure the same bug will not reach production again.
Regression Test Proposal
Test:
/settings/profile/avatarand click to edit avatar/settings/agents/newclick to edit avatarDo we agree 👍 or 👎
Zapier Logs
Run ID: 00040eee-c839-a3a6-db74-25046f348114melvin-bot commentedon Jun 17, 2026
Triggered auto assignment to @mallenexpensify (
Awaiting Payment)melvin-bot commentedon Jun 17, 2026
Payment Summary
Upwork Job
BugZero Checklist (@mallenexpensify)
mallenexpensify commentedon Jun 19, 2026
Payment Summary
Contributor+: @brunovjk due $75 via NewDot
garrettmknight commentedon Jun 19, 2026
$75 approved for @brunovjk