diff --git a/src/features/chat/display/blocks.ts b/src/features/chat/display/blocks.ts index d76c5df0..d8c9c1e7 100644 --- a/src/features/chat/display/blocks.ts +++ b/src/features/chat/display/blocks.ts @@ -3,7 +3,7 @@ import { isCompletedTurnOutcomeMessage } from "./turn-outcome-message"; import { pathRelativeToRoot } from "./paths"; import { executionState } from "./state"; -const STEERING_ACTIVITY_LABEL = "user steered"; +const STEERING_ACTIVITY_LABEL = "steer"; const STEERING_ACTIVITY_KIND = "userSteered"; export function displayBlocksForItems( @@ -78,7 +78,7 @@ function steeringActivityItem(item: DisplayItem, turnId: string): DisplayItem { id: `steer-activity-${item.id}`, kind: "tool", role: "tool", - text: "", + text: item.text, turnId, ...(item.itemId ? { itemId: item.itemId } : {}), activityKind: STEERING_ACTIVITY_KIND, diff --git a/tests/features/chat/display/display-model.test.ts b/tests/features/chat/display/display-model.test.ts index 51583e2b..a0f4805a 100644 --- a/tests/features/chat/display/display-model.test.ts +++ b/tests/features/chat/display/display-model.test.ts @@ -1107,7 +1107,11 @@ describe("display block grouping keeps work logs subordinate to conversation mes expect(blocks.map((block) => (block.type === "item" ? block.item.id : block.id))).toEqual(["u1", "u2", "turn-t1-activity", "a1"]); expect(blocks[2]).toMatchObject({ summary: "Work details: steer, 2 commands", - items: [{ id: "c1" }, { id: "steer-activity-u2", text: "", activityKind: "userSteered", toolLabel: "user steered" }, { id: "c2" }], + items: [ + { id: "c1" }, + { id: "steer-activity-u2", text: "also check tests", activityKind: "userSteered", toolLabel: "steer" }, + { id: "c2" }, + ], }); }); diff --git a/tests/features/chat/ui/message-stream/work-log.test.tsx b/tests/features/chat/ui/message-stream/work-log.test.tsx index dc7e9f47..cef618fa 100644 --- a/tests/features/chat/ui/message-stream/work-log.test.tsx +++ b/tests/features/chat/ui/message-stream/work-log.test.tsx @@ -146,6 +146,43 @@ describe("work log renderer decisions", () => { expect(element.textContent).toBe("user steered"); }); + it("renders steering activity as a compact two-line tool summary", () => { + const block = messageStreamBlocks({ + activeThreadId: "thread", + turnLifecycle: idleTurnLifecycle(), + historyCursor: null, + loadingHistory: false, + displayItems: [ + { id: "u1", kind: "message", messageKind: "user", role: "user", text: "do it", turnId: "turn" }, + { + id: "u2", + kind: "message", + messageKind: "user", + role: "user", + text: "also check tests and keep the summary compact", + turnId: "turn", + }, + { + id: "a1", + kind: "message", + role: "assistant", + text: "done", + messageKind: "assistantResponse", + messageState: "completed", + turnId: "turn", + }, + ], + openDetails: new Set(["turn:turn:activity"]), + loadOlderTurns: vi.fn(), + renderMarkdown: (parent, text) => parent.createDiv({ text }), + }).find((item) => item.key === "activity:turn-turn-activity"); + + const element = renderMessageBlockElement(expectPresent(block)); + + expect(element.querySelector(".codex-panel__tool-result-header")?.textContent).toBe("steer"); + expect(element.querySelector(".codex-panel__tool-summary")?.textContent).toBe("also check tests and keep the summary compact"); + }); + it("renders path summary tools relative to the workspace root", () => { const block = messageStreamBlocks({ activeThreadId: "thread",