From f4ecc293f9bf242a7da97e80148b04c626b9b4af Mon Sep 17 00:00:00 2001 From: lyzno1 Date: Tue, 9 Sep 2025 22:53:13 +0800 Subject: [PATCH] fix(dataset-sidebar): eliminate icon flickering during expand/collapse - Unified layout structure for both expand/collapse states - Single AppIcon component with dynamic size props instead of conditional rendering - Fixed container structure prevents DOM rebuilding and flickering - Adjusted spacing for collapsed state more button positioning --- .../app-sidebar/dataset-info/index.tsx | 82 +++++++++---------- 1 file changed, 41 insertions(+), 41 deletions(-) diff --git a/web/app/components/app-sidebar/dataset-info/index.tsx b/web/app/components/app-sidebar/dataset-info/index.tsx index f85e3880b2..44b0baa72b 100644 --- a/web/app/components/app-sidebar/dataset-info/index.tsx +++ b/web/app/components/app-sidebar/dataset-info/index.tsx @@ -35,35 +35,47 @@ const DatasetInfo: FC = ({ return (
{expand && ( - <> - -
-
- + + )} + +
+
+
+ +
+ {expand && ( +
-
-
- {dataset.name} -
-
- {isExternalProvider && t('dataset.externalTag')} - {!isExternalProvider && isPipelinePublished && dataset.doc_form && dataset.indexing_technique && ( -
- {t(`dataset.chunkingMode.${DOC_FORM_TEXT[dataset.doc_form]}`)} - {formatIndexingTechniqueAndMethod(dataset.indexing_technique, dataset.retrieval_model_dict?.search_method)} -
- )} -
+ )} +
+ {!expand && ( +
+ +
+ )} + {expand && ( +
+
+ {dataset.name} +
+
+ {isExternalProvider && t('dataset.externalTag')} + {!isExternalProvider && isPipelinePublished && dataset.doc_form && dataset.indexing_technique && ( +
+ {t(`dataset.chunkingMode.${DOC_FORM_TEXT[dataset.doc_form]}`)} + {formatIndexingTechniqueAndMethod(dataset.indexing_technique, dataset.retrieval_model_dict?.search_method)} +
+ )}
{!!dataset.description && (

@@ -71,20 +83,8 @@ const DatasetInfo: FC = ({

)}
- - )} - {!expand && ( -
- - -
- )} + )} +
) }