Skip to content
Merged
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
54 changes: 29 additions & 25 deletions apps/web/test/renderScenarios.renders.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -85,36 +85,40 @@ const versionedProps = { onManualNavigation: () => {} };

// One list handle per mounted timeline, as ChatView keeps one: the timeline compares the
// handle across renders, and a new one per render would skip its scroll-to-end and settle work.
// The callbacks and lists stay the same across renders too, as ChatView's do: new ones change
// the rows' shared context, which re-renders every row and hides a row that re-renders alone.
function timelineFor() {
const listRef = createRef<LegendListRef | null>();
const props: Omit<TimelineProps, "timelineEntries" | "routeThreadKey"> = {
isWorking: false,
listRef: createRef<LegendListRef | null>(),
latestRun: null,
turnDiffSummaries: [],
runs: [],
onOpenTurnDiff: () => {},
onOpenThread: () => {},
onForkFromRun: async () => {},
supportsConversationRollback: false,
onRevertToTurnCount: () => {},
isRevertingCheckpoint: false,
onImageExpand: () => {},
activeThreadEnvironmentId: ENVIRONMENT_ID,
markdownCwd: undefined,
resolvedTheme: "light",
timestampFormat: "locale",
workspaceRoot: undefined,
anchorMessageId: null,
onAnchorReady: () => {},
onAnchorSizeChanged: () => {},
contentInsetEndAdjustment: 0,
emptyPlaceholderInset: 0,
liveFollowEnabled: true,
onIsAtEndChange: () => {},
};
return (thread: string, entries: Entry[]) => (
<MessagesTimeline
{...props}
timelineEntries={entries}
isWorking={false}
listRef={listRef}
latestRun={null}
turnDiffSummaries={[]}
runs={[]}
routeThreadKey={`environment-local:${thread}`}
onOpenTurnDiff={() => {}}
onOpenThread={() => {}}
onForkFromRun={async () => {}}
supportsConversationRollback={false}
onRevertToTurnCount={() => {}}
isRevertingCheckpoint={false}
onImageExpand={() => {}}
activeThreadEnvironmentId={ENVIRONMENT_ID}
markdownCwd={undefined}
resolvedTheme="light"
timestampFormat="locale"
workspaceRoot={undefined}
anchorMessageId={null}
onAnchorReady={() => {}}
onAnchorSizeChanged={() => {}}
contentInsetEndAdjustment={0}
emptyPlaceholderInset={0}
liveFollowEnabled
onIsAtEndChange={() => {}}
{...versionedProps}
/>
);
Expand Down
Loading