From f2c7bd8df8ed0631bd42ecc35d6f36f6b3379165 Mon Sep 17 00:00:00 2001 From: twwu Date: Thu, 20 Mar 2025 16:43:45 +0800 Subject: [PATCH] fix: refine checkbox hover state and optimize segment selection logic --- web/app/components/base/checkbox/index.tsx | 4 ++-- .../components/datasets/documents/detail/completed/index.tsx | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/web/app/components/base/checkbox/index.tsx b/web/app/components/base/checkbox/index.tsx index e32cc1498c..b0b0ebca7c 100644 --- a/web/app/components/base/checkbox/index.tsx +++ b/web/app/components/base/checkbox/index.tsx @@ -15,9 +15,9 @@ const Checkbox = ({ checked, onCheck, className, disabled, mixed }: CheckboxProp return (
{ diff --git a/web/app/components/datasets/documents/detail/completed/index.tsx b/web/app/components/datasets/documents/detail/completed/index.tsx index 3d59a328c1..9095f8854e 100644 --- a/web/app/components/datasets/documents/detail/completed/index.tsx +++ b/web/app/components/datasets/documents/detail/completed/index.tsx @@ -410,9 +410,9 @@ const Completed: FC = ({ setSelectedSegmentIds((prev) => { const currentAllSegIds = segments.map(seg => seg.id) const prevSelectedIds = prev.filter(item => !currentAllSegIds.includes(item)) - return [...prevSelectedIds, ...((isAllSelected || selectedSegmentIds.length > 0) ? [] : currentAllSegIds)] + return [...prevSelectedIds, ...(isAllSelected ? [] : currentAllSegIds)] }) - }, [segments, isAllSelected, selectedSegmentIds]) + }, [segments, isAllSelected]) const totalText = useMemo(() => { const isSearch = searchValue !== '' || selectedStatus !== 'all'