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, 19:45 UTC
fix(mobile): files with # or ? in their path keep audio playback and Markdown Preview (#35448)
Julius Marminge committed
Nov 12, 2026 at 10:59 UTC
4f86f94e151ef6729a645766c034bf0e75010942
2 files changed
+16
-3
apps/mobile/src/features/files/filePath.test.ts
+13
@@ -2,6 +2,8 @@ import { describe, expect, it } from "vite-plus/test";
2
3
import {
4
fileRoutePathSegments,
5
+ isAudioPreviewFile,
6
+ isMarkdownPreviewFile,
7
needsWorkspaceFileContents,
8
resolveFileLinkPath,
9
resolveWorkspaceRelativeFilePath,
@@ -58,3 +60,14 @@ describe("needsWorkspaceFileContents", () => {
60
expect(needsWorkspaceFileContents({ ...input, metadataKind: "directory" })).toBe(false);
61
});
62
});
63
+
64
+describe("workspace preview classifiers", () => {
65
+ it("treat # and ? as literal filename characters", () => {
66
+ for (const path of ["notes/clip#1.wav", "notes/clip?1.wav", "notes#old/clip.wav"]) {
67
+ expect(isAudioPreviewFile(path)).toBe(true);
68
+ }
69
+ for (const path of ["docs/draft#1.md", "docs/draft?1.md", "docs#old/draft.md"]) {
70
+ expect(isMarkdownPreviewFile(path)).toBe(true);
71
+ }
72
+ });
73
+});
apps/mobile/src/features/files/filePath.ts
+3
-3
@@ -100,15 +100,15 @@ export function isVideoPreviewFile(path: string): boolean {
100
}
101
102
export function isAudioPreviewFile(path: string): boolean {
103
- return isWorkspaceAudioPreviewPath(path.split(/[?#]/, 1)[0] ?? "");
103
+ return isWorkspaceAudioPreviewPath(path);
104
}
105
106
export function isSvgImagePreviewFile(path: string): boolean {
107
- return /\.svg$/i.test(path.split(/[?#]/, 1)[0] ?? "");
107
+ return /\.svg$/i.test(path);
108
}
109
110
export function isMarkdownPreviewFile(path: string): boolean {
111
- return /\.(?:md|mdx)$/i.test(path.split(/[?#]/, 1)[0] ?? "");
111
+ return /\.(?:md|mdx)$/i.test(path);
112
}
113
114
export function needsWorkspaceFileContents(input: {