Compare commits

...

1 Commits

Author SHA1 Message Date
arvinxx a3408f21cd fix render issue 2025-11-18 10:39:21 +08:00
3 changed files with 17 additions and 13 deletions
@@ -3,10 +3,12 @@ import { ChatMessagePluginError } from '@lobechat/types';
import { Skeleton } from 'antd';
import { memo } from 'react';
import { Flexbox } from 'react-layout-kit';
import { VList } from 'virtua';
import { useChatStore } from '@/store/chat';
import { chatToolSelectors } from '@/store/chat/selectors';
import FileItem from '@/tools/local-system/components/FileItem';
import FileItem from '../../components/FileItem';
interface SearchFilesProps {
listResults?: LocalFileItem[];
@@ -29,10 +31,10 @@ const SearchFiles = memo<SearchFilesProps>(({ listResults = [], messageId }) =>
}
return (
<Flexbox gap={2} style={{ maxHeight: 140, overflow: 'scroll' }}>
{listResults.map((item) => (
<FileItem key={item.path} {...item} showTime />
))}
<Flexbox gap={2} style={{ height: 140 }}>
<VList data={listResults} itemSize={23}>
{(item) => <FileItem {...item} showTime />}
</VList>
</Flexbox>
);
});
@@ -4,6 +4,7 @@ import { Text } from '@lobehub/ui';
import { memo } from 'react';
import { useTranslation } from 'react-i18next';
import { Flexbox } from 'react-layout-kit';
import { VList } from 'virtua';
import MoveFileItem from './MoveFileItem';
@@ -14,10 +15,10 @@ const MoveLocalFiles = memo<BuiltinRenderProps<MoveLocalFilesParams>>(({ args })
return (
<Flexbox gap={8}>
<Text type="secondary">{t('localFiles.moveFiles.itemsMoved', { count: items.length })}</Text>
<Flexbox gap={6}>
{items.map((item, index) => (
<MoveFileItem key={index} newPath={item.newPath} oldPath={item.oldPath} />
))}
<Flexbox style={{ height: 200 }}>
<VList data={items}>
{(item) => <MoveFileItem newPath={item.newPath} oldPath={item.oldPath} />}
</VList>
</Flexbox>
</Flexbox>
);
@@ -2,6 +2,7 @@ import { ChatMessagePluginError } from '@lobechat/types';
import { Skeleton } from 'antd';
import { memo } from 'react';
import { Flexbox } from 'react-layout-kit';
import { VList } from 'virtua';
import { useChatStore } from '@/store/chat';
import { chatToolSelectors } from '@/store/chat/selectors';
@@ -30,10 +31,10 @@ const SearchFiles = memo<SearchFilesProps>(({ searchResults = [], messageId }) =
}
return (
<Flexbox gap={2} style={{ maxHeight: 140, overflow: 'scroll' }}>
{searchResults.map((item) => (
<FileItem key={item.path} {...item} />
))}
<Flexbox gap={2} style={{ height: 140 }}>
<VList data={searchResults} itemSize={23}>
{(item) => <FileItem {...item} />}
</VList>
</Flexbox>
);
});