aboutsummaryrefslogtreecommitdiffstats
path: root/src/features
diff options
context:
space:
mode:
authorAdam Soltys <[email protected]>2026-08-04 01:50:24 -0700
committerAdam Soltys <[email protected]>2026-08-04 01:50:24 -0700
commitc19fd63f1687c8fdfd38a8446e7cf936342ba4ef (patch)
tree0238a55a48d2a6f387a4547df9320428b3e8c7ad /src/features
parent7b7f2b5e8a6f2abc05fef94e0a8f6cb9dd0b9928 (diff)
downloadcoinosv3-c19fd63f1687c8fdfd38a8446e7cf936342ba4ef.tar.gz
coinosv3-c19fd63f1687c8fdfd38a8446e7cf936342ba4ef.zip
Avatars stop flashing everywhere: backgrounds, not <img>
A recreated <img> decodes async — one blank frame per render, and boot renders in bursts. A CSS background paints synchronously from cache, so the profile page, chat rows, and send candidates all hold steady now. Co-Authored-By: Claude Fable 5 <[email protected]>
Diffstat (limited to 'src/features')
-rw-r--r--src/features/messages.js4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/features/messages.js b/src/features/messages.js
index f9a2176..293ebd9 100644
--- a/src/features/messages.js
+++ b/src/features/messages.js
@@ -962,7 +962,9 @@ export function messagesFeature(ctx) {
const node = p === null
? h('div', { class: cls + ' fallback loading' })
: p.picture
- ? h('img', { class: cls, src: p.picture, alt: '' })
+ // A background paints synchronously from cache; a fresh <img> decodes
+ // async, so recreating one per render made avatars visibly flash.
+ ? h('div', { class: cls + ' ava-img', style: `background-image:url(${JSON.stringify(p.picture)})` })
: fallbackAvatar(h, pk, p.name, cls);
if (clickable) {
node.classList.add('clickable');