fix(timeline): clear stale jump to latest state

This commit is contained in:
Erwan Leboucher committed 2026-08-01 16:42:22 +02:00
1 parent 64ee350ed8
commit 606daa5ed8
2 files changed
+20

No files matched your search

@@ -548,6 +548,25 @@ describe('unread read marker (sliding sync)', () => {
});
describe('scroll-edge pagination', () => {
it('marks the timeline as at the bottom when jumping to latest', async () => {
const { getByText, queryByText } = renderTimeline();
await act(async () => {
await new Promise((resolve) => setTimeout(resolve, 150));
});
// Simulate a stale virtualizer measurement reporting the viewport above the
// bottom. A programmatic jump may not emit a follow-up scroll event.
act(() => lastOnScroll?.(0));
expect(getByText('Jump to Latest')).toBeTruthy();
act(() => {
getByText('Jump to Latest').click();
});
expect(queryByText('Jump to Latest')).toBeNull();
});
it('paginates backwards near the top only while a pagination token exists', () => {
const { rerender } = renderTimeline();
+1
View File
@@ -1331,6 +1331,7 @@ export function RoomTimeline({
onClick={() => {
if (eventId) navigateRoom(room.roomId, undefined, { replace: true });
timelineSync.setTimeline(getInitialTimeline(room));
setAtBottom(true);
scrollToBottom();
}}
style={{