From 60ca9280e2847acc1bb2530f9e238e638134b002 Mon Sep 17 00:00:00 2001 From: Erwan Leboucher Date: Thu, 20 Aug 2026 09:50:33 +0200 Subject: [PATCH] fix: stabilize jump to latest marker --- src/app/features/room/RoomTimeline.test.tsx | 6 ++++-- src/app/features/room/RoomTimeline.tsx | 1 + 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/app/features/room/RoomTimeline.test.tsx b/src/app/features/room/RoomTimeline.test.tsx index f2e7b647e..a267d0297 100644 --- a/src/app/features/room/RoomTimeline.test.tsx +++ b/src/app/features/room/RoomTimeline.test.tsx @@ -712,8 +712,9 @@ describe('RoomTimeline content ResizeObserver', () => { ); }); - it('cancels a pending context load when opening an already-rendered event', () => { - renderTimeline(); + it('cancels a pending context load when opening an already-rendered event', async () => { + const { getByText } = renderTimeline(); + await settleInitialScroll(); const handleOpenEvent = timelineActionsOptions.current?.handleOpenEvent as | ((eventId: string) => void) @@ -721,6 +722,7 @@ describe('RoomTimeline content ResizeObserver', () => { act(() => handleOpenEvent?.('$evt1')); expect(timelineSync.cancelEventTimelineLoad).toHaveBeenCalled(); + expect(getByText('Jump to Latest')).toBeTruthy(); }); it('keeps a fresh highlight visible for two seconds when refocusing the same event', () => { diff --git a/src/app/features/room/RoomTimeline.tsx b/src/app/features/room/RoomTimeline.tsx index 65e1ee30c..667091f11 100644 --- a/src/app/features/room/RoomTimeline.tsx +++ b/src/app/features/room/RoomTimeline.tsx @@ -999,6 +999,7 @@ export function RoomTimeline({ if (processedIndex !== undefined) { timelineSync.cancelEventTimelineLoad(); + setAtBottom(false); if (vListRef.current) { vListRef.current.scrollToIndex(processedIndex, { align: 'center' }); }