Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -1504,15 +1504,17 @@ describe("MessagesTimeline scroll position", () => {

it("restores a manual reading position after reopening and switching threads", async () => {
const props = baseProps();
function Chat() {
function Chat({ routeThreadKey = props.routeThreadKey }: { routeThreadKey?: string }) {
const [liveFollowEnabled, setLiveFollowEnabled] = useState(true);
// The chat view stops following the live edge when the reader scrolls.
return (
<div className="contents" onWheelCapture={() => setLiveFollowEnabled(false)}>
<MessagesTimeline
{...props}
routeThreadKey={routeThreadKey}
timelineEntries={tallEntries}
liveFollowEnabled={liveFollowEnabled}
onManualNavigation={() => setLiveFollowEnabled(false)}
/>
</div>
);
Expand All @@ -1532,9 +1534,7 @@ describe("MessagesTimeline scroll position", () => {
scrollOffset: offset,
});

const timeline = (routeThreadKey: string) => (
<MessagesTimeline {...props} routeThreadKey={routeThreadKey} timelineEntries={tallEntries} />
);
const timeline = (routeThreadKey: string) => <Chat routeThreadKey={routeThreadKey} />;
await using screen = await renderElement(timeline(props.routeThreadKey));
const reopenedViewport = await waitForList(props);
await vi.waitFor(() =>
Expand Down
Loading