Skip to content

Commit

Permalink
relative path on filenamelink hover
Browse files Browse the repository at this point in the history
  • Loading branch information
RomneyDa committed Dec 19, 2024
1 parent 6cdb1d9 commit e0385d3
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions gui/src/components/markdown/FilenameLink.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { RangeInFile } from "core";
import { useContext } from "react";
import { IdeMessengerContext } from "../../context/IdeMessenger";
import FileIcon from "../FileIcon";
import { getUriPathBasename } from "core/util/uri";
import { findUriInDirs, getUriPathBasename } from "core/util/uri";
import { ToolTip } from "../gui/Tooltip";
import { v4 as uuidv4 } from "uuid";

Expand All @@ -23,6 +23,11 @@ function FilenameLink({ rif }: FilenameLinkProps) {

const id = uuidv4();

const { relativePathOrBasename } = findUriInDirs(
rif.filepath,
window.workspacePaths ?? [],
);

return (
<>
<span
Expand All @@ -36,7 +41,7 @@ function FilenameLink({ rif }: FilenameLinkProps) {
</span>
</span>
<ToolTip id={id} place="top">
{rif.filepath}
{"/" + relativePathOrBasename}
</ToolTip>
</>
);
Expand Down

0 comments on commit e0385d3

Please sign in to comment.