Skip to content

Fix quoted reply rendering#65

Merged
viktorstrate merged 2 commits intoviktorstrate:mainfrom
beezly:fix/quoted-reply-rendering
Mar 10, 2026
Merged

Fix quoted reply rendering#65
viktorstrate merged 2 commits intoviktorstrate:mainfrom
beezly:fix/quoted-reply-rendering

Conversation

@beezly
Copy link
Contributor

@beezly beezly commented Mar 9, 2026

Changes

Two fixes for quoted reply rendering:

1. Show display name instead of Matrix ID

EmbeddedEventDetails.ready includes a senderProfile: ProfileDetails field that was being discarded with _. This meant the quoted reply header always showed the raw Matrix ID (e.g. @alice:matrix.org) instead of the display name shown elsewhere in the timeline.

Fix: extract displayName from senderProfile when .ready, falling back to the sender ID if the profile is pending/unavailable.

2. Load reply details that are pending or unavailable

When a room first loads, replies are often in .pending or .unavailable state — the SDK has the event ID but hasn't fetched the content yet. Without explicitly calling loadReplyDetails, the grey placeholder boxes never resolve because the SDK doesn't always emit a timeline diff to trigger a re-render.

Fix:

  • After each batch of timeline diffs, scan for items with unresolved replies and call timeline.loadReplyDetails(eventIdStr:)
  • Store the returned InReplyToDetails in an observed dictionary (loadedReplyDetails) on LiveTimeline rather than relying on a .set diff from the SDK
  • The view prefers the loaded details over the timeline item's own inReplyTo.event(), which may still report .pending/.unavailable until a diff arrives
  • Deduplicates in-flight loads by checking if an entry already exists in the dictionary before spawning a task

beezly added 2 commits March 9, 2026 22:24
EmbeddedEventDetails.ready has a senderProfile: ProfileDetails field
that was being ignored. Use it to show the display name, falling back
to the sender ID if the profile is pending or unavailable.
When a timeline item has a reply in .pending or .unavailable state,
call timeline.loadReplyDetails() to fetch the content. Store the
returned InReplyToDetails in an observed dictionary on LiveTimeline
so SwiftUI re-renders without relying on the SDK to emit a .set diff.

The view prefers the loaded details over the timeline item's own
inReplyTo.event(), which may still report .pending/.unavailable
until a diff arrives.
@viktorstrate
Copy link
Owner

Looks good, thank you!

@viktorstrate viktorstrate merged commit b90d8ff into viktorstrate:main Mar 10, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants