Skip to content

Commit

Permalink
format
Browse files Browse the repository at this point in the history
  • Loading branch information
liangfung committed Apr 26, 2024
1 parent 78d4535 commit 53de633
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 7 deletions.
4 changes: 2 additions & 2 deletions ee/tabby-ui/app/files/components/file-tree-header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ const FileTreeHeader: React.FC<FileTreeHeaderProps> = ({
</div>
</SelectValue>
</SelectTrigger>
<SelectContent>
<SelectContent className="max-h-[50vh] overflow-y-auto">
{noIndexedRepo ? (
<SelectItem isPlaceHolder value="" disabled>
No indexed repository
Expand Down Expand Up @@ -312,7 +312,7 @@ const FileTreeHeader: React.FC<FileTreeHeaderProps> = ({
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 ? (
Expand Down
6 changes: 3 additions & 3 deletions ee/tabby-ui/app/files/components/file-tree-panel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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<HTMLDivElement> {}

Expand All @@ -29,8 +29,8 @@ export const FileTreePanel: React.FC<FileTreePanelProps> = () => {
}

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])

Expand Down
2 changes: 0 additions & 2 deletions ee/tabby-ui/app/files/components/file-tree.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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 <FileTreeSkeleton />

Expand Down

0 comments on commit 53de633

Please sign in to comment.