diff --git a/web/app/components/workflow/skill/file-tree/tree/search-result-list.spec.tsx b/web/app/components/workflow/skill/file-tree/tree/search-result-list.spec.tsx index f5f2561d53..c018af096f 100644 --- a/web/app/components/workflow/skill/file-tree/tree/search-result-list.spec.tsx +++ b/web/app/components/workflow/skill/file-tree/tree/search-result-list.spec.tsx @@ -83,6 +83,23 @@ describe('SearchResultList', () => { expect(screen.queryByText('readme.md')).not.toBeInTheDocument() expect(screen.queryByRole('button')).not.toBeInTheDocument() }) + + it('should apply truncation semantics to long parent paths', () => { + const longParentPath = 'docx/scripts/office/schemas/ISO-IEC29500-4_2016/very/deep/path' + const treeChildren = [ + createNode({ + id: 'file-1', + name: 'sample.md', + path: `/${longParentPath}/sample.md`, + }), + ] + + render() + + const parentPath = screen.getByText(longParentPath) + expect(parentPath).toHaveClass('truncate', 'text-right') + expect(parentPath).toHaveAttribute('title', longParentPath) + }) }) // File and folder actions should dispatch the correct store operations. diff --git a/web/app/components/workflow/skill/file-tree/tree/search-result-list.tsx b/web/app/components/workflow/skill/file-tree/tree/search-result-list.tsx index 8f648fd6b0..cd66df9e79 100644 --- a/web/app/components/workflow/skill/file-tree/tree/search-result-list.tsx +++ b/web/app/components/workflow/skill/file-tree/tree/search-result-list.tsx @@ -53,7 +53,8 @@ const SearchResultRow = ({ node, parentPath, treeChildren }: SearchResultRowProp role="button" tabIndex={0} className={cn( - 'flex h-6 w-full cursor-pointer items-center rounded-md px-2', + 'flex h-6 w-full items-center gap-2 overflow-hidden rounded-md px-2', + 'cursor-pointer', 'hover:bg-state-base-hover', isActive && 'bg-state-base-active', )} @@ -84,7 +85,10 @@ const SearchResultRow = ({ node, parentPath, treeChildren }: SearchResultRowProp {parentPath && ( - + {parentPath} )}