The best way to control Claude Code, Codex and more from any computer or phone
Mirrored from https://github.com/Camo67/t3code.git
Synced Nov 21, 21:00 UTC
fix(web): file breadcrumbs keep backslashes in POSIX folder names (#34724)
Julius Marminge committed
Nov 11, 2026 at 20:06 UTC
d9a54ec645ef8cb6e3bfd3a4295e023c99445fba
2 files changed
+12
-2
apps/web/src/components/files/filePath.test.ts
+8
@@ -37,6 +37,14 @@ describe("fileBreadcrumbs", () => {
37
expect(isListableHostFolder("~/.claude")).toBe(true);
38
});
39
40
+ it("keeps a literal backslash inside a workspace path segment", () => {
41
+ expect(fileBreadcrumbs("t3code", "dir\\one/report.txt")).toEqual([
42
+ { label: "t3code", path: "", kind: "project" },
43
+ { label: "dir\\one", path: "dir\\one", kind: "directory" },
44
+ { label: "report.txt", path: "dir\\one/report.txt", kind: "file" },
45
+ ]);
46
+ });
47
+
48
it("keeps a project folder named ~ inside the project", () => {
49
expect(fileBreadcrumbs("t3code", "~").map((crumb) => crumb.path)).toEqual(["", "~"]);
50
});
apps/web/src/components/files/filePath.ts
+4
-2
@@ -13,8 +13,10 @@ export interface FileBreadcrumbChild extends ProjectEntry {
13
14
export function fileBreadcrumbs(projectName: string, relativePath: string): FileBreadcrumb[] {
15
const hostPath = isHostPath(relativePath);
16
- const separator = isWindowsAbsolutePath(relativePath) ? "\\" : "/";
17
- const parts = relativePath.split(/[\\/]/).filter(Boolean);
16
+ const windowsPath = isWindowsAbsolutePath(relativePath);
17
+ const separator = windowsPath ? "\\" : "/";
18
+ // `\` is a legal filename character outside Windows paths.
19
+ const parts = relativePath.split(windowsPath ? /[\\/]/ : "/").filter(Boolean);
20
const root = relativePath.startsWith("\\\\") ? "\\\\" : relativePath.startsWith("/") ? "/" : "";
21
return [
22
...(hostPath ? [] : [{ label: projectName, path: "", kind: "project" as const }]),