Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(web): keep following the stream after scrolling back to the live edge #6519

Mergedlnieuwenhuis(GitHub profile, opens in a new tab)merged 1 commit intomain fromrefs/pull/6519/headmerged by t3dotgg(GitHub profile, opens in a new tab) View on GitHub

Showing 2 changed files with 70 additions and 3 deletions.

x
0 of 2 viewed, 2 left
50 additions and 0 deletionsapps/web/src/components/chat/MessagesTimeline.test.tsxModified
View file
@@ -432,6 +432,56 @@
expect(onAnchorReady).toHaveBeenCalledWith(secondEntry.message.id, 1);
});
​
+ it("hands end-following back to the list once the send anchor is released", () => {
+ const firstEntry = buildUserTimelineEntry("First prompt.");
+ const secondEntry = {
+ ...buildUserTimelineEntry("Newest prompt."),
+ id: "entry-2",
+ message: {
+ ...buildUserTimelineEntry("Newest prompt.").message,
+ id: MessageId.make("message-2"),
+ },
+ };
+ const timelineEntries = [firstEntry, secondEntry];
+​
+ // While the send anchor holds the end space open, ChatView owns streaming
+ // scrolls and LegendList must not re-pin behind it.
+ expect(
+ renderToStaticMarkup(
+ <MessagesTimeline
+ {...buildProps()}
+ anchorMessageId={secondEntry.message.id}
+ timelineEntries={timelineEntries}
+ />,
+ ),
+ ).not.toContain('data-maintain-scroll-at-end="enabled"');
+​
+ // Dropping the anchor is what actually gives end-following back, so
+ // returning to the live edge has to release it — re-enabling live follow