🐛 fix(inbox): restore inbox avatar fallback after deletion#13752
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## canary #13752 +/- ##
==========================================
- Coverage 66.56% 66.56% -0.01%
==========================================
Files 2022 2022
Lines 171262 171257 -5
Branches 20683 20682 -1
==========================================
- Hits 113998 113991 -7
- Misses 57139 57141 +2
Partials 125 125
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Pull request overview
Fixes inbox avatar fallback behavior after avatar deletion by ensuring avatar clearing is persisted and by applying an inbox-specific default avatar in agent selectors.
Changes:
- Treat avatar deletion as an explicit
nullupdate so it isn’t dropped during merge/update flows. - Add inbox-specific avatar fallback logic to agent meta selectors.
- Add regression tests covering inbox fallback and explicit avatar clearing behavior.
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| src/store/agent/slices/agent/action.ts | Narrows meta update typing to allow avatar: null (explicit clear) and aligns store action signatures. |
| src/store/agent/slices/agent/action.test.ts | Adds regression test ensuring avatar: null is preserved through the update call path. |
| src/store/agent/selectors/selectors.ts | Adds DEFAULT_INBOX_AVATAR fallback when the inbox agent has no custom avatar. |
| src/store/agent/selectors/selectors.test.ts | Adds tests verifying inbox-specific avatar fallback for current and by-id meta selectors. |
| src/services/agent.ts | Updates service typing for meta updates to allow nullable avatar clears. |
| src/routes/(main)/group/profile/features/MemberProfile/AgentHeader.tsx | Switches avatar delete behavior from undefined to null for optimistic meta updates. |
| src/routes/(main)/agent/profile/features/ProfileEditor/AgentHeader.tsx | Switches avatar delete behavior from undefined to null for meta updates. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| type AgentMetaUpdate = Partial< | ||
| Pick< | ||
| AgentItem, | ||
| 'avatar' | 'backgroundColor' | 'description' | 'marketIdentifier' | 'tags' | 'title' | ||
| > | ||
| >; |
There was a problem hiding this comment.
AgentMetaUpdate is defined locally here and also in src/store/agent/slices/agent/action.ts with the same shape. Consider extracting a single shared type (e.g., exported from a types module) to avoid the two definitions drifting over time when meta fields change.
💻 Change Type
🔗 Related Issue
🔀 Description of Change
nullso clearing the avatar is not swallowed by the update merge path🧪 How to Test
Local verification:
bunx vitest run --silent='passed-only' 'src/store/agent/selectors/selectors.test.ts' 'src/store/agent/slices/agent/action.test.ts'bun run type-check📸 Screenshots / Videos
📝 Additional Information
origin/canaryto ensure the PR contains only this fix.