The best way to control Claude Code, Codex and more from any computer or phone
fix(web): file names with a backslash no longer split into folders in the Changes card (#35075)
Julius Marminge committed
Nov 12, 2026 at 02:38 UTC
002dc9b644518dbe58cd3694ed375048df84a730
2 files changed
+31
-4
apps/web/src/lib/turnDiffTree.test.ts
+30
@@ -138,4 +138,34 @@ describe("buildTurnDiffTree", () => {
138
},
139
]);
140
});
141
+
142
+ it("keeps a literal backslash in a POSIX file name instead of splitting it into a folder", () => {
143
+ expect(
144
+ buildTurnDiffTree([
145
+ { path: "back\\slash.txt", kind: "modified", additions: 1, deletions: 0 },
146
+ { path: "back/slash.txt", kind: "modified", additions: 2, deletions: 0 },
147
+ ]),
148
+ ).toEqual([
149
+ {
150
+ kind: "directory",
151
+ name: "back",
152
+ path: "back",
153
+ stat: { additions: 2, deletions: 0 },
154
+ children: [
155
+ {
156
+ kind: "file",
157
+ name: "slash.txt",
158
+ path: "back/slash.txt",
159
+ stat: { additions: 2, deletions: 0 },
160
+ },
161
+ ],
162
+ },
163
+ {
164
+ kind: "file",
165
+ name: "back\\slash.txt",
166
+ path: "back\\slash.txt",
167
+ stat: { additions: 1, deletions: 0 },
168
+ },
169
+ ]);
170
+ });
171
});
apps/web/src/lib/turnDiffTree.ts
+1
-4
@@ -33,10 +33,7 @@ interface MutableDirectoryNode {
33
let sortCollator: Intl.Collator | undefined;
34
35
function normalizePathSegments(pathValue: string): string[] {
36
- return pathValue
37
- .replaceAll("\\", "/")
38
- .split("/")
39
- .filter((segment) => segment.length > 0);
36
+ return pathValue.split("/").filter((segment) => segment.length > 0);
37
}
38
39
function compareByName(a: { name: string }, b: { name: string }): number {