Skip to content

Commit 7d30897

Browse files
saphidclaude
authored andcommitted
fix(mobile): multi-file patches show every changed file
Co-Authored-By: Claude Opus 5.5 <[email protected]>
1 parent 692dd9c commit 7d30897

2 files changed

Lines changed: 20 additions & 1 deletion

File tree

‎apps/mobile/src/lib/threadActivity.test.ts‎

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ import {
1818
type OrchestrationV2TurnItem,
1919
} from "@t3tools/contracts";
2020
import { deriveThreadCheckpointSummaries } from "@t3tools/client-runtime/state/thread-checkpoints";
21+
import { summarizeToolGroup } from "@t3tools/client-runtime/work-log/presentation";
2122
import { getReviewSectionIdForCheckpoint } from "../features/review/reviewModel";
2223
import * as DateTime from "effect/DateTime";
2324
import { describe, expect, it } from "vite-plus/test";
@@ -596,6 +597,24 @@ describe("buildThreadFeed", () => {
596597
expect(items[0]).toMatchObject({ output: rawOutput });
597598
});
598599

600+
it("counts every file of a multi-file patch", () => {
601+
const item: OrchestrationV2TurnItem = {
602+
...base("multi-file-change", "2026-06-20T00:00:04.000Z", 3),
603+
type: "file_change",
604+
fileName: "src/a.ts",
605+
changes: [
606+
{ operation: "update", path: "src/a.ts" },
607+
{ operation: "add", path: "src/b.ts" },
608+
{ operation: "update", path: "src/renamed.ts", oldPath: "src/original.ts" },
609+
],
610+
};
611+
const activity = buildThreadFeed([projected(item, 0)]).flatMap((entry) =>
612+
entry.type === "activity-group" ? entry.activities : [],
613+
)[0]!;
614+
expect(workEntryRowLabel(activity.workEntry)).toBe("src/a.ts +2 more");
615+
expect(summarizeToolGroup([activity.workEntry]).summary).toBe("Changed 3 files");
616+
});
617+
599618
it("anchors feedback before later committed turns", () => {
600619
const laterUser = {
601620
...userMessage("2026-08-29T00:00:05.000Z"),

‎apps/mobile/src/lib/threadActivity.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -733,7 +733,7 @@ function toWorkLogEntry(
733733
case "file_change":
734734
return {
735735
...common,
736-
changedFiles: [item.fileName],
736+
changedFiles: item.changes?.map((change) => change.path) ?? [item.fileName],
737737
toolTitle: title ?? "File change",
738738
toolData: item,
739739
};

0 commit comments

Comments
 (0)