Format file paths and truncate in menu

This commit is contained in:
Saoud Rizwan
2024-09-17 17:42:24 -04:00
parent f4c401343f
commit 3f63428580
3 changed files with 88 additions and 22 deletions

View File

@@ -55,10 +55,12 @@ const ChatTextArea = forwardRef<HTMLTextAreaElement, ChatTextAreaProps>(
const searchPaths = React.useMemo(() => {
return [
{ type: "problems", path: "problems" },
...filePaths.map((path) => ({
type: path.endsWith("/") ? "folder" : "file",
path: path,
})),
...filePaths
.map((file) => "/" + file)
.map((path) => ({
type: path.endsWith("/") ? "folder" : "file",
path: path,
})),
]
}, [filePaths])