From 6c848ba7a7fc7ea32a963653b83b5099e5ed6fad Mon Sep 17 00:00:00 2001 From: Patrick Erichsen Date: Sun, 27 Apr 2025 18:35:18 -0700 Subject: [PATCH] feat: fix filepaht issues w/ apply --- .../StepContainerPreToolbar/index.tsx | 9 +++++++-- gui/src/components/StyledMarkdownPreview/index.tsx | 2 +- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/gui/src/components/StyledMarkdownPreview/StepContainerPreToolbar/index.tsx b/gui/src/components/StyledMarkdownPreview/StepContainerPreToolbar/index.tsx index c56ba099c..6b299db18 100644 --- a/gui/src/components/StyledMarkdownPreview/StepContainerPreToolbar/index.tsx +++ b/gui/src/components/StyledMarkdownPreview/StepContainerPreToolbar/index.tsx @@ -207,7 +207,7 @@ export function StepContainerPreToolbar({ setAppliedFileUri(undefined); } - function onClickFilename() { + async function onClickFilename() { if (appliedFileUri) { ideMessenger.post("showFile", { filepath: appliedFileUri, @@ -215,8 +215,13 @@ export function StepContainerPreToolbar({ } if (relativeFilepath) { + const filepath = await inferResolvedUriFromRelativePath( + relativeFilepath, + ideMessenger.ide, + ); + ideMessenger.post("showFile", { - filepath: relativeFilepath, + filepath, }); } } diff --git a/gui/src/components/StyledMarkdownPreview/index.tsx b/gui/src/components/StyledMarkdownPreview/index.tsx index 36700cf46..1d96f7e5d 100644 --- a/gui/src/components/StyledMarkdownPreview/index.tsx +++ b/gui/src/components/StyledMarkdownPreview/index.tsx @@ -221,7 +221,7 @@ const StyledMarkdownPreview = memo(function StyledMarkdownPreview( visit(tree, "code", (node: any) => { if (!node.lang) { - node.lang = "javascript"; + node.lang = ""; } else if (node.lang.includes(".")) { node.lang = node.lang.split(".").slice(-1)[0]; }