Repository navigation
Conversation
…sent A pending message names no sender picture, and the row fell back to the account's, which may be missing and is never a server's own picture of me. It now borrows the picture my newest message in the conversation shows, the same one the echo brings, before the account's. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…il the recovery test Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
@vbmithr this one fixes the avatar flicker from #46. What changed (
Tests (
Not covered:
This branch also carries the fix for a flaky macOS pacing test (#54), which was failing CI here. To try it: git fetch origin pull/53/head:pr-53 && git checkout pr-53
cargo test -p tinyclient --features gui gui::conversation::draw
cargo run -p tinyclient --features gui # starts chatd beside itIn a Discord channel where your earlier messages show your avatar (ideally a server where you have a per-server avatar), send a message. The sending row should show the same avatar from start to finish, with no generic icon. |
Cause
chatd'snew_messagebuilds the pending row withMessage::plain(..., "You", ..., true), so it has no sender id or avatar. Ingui/conversation/draw.rs::avatar, an outgoing message with no avatar went straight toown_picture, which is the account snapshot's avatar. That avatar can be missing, and it is never the server-specific one. So the row showed a generic plate (or the global picture) until Discord's echo arrived with the sender avatar fromadapters/discord/content.rs.Fix
This is GUI only. The GUI is the only client that draws avatars, and it already has the conversation's messages in memory, so no database or network lookup is needed per send.
whoused is pulled out into a puresaid_by(root, messages, id). It still finds my newest message with a picture first and otherwise my newest message, so a tombstone doesn't drop the picture.own_face: for my own message, use its own avatar. If it has none, use the avatar on my newest earlier message in this conversation (matched onopen.me), which is the server-specific picture when Discord sent one. Only then fall back to the account avatar.MediaFilethe echo will carry, so the avatar stays put when the message is confirmed.Validation
cargo test -p tinyclient --features gui(the CI command): 351 passed, 0 failed, 1 ignored. This includes 3 new tests ingui::conversation::draw::tests:mematches nothingcargo test -p tinyclient(no features): 12 passedcargo test -p chatd: 288 passed, 0 failed (no changes there)cargo clippy -p tinyclient --features gui --all-targets: nothing new indraw.rsFixes #46
🤖 Generated with Claude Code