From dac0a038f83825b97dc95d5a52d229e9049ca499 Mon Sep 17 00:00:00 2001 From: Adam Soltys Date: Sat, 15 Aug 2026 16:09:04 -0700 Subject: The header avatar builds fresh each render — the cached-node trick predates the morph, which both obsoleted it and was emptying it MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Claude Fable 5 Claude-Session: https://claude.ai/code/session_014tE4U5nEjGTQy8PwYqamfv --- src/features/messages.js | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) (limited to 'src/features') diff --git a/src/features/messages.js b/src/features/messages.js index 70407ad..d137b91 100644 --- a/src/features/messages.js +++ b/src/features/messages.js @@ -2086,13 +2086,11 @@ export function messagesFeature(ctx) { // one header avatar, so the node itself is reused until the profile // (or account) actually changes. headerAvatar(pk) { - const p = profileOf(pk); - const key = pk + '|' + (p === null ? 'loading' : p.picture || 'fb:' + (p.name || '')); - if (!this._headerAva || this._headerAvaKey !== key) { - this._headerAvaKey = key; - this._headerAva = avatar(pk, 'chat-avatar header-ava', false); - } - return this._headerAva; + // A fresh node every render: the morph keeps the live element (and its + // loaded image) in place when nothing changed, which is exactly what + // the old cached-node trick faked — and reusing one node in two trees + // let the morph strip its children when positions paired it wrong. + return avatar(pk, 'chat-avatar header-ava', false); }, // Conversations waiting on us, for the header's message button. unreadMessages() { return unreadCount(); }, -- cgit v1.2.3