Skip to content
TypeScript

fix(mobile): multi-file patches show every changed file (#29878)

Alex Southwellbec3f2d4dd52
diff --git a/apps/mobile/src/lib/threadActivity.test.ts b/apps/mobile/src/lib/threadActivity.test.ts
index 583cbe7098e..69ef04feb4f 100644
--- a/apps/mobile/src/lib/threadActivity.test.ts
+++ b/apps/mobile/src/lib/threadActivity.test.ts
@@ -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";
@@ -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"),
diff --git a/apps/mobile/src/lib/threadActivity.ts b/apps/mobile/src/lib/threadActivity.ts
index 91681731aab..8cb5ccb0437 100644
--- a/apps/mobile/src/lib/threadActivity.ts
+++ b/apps/mobile/src/lib/threadActivity.ts
@@ -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,
};