KamoCRM

Draw member photos at the variant their size calls for

Fixkamo-internal
Spegnimento
24 settembre 2026 alle ore 23:03 UTC
Autore
Kamo
Impegno
6418c55

Every uploaded member photo has _sm (50px), _md (150px) and _lg (350px) beside the original, but surfaces picked them ad hoc: MemberAvatar drew _sm up to 40px (blurry at 2x), and the dock title bar, maximized tab, chat header, hexhead menu, member picker, user admin, wallpaper chip and mail sender avatar drew the full-size upload (often megabytes) at 20-52px. One rule now, in app/lib/avatarUrlTransform.ts: at DPR 2, <=25 CSS px -> _sm, <=75 -> _md, larger -> _lg (avatarVariantForSize), applied only to /avatars/photos/ URLs; anything else loads as given. avatarAttemptsForSize lists the sized variant, then the original (older uploads lack _md/_lg), then the URL as handed over; useAvatarPhoto walks that list on image errors before the caller's initials, and MemberPhotoAvatar is the drop-in for MUI Avatar sites (it draws its own <img>, since MUI's preloader drops the element whose onError would have moved on). Sites: MemberAvatar (by size), MessageAvatar (16 -> sm, shared helper), ToolWindowShell 28 -> md, MaximizedTab 20 -> sm, ChatBox 28 -> md, HexHeadPopover 44 -> md, HexHead by head size (md/lg), MemberPickerDialog 20/30/38 -> sm/md/md, UserAccountManager 28 -> md, UserAccountDrawer 52 -> md, MemberIdentityChip 40 -> md, SenderAvatar by size (40 -> md), AvatarManager gallery 80 -> md (+ urlOriginal), ProfileHero 84-104 -> lg (was md), Exec2ExecUserRow 36 -> md and Exec2ExecWindow 26 -> md (were sm). ChatTool and the hexhead engine now resolve the original and let each surface size it; ConversationRow hands MemberAvatar the raw URL.

Tutte le modifiche

Come quello che vedi la spedizione?

Tutto questo arriva nel vostro spazio di lavoro da solo. Iniziare sul piano gratuito e leggere di nuovo questa pagina in un mese.

Inizia gratis per sempreVisualizza il prezzo