Skip to content
Source
Sign inSign up
pingdotgg/t3code

feat(files): open markdown, HTML, and PDF files outside the workspace #9140

Mergedjuliusmarmingemerged 3 commits intomain fromrefs/pull/9140/headmerged by juliusmarminge View on GitHub

Showing 26 changed files with 31 additions and 4 deletions (loading 23).

x
0 of 26 viewed, 26 left
9 additions and 2 deletionsapps/mobile/src/features/files/ThreadFilesRouteScreen.tsxModified
View file
@@ -60,6 +60,7 @@
import { WorkspaceFileWebPreview } from "./WorkspaceFileWebPreview";
import {
basename,
+ isAbsolutePath,
isMarkdownPreviewFile,
isSvgImagePreviewFile,
isVideoPreviewFile,
@@ -782,8 +783,14 @@
​
- const parentDir = relativePath.split("/").slice(0, -1).join("/");
- const headerSubtitle = [projectName, parentDir].filter(Boolean).join(" · ");
+ const parentDir = relativePath.slice(
+ 0,
+ Math.max(relativePath.lastIndexOf("/"), relativePath.lastIndexOf("\\"), 0),
+ );
+ // A host file outside the workspace is not under the project name.
+ const headerSubtitle = isAbsolutePath(relativePath)
+ ? parentDir
+ : [projectName, parentDir].filter(Boolean).join(" · ");
​
return (
<ReviewHighlighterProvider>
14 additions and 1 deletionapps/mobile/src/features/files/filePath.test.tsModified
View file