diff --git a/src/components/Points/PointsTabs.jsx b/src/components/Points/PointsTabs.jsx index c31483710..2f1dbfb96 100644 --- a/src/components/Points/PointsTabs.jsx +++ b/src/components/Points/PointsTabs.jsx @@ -163,6 +163,15 @@ const PointsTabs = ({ collectionName, client }) => { }, [collectionName, offset, similarIds, filters]); const isLoading = !points && !errorMessage && requestCount > 0; + // Collection is empty when we have no filters/similar and scroll returned 0 points + const isCollectionEmpty = + points && + !errorMessage && + requestCount === 0 && + points.points?.length === 0 && + similarIds.length === 0 && + filters.length === 0; + return ( {errorMessage !== null && } @@ -171,8 +180,8 @@ const PointsTabs = ({ collectionName, client }) => { ⚠ Error: {errorMessage} )} - {/* Always render the same PointsFilter instance to preserve filter input state */} - {!errorMessage && ( + {/* Hide filter only when collection is empty (isCollectionEmpty is false when there's an error or user has filters/similar) */} + {!isCollectionEmpty && ( { ))} )} - {points && !errorMessage && requestCount === 0 && points.points?.length === 0 && ( + {points && !errorMessage && requestCount === 0 && points.points?.length === 0 && isCollectionEmpty && ( 📪 No Points are present, {collectionName} is empty )} + {points && !errorMessage && requestCount === 0 && points.points?.length === 0 && !isCollectionEmpty && ( + + Nothing matches the current filters + + )} {points && !errorMessage && points.points?.length > 0 && ( <> {points.points?.map((point) => (