From e997bf65079b4540ef9a662d6c9ccaf165ffc994 Mon Sep 17 00:00:00 2001 From: chanx <1243304602@qq.com> Date: Fri, 29 Aug 2025 16:54:01 +0800 Subject: [PATCH] Fix: Optimized the style and functionality of multiple components #3221 (#9824) ### What problem does this PR solve? Fix: Optimized the style and functionality of multiple components #3221 - Modified the SkeletonCard component, adding a className attribute and adjusting the style - Updated the RAGFlowSelect component, adding a disabled attribute - Adjusted the style of the Tooltip component - Optimized the layout of the RetrievalTesting and TestingResult pages - Updated the style and loading status display of NextSearch-related pages - Removed unnecessary logs from the Spotlight component ### Type of change - [x] Bug Fix (non-breaking change which fixes an issue) --- web/src/components/skeleton-card.tsx | 17 ++++++----- web/src/components/ui/select.tsx | 8 ++++- web/src/components/ui/tooltip.tsx | 4 +-- web/src/pages/dataset/testing/index.tsx | 12 ++++---- .../pages/dataset/testing/testing-result.tsx | 2 +- web/src/pages/next-search/search-view.tsx | 29 ++++++++----------- web/src/pages/next-search/spotlight.tsx | 1 - 7 files changed, 39 insertions(+), 34 deletions(-) diff --git a/web/src/components/skeleton-card.tsx b/web/src/components/skeleton-card.tsx index 76142c48e..aa565facb 100644 --- a/web/src/components/skeleton-card.tsx +++ b/web/src/components/skeleton-card.tsx @@ -1,13 +1,16 @@ import { Skeleton } from '@/components/ui/skeleton'; +import { cn } from '@/lib/utils'; -export function SkeletonCard() { +type SkeletonCardProps = { + className?: string; +}; +export function SkeletonCard(props: SkeletonCardProps) { + const { className } = props; return ( -
- -
- - -
+
+ + +
); } diff --git a/web/src/components/ui/select.tsx b/web/src/components/ui/select.tsx index 3f030cbbb..acf39d6a8 100644 --- a/web/src/components/ui/select.tsx +++ b/web/src/components/ui/select.tsx @@ -224,6 +224,7 @@ export const RAGFlowSelect = forwardRef< allowClear, placeholder, contentProps = {}, + disabled = false, // defaultValue, triggerClassName, onlyShowSelectedIcon = false, @@ -278,7 +279,12 @@ export const RAGFlowSelect = forwardRef< }, [onlyShowSelectedIcon, options, value]); return ( - = ({ {visible && title && (
= ({ {title}
Add New Test */}
- +
+ +
-
+
{data.chunks?.map((x) => ( diff --git a/web/src/pages/next-search/search-view.tsx b/web/src/pages/next-search/search-view.tsx index 710ab3b4d..e96eac3c6 100644 --- a/web/src/pages/next-search/search-view.tsx +++ b/web/src/pages/next-search/search-view.tsx @@ -1,6 +1,7 @@ import { FileIcon } from '@/components/icon-font'; import { ImageWithPopover } from '@/components/image'; import { Input } from '@/components/originui/input'; +import { SkeletonCard } from '@/components/skeleton-card'; import { Button } from '@/components/ui/button'; import { Popover, @@ -8,7 +9,6 @@ import { PopoverTrigger, } from '@/components/ui/popover'; import { RAGFlowPagination } from '@/components/ui/ragflow-pagination'; -import { Skeleton } from '@/components/ui/skeleton'; import { IReference } from '@/interfaces/database/chat'; import { cn } from '@/lib/utils'; import DOMPurify from 'dompurify'; @@ -157,11 +157,7 @@ export default function SearchingView({ {t('search.AISummary')} {isEmpty(answer) && sendingLoading ? ( -
- - - -
+ ) : ( answer.answer && (
@@ -195,12 +191,9 @@ export default function SearchingView({ <> {chunks.map((chunk, index) => { return ( - <> -
-
+
+
+
@@ -215,10 +208,12 @@ export default function SearchingView({ className="text-sm text-text-primary mb-1" >
- - - {chunk.content_with_weight} - + +
+ + {chunk.content_with_weight} + +
@@ -235,7 +230,7 @@ export default function SearchingView({ {index < chunks.length - 1 && (
)} - +
); })} diff --git a/web/src/pages/next-search/spotlight.tsx b/web/src/pages/next-search/spotlight.tsx index 2e1e3dc85..3d9b31f4a 100644 --- a/web/src/pages/next-search/spotlight.tsx +++ b/web/src/pages/next-search/spotlight.tsx @@ -7,7 +7,6 @@ interface SpotlightProps { const Spotlight: React.FC = ({ className }) => { const isDark = useIsDarkTheme(); - console.log('isDark', isDark); return (