Skip to content

Commit ef7449e

Browse files
fix(OUT-3501): fix deleted parent comment avatar size mismatch
The CopilotAvatar icon branch rendered a default MUI Avatar (40x40px) while normal comment avatars use AssemblyAvatar xs size (20x20px). This caused deleted parent comments to appear out of place. Map the size prop to correct pixel dimensions for the icon avatar variant. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 9aa9e32 commit ef7449e

2 files changed

Lines changed: 9 additions & 3 deletions

File tree

src/app/detail/ui/Comments.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
import { CopilotAvatar } from '@/components/atoms/CopilotAvatar'
22
import { CommentCard } from '@/components/cards/CommentCard'
3-
import { TrashIcon2 } from '@/icons'
43
import { selectTaskBoard } from '@/redux/features/taskBoardSlice'
54
import { CreateComment } from '@/types/dto/comment.dto'
65
import { OptimisticUpdate } from '@/utils/optimisticCommentUtils'
76
import { LogResponse } from '@api/activity-logs/schemas/LogResponseSchema'
87
import { Stack } from '@mui/material'
98
import { useSelector } from 'react-redux'
109
import { VerticalLine } from './styledComponent'
10+
import { Icon } from 'copilot-design-system'
1111

1212
interface Prop {
1313
token: string
@@ -32,7 +32,7 @@ export const Comments = ({ token, comment, createComment, deleteComment, task_id
3232
style={{
3333
marginTop: '8px',
3434
}}
35-
icon={comment.details.deletedAt ? <TrashIcon2 /> : undefined}
35+
icon={comment.details.deletedAt ? <Icon icon="Trash" width={10} height={10} /> : undefined}
3636
/>
3737

3838
<CommentCard

src/components/atoms/CopilotAvatar.tsx

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,14 @@ export const CopilotAvatar = ({ currentAssignee, alt, size = 'sm', icon, classNa
3333
}, [currentAssignee?.name, currentAssignee?.familyName, currentAssignee?.givenName])
3434

3535
if (icon) {
36+
const sizeMap: Record<string, number> = { '3xs': 12, '2xs': 16, xs: 20 }
37+
const dimension = sizeMap[size]
3638
return (
37-
<Avatar sx={avatarSx} variant={avatarVariant}>
39+
<Avatar
40+
sx={{ ...avatarSx, ...(dimension ? { width: dimension, height: dimension } : {}) }}
41+
variant={avatarVariant}
42+
style={style}
43+
>
3844
{icon}
3945
</Avatar>
4046
)

0 commit comments

Comments
 (0)