From 9c2f9a99e36a37ffb83a77632205243aed84b607 Mon Sep 17 00:00:00 2001 From: klopez4212 Date: Sat, 27 Jun 2026 14:17:11 +0100 Subject: [PATCH] Stabilize virtualized timeline bottom pinning --- desktop/tests/e2e/relay-reconnect.spec.ts | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/desktop/tests/e2e/relay-reconnect.spec.ts b/desktop/tests/e2e/relay-reconnect.spec.ts index beb050112..3ef54ada9 100644 --- a/desktop/tests/e2e/relay-reconnect.spec.ts +++ b/desktop/tests/e2e/relay-reconnect.spec.ts @@ -167,6 +167,22 @@ test("reconnect backfills more missed channel messages than the live subscriptio seenBeforeDisconnect, ); + const timeline = page.getByTestId("message-timeline"); + await expect + .poll(async () => { + return timeline.evaluate((element) => { + const scrollable = element as HTMLDivElement; + scrollable.scrollTop = scrollable.scrollHeight; + scrollable.dispatchEvent(new Event("scroll", { bubbles: true })); + return ( + scrollable.scrollHeight - + scrollable.clientHeight - + scrollable.scrollTop + ); + }); + }) + .toBeLessThan(8); + await disconnectMockWebsockets(page); const missedMessages = Array.from({ length: 260 }, (_, index) => ({ @@ -177,7 +193,6 @@ test("reconnect backfills more missed channel messages than the live subscriptio // The newest backfilled message renders at the bottom once the reconnect // catch-up settles. - const timeline = page.getByTestId("message-timeline"); await expect(timeline).toContainText("reconnect e2e missed 260", { timeout: 15_000, });