fix: safari chat regressions #264

Closed
userAdityaa wants to merge 1 commits from userAdityaa/flotilla:regression-safari into dev
Collaborator

Summary

Safari's flex-col-reverse chat streams don't support scroll anchoring, causing new messages to push the viewport up. We now manually pin the scroll position when already at bottom. Additionally, we fixed a stale cleanup function issue that prevented proper feed resubscription on room revisit, and enabled optimistic self-message visibility by allowing recent self-events without relay confirmation to appear immediately (limited to chat feeds only).

closes #236

### Summary Safari's `flex-col-reverse` chat streams don't support scroll anchoring, causing new messages to push the viewport up. We now manually pin the scroll position when already at bottom. Additionally, we fixed a stale cleanup function issue that prevented proper feed resubscription on room revisit, and enabled optimistic self-message visibility by allowing recent self-events without relay confirmation to appear immediately (limited to chat feeds only). <video src="attachments/26bd70d4-9f4b-4a43-8d71-25e80efd6c97" title="Screen Recording 2026-05-03 at 9.45.12 PM.mp4" controls></video> closes #236
userAdityaa added 1 commit 2026-05-03 16:15:41 +00:00
hodlbod reviewed 2026-05-04 21:36:18 +00:00
@@ -117,0 +123,4 @@
(allowOptimisticSelfEvents &&
event.pubkey === pubkey.get() &&
tracker.getRelays(event.id).size === 0 &&
event.created_at >= now() - 60)),
Owner

This should be handled by welshman's thunk stuff (when a thunk is enqueued it optimistically tracks it at all target relays). Are you seeing new events not showing up immediately?

This should be handled by welshman's thunk stuff (when a thunk is enqueued it optimistically tracks it at all target relays). Are you seeing new events not showing up immediately?
Author
Collaborator

Are you seeing new events not showing up immediately?

Not consistently. It’s an intermittent Safari timing issue, so new events can appear immediately most of the time, but occasionally show up late (especially right after send) until relay confirmation arrives.

This issue doesn’t occur in browsers like Chrome or Firefox, which I’ve also tested.

> Are you seeing new events not showing up immediately? Not consistently. It’s an intermittent Safari timing issue, so new events can appear immediately most of the time, but occasionally show up late (especially right after send) until relay confirmation arrives. This issue doesn’t occur in browsers like Chrome or Firefox, which I’ve also tested.
Owner

I finally had a chance to look into this more closely and I think the solution is simpler, a few months ago I added content-visibility: auto to chat messages to improve rendering performance, but that is messing Safari up. I removed it in c6b0799b and this all looks good now. Feel free to open another issue if there's still something wrong.

I finally had a chance to look into this more closely and I think the solution is simpler, a few months ago I added `content-visibility: auto` to chat messages to improve rendering performance, but that is messing Safari up. I removed it in c6b0799b and this all looks good now. Feel free to open another issue if there's still something wrong.
hodlbod closed this pull request 2026-05-06 16:28:30 +00:00

Pull request closed

Sign in to join this conversation.