Repository navigation
Conversation
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.
Member
Author
|
Closed in favour of #35374, it should be fixed at the virtualisation library level. |
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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:

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)