Skip to content
Merged
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion apps/app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
"@radix-ui/react-slot": "^1.3.0",
"@radix-ui/react-tooltip": "^1.2.12",
"@tanstack/react-query": "^5.62.0",
"@tanstack/react-virtual": "^3.14.2",
"@tanstack/react-virtual": "3.14.20",
"@tiptap/core": "^3.26.0",
"@tiptap/extension-blockquote": "^3.26.0",
"@tiptap/extension-document": "^3.26.0",
Expand Down
36 changes: 0 additions & 36 deletions apps/app/src/components/thread/timeline/TerminalOutputBlock.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,6 @@ export interface TerminalOutputBlockProps {
streaming: boolean;
}

interface TerminalScrollContentKeyArgs {
commandLine: string;
exitCode: number | null;
metadataLines: readonly string[];
output: string;
}

const ANSI_THEME_COLORS: Record<number, string> = {
0: "var(--ansi-0)",
1: "var(--ansi-1)",
Expand Down Expand Up @@ -65,28 +58,6 @@ const ANSI_TO_HTML = new Convert({
colors: ANSI_THEME_COLORS,
});

function stringLengthSum(values: readonly string[]): number {
let length = 0;
for (const value of values) {
length += value.length;
}
return length;
}

function terminalScrollContentKey({
commandLine,
exitCode,
metadataLines,
output,
}: TerminalScrollContentKeyArgs): string {
return [
commandLine.length,
stringLengthSum(metadataLines),
output.length,
exitCode ?? "",
].join(":");
}

export function TerminalOutputBlock({
commandLine,
exitCode,
Expand All @@ -103,12 +74,6 @@ export function TerminalOutputBlock({
);

const showExitCode = exitCode !== null;
const outputContentKey = terminalScrollContentKey({
commandLine,
exitCode,
metadataLines,
output,
});

return (
<div className="overflow-hidden rounded-lg border border-border bg-card">
Expand All @@ -132,7 +97,6 @@ export function TerminalOutputBlock({
<TimelineDetailScroll
size="base"
streaming={streaming}
contentKey={outputContentKey}
className="mt-1.5"
scrollClassName="whitespace-pre leading-tight text-muted-foreground"
>
Expand Down

This file was deleted.

107 changes: 30 additions & 77 deletions apps/app/src/components/thread/timeline/ThreadTimelineRows.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,6 @@ import {
import { WorkRowBody } from "./TimelineRowDetails.js";
import { TimelineDetailScroll } from "./TimelineDetailScroll.js";
import { Button } from "@bb/shared-ui/button";
import { AutoHeightContainer } from "../../ui/height-transition.js";
import { Icon, type IconName } from "@bb/shared-ui/icon";
import { presentationTintStyle } from "./presentation-display.js";
import { usePluginIconUrl } from "@/lib/plugin-logos";
Expand All @@ -109,7 +108,7 @@ import {
} from "./PluginTimelineRendererBody.js";
import type { PromptMentionLinkResolver } from "@bb/client-core";
import {
TimelineScrollRestoreRowIdContext,
TimelineScrollRestoreContext,
useBottomAnchoredScroll,
} from "@/components/ui/bottom-anchored-scroll-body.js";
import {
Expand All @@ -121,7 +120,6 @@ import {
import {
joinSignatureParts,
timelineRowRenderSignature,
timelineRowsSignature,
} from "@bb/client-core";
import {
TOP_LEVEL_TIMELINE_ROW_INTRINSIC_SIZE_CLASS_NAME,
Expand Down Expand Up @@ -553,23 +551,6 @@ function useTimelineSearchExpansionRowIds(
}, [inheritedRowIds, rows, target, threadId]);
}

function timelineHeightSnapRevision(rows: readonly TimelineRow[]): string {
const firstRowId = rows[0]?.id;

for (let index = rows.length - 1; index >= 0; index -= 1) {
const row = rows[index];
if (row?.kind === "turn") {
return joinSignatureParts([
firstRowId,
row.id,
row.sourceSeqStart,
row.sourceSeqEnd,
]);
}
}
return joinSignatureParts([firstRowId, "active"]);
}

function useTimelineViewRowsCache(): GetTimelineViewRows {
const cacheRef = useRef(createTimelineViewRowsCache());
return useCallback<GetTimelineViewRows>(
Expand Down Expand Up @@ -1113,7 +1094,6 @@ function TimelineSystemDetailBlock({
<TimelineDetailScroll
size="base"
streaming={streaming}
contentKey={detail}
className="overflow-hidden rounded-lg border border-border bg-card"
>
<pre className="whitespace-pre-wrap break-words px-4 py-3 font-mono text-xs leading-tight text-subtle-foreground opacity-70">
Expand Down Expand Up @@ -1201,11 +1181,7 @@ function TimelineExpandableBodyContent({
const isFrontier =
row.kind === "bundle-summary" && row.id === activeLatestBundleId;
return (
<TimelineDetailScroll
size="summary"
streaming={isFrontier}
contentKey={timelineRowsSignature(row.children)}
>
<TimelineDetailScroll size="summary" streaming={isFrontier}>
{list}
</TimelineDetailScroll>
);
Expand Down Expand Up @@ -1535,7 +1511,6 @@ function DelegationRowBody({ row }: { row: TimelineViewDelegationWorkRow }) {
<TimelineDetailScroll
size="delegation"
streaming={delegationActive}
contentKey={`${row.childRows === null ? "deferred" : timelineRowsSignature(row.childRows)}|${row.output.length}`}
className={NESTED_TIMELINE_GROUP_LINE_CLASS_NAME}
>
<div className="flex flex-col gap-3">
Expand Down Expand Up @@ -2011,17 +1986,15 @@ function TimelineRowItemWrapper({
ref={composedRef}
data-timeline-row-id={row.id}
data-timeline-window-key={row.id}
data-index={windowedState.itemIndex}
className={
isTopLevel && !windowedState.windowingEnabled
? TOP_LEVEL_TIMELINE_ROW_INTRINSIC_SIZE_CLASS_NAME
: undefined
}
style={
windowedState.itemStyle ??
(isTopLevel && !windowedState.windowingEnabled
isTopLevel && !windowedState.windowingEnabled
? timelineRowContainmentStyle(row)
: undefined)
: undefined
}
>
{children}
Expand Down Expand Up @@ -2062,7 +2035,7 @@ function TimelineRowsList({
}: TimelineRowsListProps) {
const { threadId } = useTimelineRendererStaticContext();
const bottomAnchor = useBottomAnchoredScroll();
const scrollRestoreRowId = useContext(TimelineScrollRestoreRowIdContext);
const scrollRestore = useContext(TimelineScrollRestoreContext);
const detailScrollRoot = useContext(TimelineWindowingScrollRootContext);
const inheritedMeasurements = useContext(
TimelineWindowingMeasurementsContext,
Expand Down Expand Up @@ -2106,25 +2079,11 @@ function TimelineRowsList({
for (const rowId of stableSearchExpandedRowIds) {
keys.add(rowId);
}
if (spacing === "top-level" && scrollRestoreRowId !== null) {
keys.add(scrollRestoreRowId);
}
if (spacing === "top-level" && navigationTargetRowId != null) {
keys.add(navigationTargetRowId);
}
return keys;
}, [
items,
rows,
scrollRestoreRowId,
spacing,
stableSearchExpandedRowIds,
navigationTargetRowId,
]);
const getWindowingScrollElement =
detailScrollRoot?.getScrollElement ??
bottomAnchor?.getScrollElement ??
null;
}, [items, rows, spacing, stableSearchExpandedRowIds, navigationTargetRowId]);
const isTopLevelList = spacing === "top-level";
const { measureRef: messageColumnWidthSourceRef, width: messageColumnWidth } =
useMeasuredWidth({ enabled: isTopLevelList });
Expand Down Expand Up @@ -2157,7 +2116,9 @@ function TimelineRowsList({
: 28;
}}
gap={spacing === "bundle" ? 0 : 8}
getScrollElement={getWindowingScrollElement}
initialWindowAnchor={
isTopLevelList && detailScrollRoot === null ? scrollRestore : null
}
itemKeys={itemKeys}
measurements={measurements}
positionKeeper={
Expand All @@ -2180,9 +2141,7 @@ function TimelineRowsList({
<div
key={item.id}
ref={windowedState.itemRef}
data-index={windowedState.itemIndex}
data-timeline-window-key={`divider:${item.id}`}
style={windowedState.itemStyle}
>
<TimelineUnreadDivider
autoScroll={unreadDividerAutoScroll}
Expand Down Expand Up @@ -2231,7 +2190,6 @@ function ThreadTimelineRowsForTimelineView(props: ThreadTimelineRowsProps) {
() => getViewRows(props.timelineRows),
[getViewRows, props.timelineRows],
);
const heightSnapRevision = timelineHeightSnapRevision(props.timelineRows);
const latestActionableAssistantMessageId = useMemo(
() => findLastActionableAssistantMessageId(rows),
[rows],
Expand Down Expand Up @@ -2480,32 +2438,27 @@ function ThreadTimelineRowsForTimelineView(props: ThreadTimelineRowsProps) {
value={windowingMeasurements}
>
<div className="relative">
<AutoHeightContainer
snapRevision={heightSnapRevision}
animateGrowth={!scopeActive}
>
<TimelineRowsList
hasOlderTimelineRows={props.hasOlderTimelineRows}
isLoadingOlderTimelineRows={
props.isLoadingOlderTimelineRows
}
navigationTargetRowId={
props.timelineNavigationTargetRowId
}
onLoadOlderRows={props.onLoadOlderRows}
rows={rows}
scopeActive={scopeActive}
showAssistantMessageActions={true}
compactActivityIntents={false}
spacing="top-level"
unreadDividerAutoScroll={
props.unreadDividerAutoScroll ?? true
}
unreadDividerPlacement={
props.unreadDividerPlacement ?? null
}
/>
</AutoHeightContainer>
<TimelineRowsList
hasOlderTimelineRows={props.hasOlderTimelineRows}
isLoadingOlderTimelineRows={
props.isLoadingOlderTimelineRows
}
navigationTargetRowId={
props.timelineNavigationTargetRowId
}
onLoadOlderRows={props.onLoadOlderRows}
rows={rows}
scopeActive={scopeActive}
showAssistantMessageActions={true}
compactActivityIntents={false}
spacing="top-level"
unreadDividerAutoScroll={
props.unreadDividerAutoScroll ?? true
}
unreadDividerPlacement={
props.unreadDividerPlacement ?? null
}
/>
{hasSelectionActions ? (
<div
ref={setSelectionMenuLayer}
Expand Down
Loading
Loading