mirror of
https://github.com/murashit/codex-panel.git
synced 2026-07-22 17:30:31 +00:00
Show steering activity with a summary
This commit is contained in:
parent
1430990309
commit
f70cae3df9
3 changed files with 44 additions and 3 deletions
|
|
@ -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,
|
||||
|
|
|
|||
|
|
@ -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" },
|
||||
],
|
||||
});
|
||||
});
|
||||
|
||||
|
|
|
|||
|
|
@ -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",
|
||||
|
|
|
|||
Loading…
Reference in a new issue