From 8185d146b6b324734287d18bb2778edc15df621c Mon Sep 17 00:00:00 2001 From: yyh Date: Thu, 29 Jan 2026 14:38:08 +0800 Subject: [PATCH] fix(inspect): extract ArtifactsEmpty component and align split-panel empty state Extract shared empty state card into ArtifactsEmpty component to deduplicate the no-files and no-selection empty states. Align the split-panel right-side empty state with the variables tab pattern. Remove FC type annotations in favor of inline parameter types. --- .../variable-inspect/artifacts-tab.tsx | 53 ++++++++++--------- 1 file changed, 29 insertions(+), 24 deletions(-) diff --git a/web/app/components/workflow/variable-inspect/artifacts-tab.tsx b/web/app/components/workflow/variable-inspect/artifacts-tab.tsx index afdd2688ef..41235d1137 100644 --- a/web/app/components/workflow/variable-inspect/artifacts-tab.tsx +++ b/web/app/components/workflow/variable-inspect/artifacts-tab.tsx @@ -1,4 +1,3 @@ -import type { FC } from 'react' import type { InspectHeaderProps } from './inspect-layout' import type { SandboxFileTreeNode } from '@/types/sandbox-file' import { @@ -19,6 +18,31 @@ import { cn } from '@/utils/classnames' import InspectLayout from './inspect-layout' import SplitPanel from './split-panel' +const ArtifactsEmpty = ({ description }: { description: string }) => { + const { t } = useTranslation('workflow') + const docLink = useDocLink() + + return ( +
+
+
+
+
{t('debug.variableInspect.tabArtifacts.emptyTitle')}
+
{description}
+ + {t('debug.variableInspect.tabArtifacts.emptyLink')} + +
+
+ ) +} + const formatFileSize = (bytes: number | null): string => { if (bytes === null || bytes === 0) return '0 B' @@ -27,9 +51,8 @@ const formatFileSize = (bytes: number | null): string => { return `${(bytes / 1024 ** i).toFixed(i === 0 ? 0 : 1)} ${units[i]}` } -const ArtifactsTab: FC = (headerProps) => { +const ArtifactsTab = (headerProps: InspectHeaderProps) => { const { t } = useTranslation('workflow') - const docLink = useDocLink() const { userProfile } = useAppContext() const sandboxId = userProfile?.id @@ -70,23 +93,7 @@ const ArtifactsTab: FC = (headerProps) => { return (
-
-
-
-
-
{t('debug.variableInspect.tabArtifacts.emptyTitle')}
-
{t('debug.variableInspect.tabArtifacts.emptyTip')}
- - {t('debug.variableInspect.tabArtifacts.emptyLink')} - -
-
+
) @@ -174,10 +181,8 @@ const ArtifactsTab: FC = (headerProps) => { ) : ( -
-

- {t('debug.variableInspect.tabArtifacts.selectFile')} -

+
+
)}