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
1 change: 1 addition & 0 deletions .github/pr-assets/6424-after.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions .github/pr-assets/6424-before.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 7 additions & 1 deletion apps/web/src/components/chat/MessagesTimeline.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,7 @@ function matchMedia() {
}

let MessagesTimeline: typeof import("./MessagesTimeline").MessagesTimeline;
let toolCallExpandedBodyClassName: typeof import("./MessagesTimeline").toolCallExpandedBodyClassName;

beforeAll(async () => {
const classList = {
Expand Down Expand Up @@ -167,7 +168,7 @@ beforeAll(async () => {
},
});

({ MessagesTimeline } = await import("./MessagesTimeline"));
({ MessagesTimeline, toolCallExpandedBodyClassName } = await import("./MessagesTimeline"));
}, 30_000);

const ACTIVE_THREAD_ENVIRONMENT_ID = EnvironmentId.make("environment-local");
Expand Down Expand Up @@ -226,6 +227,11 @@ function buildUserTimelineEntry(text: string) {
}

describe("MessagesTimeline", () => {
it("sizes expanded tool details with the configured code font size", () => {
expect(toolCallExpandedBodyClassName).toContain("var(--font-size-code");
expect(toolCallExpandedBodyClassName).not.toContain("text-[11px]");
});

it("uses the larger leading inset only when the top fade is enabled", () => {
const timelineEntries = [buildUserTimelineEntry("Hello")];

Expand Down
7 changes: 4 additions & 3 deletions apps/web/src/components/chat/MessagesTimeline.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2057,6 +2057,9 @@ function buildToolCallExpandedBody(
return blocks.length > 0 ? blocks.join("\n\n") : null;
}

export const toolCallExpandedBodyClassName =
"max-h-64 cursor-text overflow-auto whitespace-pre-wrap break-words font-mono text-secondary-label text-[length:var(--font-size-code,0.6875rem)] leading-relaxed select-text";

function workEntryIconName(workEntry: TimelineWorkEntry): WorkEntryIconName {
if (
workEntry.sourceActivityKind === "user-input.requested" ||
Expand Down Expand Up @@ -2367,9 +2370,7 @@ const PlainWorkEntryRow = memo(function PlainWorkEntryRow(props: {
onClick={stopRowToggle}
onPointerDown={stopRowToggle}
>
<pre className="max-h-64 cursor-text overflow-auto whitespace-pre-wrap break-words font-mono text-secondary-label text-[11px] leading-relaxed select-text">
{expandedBody}
</pre>
<pre className={toolCallExpandedBodyClassName}>{expandedBody}</pre>
</div>
) : null}
</div>
Expand Down
Loading