diff --git a/packages/ui/src/components/views/FilesView.tsx b/packages/ui/src/components/views/FilesView.tsx index a6459fe4..5ea0cca1 100644 --- a/packages/ui/src/components/views/FilesView.tsx +++ b/packages/ui/src/components/views/FilesView.tsx @@ -284,6 +284,7 @@ const isHtmlFile = (path: string): boolean => { interface FileRowProps { node: FileNode; + root: string; isExpanded: boolean; isActive: boolean; isMobile: boolean; @@ -307,6 +308,7 @@ interface FileRowProps { const FileRow: React.FC = ({ node, + root, isExpanded, isActive, isMobile, @@ -420,6 +422,19 @@ const FileRow: React.FC = ({ }}> Copy Path + { + e.stopPropagation(); + const relativePath = getDisplayPath(root, node.path) || node.path; + void copyTextToClipboard(relativePath).then((result) => { + if (result.ok) { + toast.success('Relative path copied'); + return; + } + toast.error('Copy failed'); + }); + }}> + Copy Relative Path + {!isDir && downloadFile && ( { e.stopPropagation(); @@ -1648,6 +1663,7 @@ export const FilesView: React.FC = ({ mode = 'full' }) => { )}