feat(cosmetics): оформление «для друзей» в друзьях и личных беседах

- API: список друзей отдаёт вычисленное оформление «для друзей» одним запросом
  на весь список (AGENT.md 7.2)
- клиент: рамка, иконка, цвет и эффект ника в списке друзей, в ленте личных
  бесед — из профиля собеседника
- тесты: Go на список друзей, Vitest на отрисовку в друзьях
This commit is contained in:
2026-09-21 01:48:56 +03:00
parent 75b71da7b7
commit a36ee9527b
8 changed files with 192 additions and 5 deletions
+9 -3
View File
@@ -3,7 +3,7 @@ import { useMutation } from '@tanstack/react-query';
import { useTranslation } from 'react-i18next';
import { removeRelationship, type RelationshipUser } from '@/api/friends';
import { Avatar } from '@/components/ui/Avatar';
import { FramedAvatar, Nickname } from '@/components/profile/Cosmetics';
import { ErrorNotice } from '@/components/ui/ErrorNotice';
import { Menu, MenuItem, MenuSeparator } from '@/components/ui/Menu';
import { Popover } from '@/components/ui/Popover';
@@ -77,11 +77,12 @@ export function FriendRow({ friend }: { friend: RelationshipUser }) {
data-testid={`friend-name-${friend.user_id}`}
>
<span className="relative shrink-0">
<Avatar
<FramedAvatar
name={displayName}
seed={friend.user_id}
fileId={friend.avatar_file_id}
size="md"
cosmetics={friend.cosmetics}
/>
<span
aria-hidden="true"
@@ -92,7 +93,12 @@ export function FriendRow({ friend }: { friend: RelationshipUser }) {
/>
</span>
<span className="min-w-0 flex-1">
<span className="block truncate text-sm font-medium">{displayName}</span>
{/* Ник с оформлением «для друзей»: цвет, эффект и иконка. */}
<Nickname
name={displayName}
cosmetics={friend.cosmetics}
className="text-sm font-medium"
/>
<span className="block truncate text-xs text-fg-muted">@{friend.username}</span>
</span>
</button>