diff --git a/web/app/components/datasets/documents/detail/completed/batch-action.tsx b/web/app/components/datasets/documents/detail/completed/common/batch-action.tsx similarity index 100% rename from web/app/components/datasets/documents/detail/completed/batch-action.tsx rename to web/app/components/datasets/documents/detail/completed/common/batch-action.tsx diff --git a/web/app/components/datasets/documents/detail/completed/index.tsx b/web/app/components/datasets/documents/detail/completed/index.tsx index f3525a4956..b988cc4c85 100644 --- a/web/app/components/datasets/documents/detail/completed/index.tsx +++ b/web/app/components/datasets/documents/detail/completed/index.tsx @@ -9,7 +9,7 @@ import { ProcessStatus } from '../segment-add' import s from './style.module.css' import SegmentList from './segment-list' import DisplayToggle from './display-toggle' -import BatchAction from './batch-action' +import BatchAction from './common/batch-action' import SegmentDetail from './segment-detail' import SegmentCard from './segment-card' import ChildSegmentList from './child-segment-list' @@ -101,6 +101,7 @@ const Completed: FC = ({ const [showNewChildSegmentModal, setShowNewChildSegmentModal] = useState(false) const segmentListRef = useRef(null) + const childSegmentListRef = useRef(null) const needScrollToBottom = useRef(false) const { run: handleSearch } = useDebounceFn(() => { @@ -165,6 +166,13 @@ const Completed: FC = ({ ) const invalidChildSegmentList = useInvalid(useChildSegmentListKey) + useEffect(() => { + if (childSegmentListRef.current && needScrollToBottom.current) { + childSegmentListRef.current.scrollTo({ top: childSegmentListRef.current.scrollHeight, behavior: 'smooth' }) + needScrollToBottom.current = false + } + }, [childSegments]) + useEffect(() => { if (childChunkListData) setChildSegments(childChunkListData.data || []) diff --git a/web/app/components/datasets/documents/detail/index.tsx b/web/app/components/datasets/documents/detail/index.tsx index 52b2f1a19f..ff75af1435 100644 --- a/web/app/components/datasets/documents/detail/index.tsx +++ b/web/app/components/datasets/documents/detail/index.tsx @@ -187,14 +187,16 @@ const DocumentDetail: FC = ({ datasetId, documentId }) => { />
{embeddingAvailable && documentDetail && !documentDetail.archived && !isFullDocMode && ( - + <> + + + )} -