Skip to content

Keep the new timeline at the bottom when its viewport changes height - #35277

Closed
langleyd wants to merge 1 commit into
developfrom
fix/new-timeline-bottom-jump
Closed

langleyd wants to merge 1 commit into
developfrom
fix/new-timeline-bottom-jump

Conversation

@langleyd

@langleyd langleyd commented Sep 30, 2026 •

Copy link
Copy Markdown
Member

Currently on opening a room, if the new labs timeline gets resized(say when the pinned message banner appears the composer changes height) it doesn't stay pinned to the bottom.

The result of which can look like this:
image

As reported in #35124.

I'm adding a ResizeObserver that updates the scroll position(if the user was already at the bottom before the resize)

With feature_new_timeline on, a reader sitting at the bottom was left a
few dozen pixels above it whenever the space the timeline has changed:
the composer growing as a longer message is typed, the pinned-messages
banner appearing above the timeline once its events had been fetched
(about a second after entering a room), a status bar coming and going,
the window being resized. The browser keeps scrollTop through all of
these, not the distance from the bottom, so the newest message ended up
cut off by exactly the amount the viewport shrank. The old ScrollPanel
put itself back at the bottom on every panel resize; the shared
TimelineView had nothing equivalent.

The view now watches its scroller with a ResizeObserver and, when the
height changes while the reader was at the bottom (judged from the DOM
with the height the viewport had before the change), scrolls back to the
bottom. TanStack learns of the new position from the scroll event that
causes, so the at-bottom report that would otherwise fire from its stale
offset during that one update is left out; the report after the view
scrolls back down tells the truth.

Reproduced and verified on the rig against two ESS homeservers: entering
a room with a delayed pinned-event fetch, and typing a six-line draft at
the bottom, both left the view 59px short before this change and flush
after it.
@langleyd

langleyd commented Oct 7, 2026

Copy link
Copy Markdown
Member Author

Closed in favour of #35374, it should be fixed at the virtualisation library level.

@langleyd langleyd closed this Oct 7, 2026

This branch was successfully deployed

3 active deployments
EndToEndTests — 8da4df92 Deployed Sep 30, 2026 by github-actions[bot]
Netlify — 8da4df92 Deployed Sep 30, 2026 by github-actions[bot]
SharedComponentStorybook — 8da4df92 Deployed Sep 30, 2026 by github-actions[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant