Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(web): reopen a thread that was following its stream at the end #14916

Closedsantiago-ramos-02(GitHub profile, opens in a new tab)wants to merge 1 commit intomain fromrefs/pull/14916/headopened View on GitHub

Showing 3 changed files with 109 additions and 2 deletions.

x
0 of 3 viewed, 3 left
89 additions and 1 deletionapps/web/src/components/chat/MessagesTimeline.test.tsxModified
View file
@@ -17,9 +17,10 @@
import { renderToStaticMarkup } from "react-dom/server";
import { create, type ReactTestRenderer } from "react-test-renderer";
import { shouldUseRestingComposerLayout } from "../composerFooterLayout";
+import { readTimelinePosition } from "./timelineScrollAnchoring";
import { useComposerFocusState } from "./useComposerFocusState";
import { beforeAll, beforeEach, describe, expect, it, vi } from "vite-plus/test";
-import type { LegendListRef } from "@legendapp/list/react";
+import { LegendList, type LegendListRef } from "@legendapp/list/react";
​
const activityTestState = vi.hoisted(() => ({
expanded: false,
@@ -292,6 +293,7 @@
onAnchorSizeChanged: () => {},
contentInsetEndAdjustment: 0,
liveFollowEnabled: true,
+ isLiveFollowLatched: () => true,
onIsAtEndChange: () => {},
onManualNavigation: () => {},
@@ -1108,6 +1110,92 @@
expect(markup).not.toContain("<a ");
+ it("remembers a live-following thread at the end while the follow scroll trails output", () => {
+ vi.stubGlobal("requestAnimationFrame", () => 0);
+ vi.stubGlobal("cancelAnimationFrame", () => {});
+ vi.stubGlobal("IS_REACT_ACT_ENVIRONMENT", true);