Skip to content
Source
Sign inSign up
pingdotgg/t3code

perf(web): reduce minimap work during streaming and scrolling #9771

Closedt3dotgg(GitHub profile, opens in a new tab)wants to merge 1 commit intomain fromt3code/perf-web-minimap-workopened View on GitHub

Showing 3 changed files with 218 additions and 0 deletions (loading 2).

x
0 of 3 viewed, 3 left
218 additions and 0 deletionsapps/web/src/components/chat/MessagesTimeline.logic.test.tsModified
View file
@@ -1,6 +1,7 @@
import { describe, expect, it } from "vite-plus/test";
import { MessageId, TurnId } from "@t3tools/contracts";
import {
+ createTimelineMinimapProjector,
computeStableMessagesTimelineRows,
computeMessageDurationStart,
deriveMessagesTimelineRows,
@@ -11,6 +12,7 @@
resolveWorkGroupScrollIndex,
shouldFollowWorkGroupAppend,
shouldPreserveAssistantLineBreaks,
+ updateTimelineMinimapMarkers,
type MessagesTimelineRow,
workEntryDisplayLabel,
} from "./MessagesTimeline.logic";
@@ -22,6 +24,95 @@
} from "../../session-logic";
import { isImageAttachment, type ChatMessage, type TurnDiffSummary } from "../../types";
​
+describe("minimap marker updates", () => {
+ const items = Array.from({ length: 6 }, (_, index) => ({
+ id: `marker-${index}`,
+ rowIndex: index,
+ userText: "User message",
+ assistantText: null,
+ }));
+ const state = {
+ scroll: 10,