Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(web): reduce chat timeline scroll twitching and overlap #1054

Closedhuxcrux(GitHub profile, opens in a new tab)wants to merge 6 commits intomain fromrefs/pull/1054/headopened View on GitHub

Showing 6 changed files with 100 additions and 20 deletions (loading 4).

x
0 of 6 viewed, 6 left
99 additions and 19 deletionsapps/web/src/components/chat/MessagesTimeline.tsxModified
View file
@@ -8,7 +8,11 @@
import { deriveTimelineEntries, formatElapsed } from "../../session-logic";
import { AUTO_SCROLL_BOTTOM_THRESHOLD_PX } from "../../chat-scroll";
import { type TurnDiffSummary } from "../../types";
-import { summarizeTurnDiffStats } from "../../lib/turnDiffTree";
+import {
+ buildTurnDiffTree,
+ countVisibleTurnDiffTreeNodes,
+ summarizeTurnDiffStats,
+} from "../../lib/turnDiffTree";
import ChatMarkdown from "../ChatMarkdown";
import {
BotIcon,
@@ -26,7 +30,7 @@
} from "lucide-react";
import { Button } from "../ui/button";
import { clamp } from "effect/Number";
-import { estimateTimelineMessageHeight } from "../timelineHeight";
+import { estimateTimelineMessageHeight, estimateTimelineWorkGroupHeight } from "../timelineHeight";
import { buildExpandedImagePreview, ExpandedImagePreview } from "./ExpandedImagePreview";
import { ProposedPlanCard } from "./ProposedPlanCard";
import { ChangedFilesTree } from "./ChangedFilesTree";
@@ -39,6 +43,8 @@
​
const MAX_VISIBLE_WORK_LOG_ENTRIES = 6;
const ALWAYS_UNVIRTUALIZED_TAIL_ROWS = 8;
+const TIMELINE_BASE_OVERSCAN_ROWS = 8;
+const MIN_ROWS_TO_ENABLE_VIRTUALIZATION = 120;