The best way to control Claude Code, Codex and more from any computer or phone
Mirrored from https://github.com/Camo67/t3code.git
Synced Nov 22, 13:15 UTC
fix(web): scroll-to-end button no longer jumps up and down (#26375)
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Theo Browne committed
Oct 28, 2026 at 02:22 UTC
c677d5fc45e6d585e52bca03244a0870c588a555
2 files changed
+27
-2
apps/web/src/components/chat/MessagesTimeline.browser.test.tsx
+23
@@ -205,6 +205,29 @@ describe("MessagesTimeline messages", () => {
205
expect(maxNestedCommits).toBeLessThan(20);
206
});
207
208
+ it("keeps reporting overflow while the composer inset changes", async () => {
209
+ setup();
210
+ const props = baseProps();
211
+ const overflowReports: boolean[] = [];
212
+ const replies = Array.from({ length: 40 }, (_, index) =>
213
+ message(`Reply ${index}\n\n${"line\n\n".repeat(8)}`, { role: "assistant" }, `r-${index}`),
214
+ );
215
+ const timeline = (inset: number) => (
216
+ <MessagesTimeline
217
+ {...props}
218
+ timelineEntries={replies}
219
+ contentInsetEndAdjustment={inset}
220
+ onContentOverflowChange={(overflows) => overflowReports.push(overflows)}
221
+ />
222
+ );
223
+ await using screen = await renderElement(timeline(110));
224
+ await vi.waitFor(() => expect(overflowReports.at(-1)).toBe(true));
225
+ overflowReports.length = 0;
226
+ // The resting composer resizes with overflow; a false report here flips it back.
227
+ await screen.rerender(timeline(148));
228
+ expect(overflowReports).not.toContain(false);
229
+ });
230
+
231
it("keeps the first and last message headings reachable from either end", async () => {
232
setup();
233
const props = baseProps();
apps/web/src/components/chat/MessagesTimeline.tsx
+4
-2
@@ -1144,7 +1144,9 @@ const ConversationTimeline = memo(function ConversationTimeline({
1144
1145
const canvas = useChatCanvas();
1146
const registerTimeline = canvas?.registerTimeline;
1147
- const setTimelineList = (list: LegendListRef | null) => {
1147
+ // Stable so the list attaches once per mount. A re-attach reports no overflow for a frame,
1148
+ // which flips the resting composer, resizes it, and re-renders this list again.
1149
+ const setTimelineList = useStableCallback((list: LegendListRef | null) => {
1150
listRef.current = list;
1151
const scrollNode: HTMLElement | null = list?.getScrollableNode() ?? null;
1152
registerTimeline?.(scrollNode);
@@ -1190,7 +1192,7 @@ const ConversationTimeline = memo(function ConversationTimeline({
1192
listRef.current = null;
1193
registerTimeline?.(null);
1194
};
1193
- };
1195
+ });
1196
1197
useThreadFindPositionReader({
1198
threadKey: listIdentityKey,