diff --git a/webview-ui/src/components/chat/ContextMenu.tsx b/webview-ui/src/components/chat/ContextMenu.tsx index 5d2df631db..a353a97be6 100644 --- a/webview-ui/src/components/chat/ContextMenu.tsx +++ b/webview-ui/src/components/chat/ContextMenu.tsx @@ -109,21 +109,38 @@ const ContextMenu: React.FC = ({ case ContextMenuOptionType.OpenedFile: case ContextMenuOptionType.Folder: if (option.value) { + // remove trailing slash + const path = removeLeadingNonAlphanumeric(option.value || "").replace(/\/$/, "") + const pathList = path.split("/") + const filename = pathList.at(-1) + const folderPath = pathList.slice(0, -1).join("/") return ( - <> - / - {option.value?.startsWith("/.") && .} +
+ {filename} - {removeLeadingNonAlphanumeric(option.value || "") + "\u200E"} + {folderPath} - +
) } else { return Add {option.type === ContextMenuOptionType.File ? "File" : "Folder"} @@ -189,10 +206,9 @@ const ContextMenu: React.FC = ({ key={`${option.type}-${option.value || index}`} onClick={() => isOptionSelectable(option) && onSelect(option.type, option.value)} style={{ - padding: "8px 12px", + padding: "4px 6px", cursor: isOptionSelectable(option) ? "pointer" : "default", color: "var(--vscode-dropdown-foreground)", - borderBottom: "1px solid var(--vscode-editorGroup-border)", display: "flex", alignItems: "center", justifyContent: "space-between", @@ -232,7 +248,7 @@ const ContextMenu: React.FC = ({ !option.value && ( )} {(option.type === ContextMenuOptionType.Problems || @@ -244,7 +260,7 @@ const ContextMenu: React.FC = ({ option.value)) && ( )} @@ -252,7 +268,7 @@ const ContextMenu: React.FC = ({ ) : (