From 9ad99129181738e7962287d60cc84172c7da5cfb Mon Sep 17 00:00:00 2001 From: Jan Karres Date: Wed, 19 Aug 2026 23:05:30 +0200 Subject: [PATCH 01/10] feat(chat): derive a tested row model for every work-log entry Four pure modules behind the work log, with no visual change yet: type-aware elision that keeps a basename and a command head, a per-agent row model that reads the caller's own `description` instead of the raw payload, an output summary sized to the output, and the fold/window/commentary/count layout. `deriveToolActivityPresentation` and its private helpers are replaced by `deriveActivityRow`, whose two existing cases are ported first so the swap is provably not a regression. --- .../components/ToolCallContentView.tsx | 16 +- .../chat/chat-bubble/lib/activityRow.test.ts | 172 ++++++++++ src/pages/chat/chat-bubble/lib/activityRow.ts | 302 ++++++++++++++++++ src/pages/chat/chat-bubble/lib/elide.test.ts | 58 ++++ src/pages/chat/chat-bubble/lib/elide.ts | 44 +++ .../chat-bubble/lib/outputSummary.test.ts | 72 +++++ .../chat/chat-bubble/lib/outputSummary.ts | 56 ++++ .../chat/chat-bubble/lib/workLog.test.ts | 26 -- src/pages/chat/chat-bubble/lib/workLog.ts | 163 ---------- .../chat-bubble/lib/workLogLayout.test.ts | 159 +++++++++ .../chat/chat-bubble/lib/workLogLayout.ts | 178 +++++++++++ 11 files changed, 1048 insertions(+), 198 deletions(-) create mode 100644 src/pages/chat/chat-bubble/lib/activityRow.test.ts create mode 100644 src/pages/chat/chat-bubble/lib/activityRow.ts create mode 100644 src/pages/chat/chat-bubble/lib/elide.test.ts create mode 100644 src/pages/chat/chat-bubble/lib/elide.ts create mode 100644 src/pages/chat/chat-bubble/lib/outputSummary.test.ts create mode 100644 src/pages/chat/chat-bubble/lib/outputSummary.ts create mode 100644 src/pages/chat/chat-bubble/lib/workLogLayout.test.ts create mode 100644 src/pages/chat/chat-bubble/lib/workLogLayout.ts diff --git a/src/pages/chat/chat-bubble/components/ToolCallContentView.tsx b/src/pages/chat/chat-bubble/components/ToolCallContentView.tsx index 5106c5c..a30030d 100644 --- a/src/pages/chat/chat-bubble/components/ToolCallContentView.tsx +++ b/src/pages/chat/chat-bubble/components/ToolCallContentView.tsx @@ -1,10 +1,10 @@ +import { type ActivityKind, deriveActivityRow } from "../lib/activityRow"; import { formatPartValue, getToolCallContentParts, type ToolCallPart, } from "../lib/messageParts"; import { getRenderPartKey } from "../lib/utils"; -import { deriveToolActivityPresentation } from "../lib/workLog"; import ChatDisclosure from "./ChatDisclosure"; import MessagePartView from "./MessagePartView"; import Status from "./Status"; @@ -13,19 +13,19 @@ import ToolOutputView from "./ToolOutputView"; export default function ToolCallContentView({ part }: { part: ToolCallPart }) { const parts = getToolCallContentParts(part); const locations = readToolLocations(part); - const presentation = deriveToolActivityPresentation(part); + const row = deriveActivityRow(part); const hasDetails = Boolean( part.output || part.arguments || parts.length || locations.length, ); const summary = ( <>