Skip to content
Source
Sign inSign up
pingdotgg/t3code

feat(web): open HTML files in the browser from the files context menu #9533

Closedmrmg(GitHub profile, opens in a new tab)wants to merge 1 commit intomain fromrefs/pull/9533/headopened View on GitHub

Showing 3 changed files with 63 additions and 27 deletions.

x
0 of 3 viewed, 3 left
15 additions and 0 deletionsapps/web/src/components/files/FileBrowserPanel.tsxModified
View file
@@ -12,6 +12,7 @@
import { InputGroup, InputGroupInput } from "~/components/ui/input-group";
import { toastManager } from "~/components/ui/toast";
import { Tooltip, TooltipPopup, TooltipTrigger } from "~/components/ui/tooltip";
+import { isBrowserPreviewFile } from "~/browser/openFileInPreview";
import { useComposerHandleContext } from "~/composerHandleContext";
import { writeTextToClipboard } from "~/hooks/useCopyToClipboard";
import { useTheme } from "~/hooks/useTheme";
@@ -37,6 +38,8 @@
onOpenFile: (relativePath: string) => void;
onRefreshSelectedFile?: () => void;
workspaceMutationId: string | null;
+ /** Present when the runtime can open a workspace file in the integrated browser. */
+ onOpenInBrowser?: ((relativePath: string) => void) | undefined;
​
function treePath(entry: ProjectEntry): string {
@@ -101,6 +104,7 @@
onOpenFile,
onRefreshSelectedFile,
workspaceMutationId,
+ onOpenInBrowser,
}: FileBrowserPanelProps) {
const { resolvedTheme } = useTheme();
const composerRef = useComposerHandleContext();
@@ -144,6 +148,10 @@