Files
lobehub/packages
Arvin Xu 31145c9a1f 🐛 fix: use custom avatar for group chat in sidebar (#12208)
* 🐛 fix: use custom avatar for group chat in sidebar

When a group chat has a custom avatar set, the sidebar was always showing
the member composition avatar instead. This fix:

- Queries chatGroups.avatar and chatGroups.backgroundColor in HomeRepository
- Prioritizes custom avatar (string) over member avatars (array) in data layer
- Replaces GroupAvatar with AgentGroupAvatar in AgentGroupItem for proper
  avatar type detection (custom vs member composition)

Closes LOBE-4883

*  test: add DB tests for group chat custom avatar in sidebar

Add 6 test cases covering the custom avatar fix for chat groups:

getSidebarAgentList:
- should return custom avatar when chat group has one set
- should return member avatars when chat group has no custom avatar
- should prioritize custom avatar over member avatars

searchAgents:
- should return custom avatar for chat groups with custom avatar in search
- should return member avatars for chat groups without custom avatar in search
- should prioritize custom avatar over member avatars in search
2026-02-09 10:04:40 +08:00
..
2026-01-19 19:19:09 +08:00