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
19 changes: 19 additions & 0 deletions apps/mobile/src/lib/threadActivity.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import {
type OrchestrationV2TurnItem,
} from "@t3tools/contracts";
import { deriveThreadCheckpointSummaries } from "@t3tools/client-runtime/state/thread-checkpoints";
import { summarizeToolGroup } from "@t3tools/client-runtime/work-log/presentation";
import { getReviewSectionIdForCheckpoint } from "../features/review/reviewModel";
import * as DateTime from "effect/DateTime";
import { describe, expect, it } from "vite-plus/test";
Expand Down Expand Up @@ -596,6 +597,24 @@ describe("buildThreadFeed", () => {
expect(items[0]).toMatchObject({ output: rawOutput });
});

it("counts every file of a multi-file patch", () => {
const item: OrchestrationV2TurnItem = {
...base("multi-file-change", "2026-06-20T00:00:04.000Z", 3),
type: "file_change",
fileName: "src/a.ts",
changes: [
{ operation: "update", path: "src/a.ts" },
{ operation: "add", path: "src/b.ts" },
{ operation: "update", path: "src/renamed.ts", oldPath: "src/original.ts" },
],
};
const activity = buildThreadFeed([projected(item, 0)]).flatMap((entry) =>
entry.type === "activity-group" ? entry.activities : [],
)[0]!;
expect(workEntryRowLabel(activity.workEntry)).toBe("src/a.ts +2 more");
expect(summarizeToolGroup([activity.workEntry]).summary).toBe("Changed 3 files");
});

it("anchors feedback before later committed turns", () => {
const laterUser = {
...userMessage("2026-08-29T00:00:05.000Z"),
Expand Down
2 changes: 1 addition & 1 deletion apps/mobile/src/lib/threadActivity.ts
Original file line number Diff line number Diff line change
Expand Up @@ -733,7 +733,7 @@ function toWorkLogEntry(
case "file_change":
return {
...common,
changedFiles: [item.fileName],
changedFiles: item.changes?.map((change) => change.path) ?? [item.fileName],
toolTitle: title ?? "File change",
toolData: item,
};
Expand Down
Loading