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, 16:00 UTC
fix(web): don't label Windows paths outside the workspace as relative (#28469)
Co-authored-by: Julius Marminge <julius0216@outlook.com>
ValeraZSD committed
Nov 14, 2026 at 01:12 UTC
7ae21bf164065506d27fb60bf8c1e5e1eac0af1a
2 files changed
+17
-1
apps/web/src/filePathDisplay.test.ts
new
+16
@@ -0,0 +1,16 @@
1
+import { describe, expect, it } from "vite-plus/test";
2
+
3
+import { formatWorkspaceRelativePath } from "./filePathDisplay";
4
+
5
+describe("formatWorkspaceRelativePath", () => {
6
+ it("labels only relative paths, not Windows paths outside the workspace", () => {
7
+ const workspaceRoot = "C:\\Users\\mike\\dev-stuff\\t3code";
8
+ expect(
9
+ formatWorkspaceRelativePath("C:\\Users\\mike\\.claude\\settings.json:3", workspaceRoot),
10
+ ).toBe("C:/Users/mike/.claude/settings.json:3");
11
+ expect(formatWorkspaceRelativePath("D:/data/report.csv", workspaceRoot)).toBe(
12
+ "D:/data/report.csv",
13
+ );
14
+ expect(formatWorkspaceRelativePath("src/app.ts", workspaceRoot)).toBe("t3code/src/app.ts");
15
+ });
16
+});
apps/web/src/filePathDisplay.ts
+1
-1
@@ -46,7 +46,7 @@ export function formatWorkspaceRelativePath(
46
} else if (pathForCompare.startsWith(workspaceWithSeparator)) {
47
const relativeSuffix = normalizedPath.slice(normalizedWorkspaceRoot.length + 1);
48
displayPath = `${workspaceLabel}/${relativeSuffix}`;
49
- } else if (!normalizedPath.startsWith("/")) {
49
+ } else if (!normalizedPath.startsWith("/") && !isWindowsAbsolutePath(normalizedPath)) {
50
const relativePath = stripRelativePrefixes(normalizedPath);
51
displayPath = pathForCompare.startsWith(workspaceLabelWithSeparator)
52
? normalizedPath