@devries-cameron20 / t3code-1 / commits / 69310dbd61
Fork 0

The best way to control Claude Code, Codex and more from any computer or phone

fix(web): the ~ breadcrumb opens the home folder (#22412)

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> Co-authored-by: maria-rcks <maria@kuuro.net>

Onkar Pradip Jadhav committed Oct 29, 2026 at 23:12 UTC 69310dbd61a91db0f9ad7762a26d3c1b07710888
2 files changed +29 -2
apps/web/src/components/files/filePath.test.ts
+27 -1
@@ -1,6 +1,12 @@
1 import { describe, expect, it } from "vite-plus/test";
2
3 -import { fileBreadcrumbChildren, fileBreadcrumbs, retainedBreadcrumbTrail } from "./filePath";
3 +import {
4 + breadcrumbPathOf,
5 + fileBreadcrumbChildren,
6 + fileBreadcrumbs,
7 + isListableHostFolder,
8 + retainedBreadcrumbTrail,
9 +} from "./filePath";
10
11 describe("fileBreadcrumbs", () => {
12 it("starts host paths outside the workspace at the filesystem root", () => {
@@ -20,6 +26,26 @@ describe("fileBreadcrumbs", () => {
26 "\\\\server\\share\\report.md",
27 ]);
28 });
29 +
30 + it("builds home-relative breadcrumbs with navigable folders", () => {
31 + expect(fileBreadcrumbs("t3code", "~/.claude/CLAUDE.md")).toEqual([
32 + { label: "~", path: "~/", kind: "directory" },
33 + { label: ".claude", path: "~/.claude", kind: "directory" },
34 + { label: "CLAUDE.md", path: "~/.claude/CLAUDE.md", kind: "file" },
35 + ]);
36 + expect(isListableHostFolder("~/")).toBe(true);
37 + expect(isListableHostFolder("~/.claude")).toBe(true);
38 + });
39 +
40 + it("keeps a project folder named ~ inside the project", () => {
41 + expect(fileBreadcrumbs("t3code", "~").map((crumb) => crumb.path)).toEqual(["", "~"]);
42 + });
43 +});
44 +
45 +describe("breadcrumbPathOf", () => {
46 + it("keeps the home root listable", () => {
47 + expect(breadcrumbPathOf("~/")).toBe("~/");
48 + });
49 });
50
51 describe("fileBreadcrumbChildren", () => {
apps/web/src/components/files/filePath.ts
+2 -1
@@ -23,7 +23,8 @@ export function fileBreadcrumbs(projectName: string, relativePath: string): File
23 return {
24 label: part,
25 // A bare drive (`C:`) means the drive's current directory; its root is `C:\`.
26 - path: /^[A-Za-z]:$/.test(path) ? `${path}\\` : path,
26 + // A bare `~` is not a host path; the home folder is `~/`.
27 + path: /^[A-Za-z]:$/.test(path) ? `${path}\\` : hostPath && path === "~" ? "~/" : path,
28 kind: index === parts.length - 1 ? ("file" as const) : ("directory" as const),
29 };
30 }),