Timeline: your own newly sent message can land below the fold with "Jump to Latest" (stale at-bottom flag after a poll vote) #212

Closed
opened 2026-09-18 17:49:35 -04:00 by jared · 1 comment
Owner

Seen while verifying #171 (repeatable, timing-dependent): create a poll, vote on it (the poll grows by a row), then create a second poll/send a message → the timeline does not scroll to it and shows Jump to Latest, even though the user never scrolled up.

Cause: RoomTimeline.tsx only auto-scrolls on a live event when atBottomRef.current is true (useLiveEventArrive, ~L676). The at-bottom anchor briefly leaves the viewport when in-place content grows (poll result rows), the 1 s debounceSetAtBottom(false) fires, and the flag is stale when the user's own event arrives.

Fix options: (a) treat the user's own live events as an unconditional scroll-to-bottom (what people expect after pressing Send), (b) only clear at-bottom on user-initiated scroll (wheel/touchmove/keyboard) rather than on any anchor exit. (a) is a two-line change in the useLiveEventArrive callback; keep the current behaviour for others' messages.

Seen while verifying #171 (repeatable, timing-dependent): create a poll, vote on it (the poll grows by a row), then create a second poll/send a message → the timeline does **not** scroll to it and shows *Jump to Latest*, even though the user never scrolled up. Cause: `RoomTimeline.tsx` only auto-scrolls on a live event when `atBottomRef.current` is true (`useLiveEventArrive`, ~L676). The at-bottom anchor briefly leaves the viewport when in-place content grows (poll result rows), the 1 s `debounceSetAtBottom(false)` fires, and the flag is stale when the user's own event arrives. Fix options: (a) treat the user's **own** live events as an unconditional scroll-to-bottom (what people expect after pressing Send), (b) only clear at-bottom on user-initiated scroll (`wheel`/`touchmove`/keyboard) rather than on any anchor exit. (a) is a two-line change in the `useLiveEventArrive` callback; keep the current behaviour for others' messages.
jared added the bugpriority: lowuxarea: messaging labels 2026-09-18 17:49:35 -04:00
Author
Owner

Fixed in 464951ed, option (a): an own non-relation/non-state/non-reaction live event always brings the live end into view — advance the range + smooth scroll when the window is at the live end, otherwise reset to the live timeline exactly like the Jump to Latest button. Others' messages keep the current behaviour.

The poll-vote timing race itself didn't reproduce headless today (3 rounds of create → vote → re-vote → send all auto-scrolled), so I verified the deterministic form: scroll up 600 px → Send → message visible, no Jump pill (before the change: Jump pill shown, message off-screen). The stale-flag case is covered by the same branch since it no longer consults the flag for your own messages.

Fixed in `464951ed`, option (a): an own non-relation/non-state/non-reaction live event always brings the live end into view — advance the range + smooth scroll when the window is at the live end, otherwise reset to the live timeline exactly like the Jump to Latest button. Others' messages keep the current behaviour. The poll-vote timing race itself didn't reproduce headless today (3 rounds of create → vote → re-vote → send all auto-scrolled), so I verified the deterministic form: scroll up 600 px → Send → **message visible, no Jump pill** (before the change: Jump pill shown, message off-screen). The stale-flag case is covered by the same branch since it no longer consults the flag for your own messages.
jared closed this issue 2026-09-19 12:40:58 -04:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: LotusGuild/cinny#212