From 53de6336d1a1fbc6ddb9599b1ffd1c5fc72023ca Mon Sep 17 00:00:00 2001 From: liangfung <1098486429@qq.com> Date: Sat, 27 Apr 2024 00:03:38 +0800 Subject: [PATCH] format --- ee/tabby-ui/app/files/components/file-tree-header.tsx | 4 ++-- ee/tabby-ui/app/files/components/file-tree-panel.tsx | 6 +++--- ee/tabby-ui/app/files/components/file-tree.tsx | 2 -- 3 files changed, 5 insertions(+), 7 deletions(-) diff --git a/ee/tabby-ui/app/files/components/file-tree-header.tsx b/ee/tabby-ui/app/files/components/file-tree-header.tsx index bbf736960bf9..fe5554046c97 100644 --- a/ee/tabby-ui/app/files/components/file-tree-header.tsx +++ b/ee/tabby-ui/app/files/components/file-tree-header.tsx @@ -222,7 +222,7 @@ const FileTreeHeader: React.FC = ({ - + {noIndexedRepo ? ( No indexed repository @@ -312,7 +312,7 @@ const FileTreeHeader: React.FC = ({ side="bottom" onOpenAutoFocus={e => e.preventDefault()} style={{ width: '50vw', maxWidth: 700 }} - className="max-h-[50vh] overflow-y-scroll" + className="max-h-[50vh] overflow-y-auto" > <> {options?.length ? ( diff --git a/ee/tabby-ui/app/files/components/file-tree-panel.tsx b/ee/tabby-ui/app/files/components/file-tree-panel.tsx index 53794ed0f257..1387cf7378ed 100644 --- a/ee/tabby-ui/app/files/components/file-tree-panel.tsx +++ b/ee/tabby-ui/app/files/components/file-tree-panel.tsx @@ -7,7 +7,7 @@ import { useScrollTop } from '@/lib/hooks/use-scroll-top' import { FileTree, TFileTreeNode } from './file-tree' import { FileTreeHeader } from './file-tree-header' import { SourceCodeBrowserContext } from './source-code-browser' -import { resolveRepoNameFromPath } from './utils' +import { generatePathPrefixFromPath } from './utils' interface FileTreePanelProps extends React.HTMLAttributes {} @@ -29,8 +29,8 @@ export const FileTreePanel: React.FC = () => { } const currentFileTreeData = React.useMemo(() => { - const repoName = resolveRepoNameFromPath(activePath) - const repo = fileTreeData.find(treeNode => treeNode.name === repoName) + const repoPrefix = generatePathPrefixFromPath(activePath) + const repo = fileTreeData.find(treeNode => treeNode.fullPath === repoPrefix) return repo?.children ?? [] }, [activePath, fileTreeData]) diff --git a/ee/tabby-ui/app/files/components/file-tree.tsx b/ee/tabby-ui/app/files/components/file-tree.tsx index ea581de393c1..084dd67227d0 100644 --- a/ee/tabby-ui/app/files/components/file-tree.tsx +++ b/ee/tabby-ui/app/files/components/file-tree.tsx @@ -321,8 +321,6 @@ const FileTreeRenderer: React.FC = () => { const { initialized, activePath, fileMap, fileTreeData } = React.useContext(FileTreeContext) const repoPrefix = generatePathPrefixFromPath(activePath) - // todo fix no data - console.log(fileTreeData, '======filetreedata') if (!initialized) return