Skip to content

JiuwenSwarm is an intelligent AI Agent built on openJiuwen. It extends the powerful capabilities of large language models directly to your fingertips through various communication apps you use daily.

Python

fix:产物数量为 0 时,团队模式和单智能体模式均不显示“产物”页签

xiaoyao426bfbfafaffc2
diff --git a/jiuwenswarm/channels/web/frontend/src/components/ToolPanel/index.tsx b/jiuwenswarm/channels/web/frontend/src/components/ToolPanel/index.tsx
index 6f855e990d..358db40d82 100644
--- a/jiuwenswarm/channels/web/frontend/src/components/ToolPanel/index.tsx
+++ b/jiuwenswarm/channels/web/frontend/src/components/ToolPanel/index.tsx
@@ -107,7 +107,12 @@ function ExpandedSingleAgentArea({
}) {
const { t } = useTranslation();
const artifactsCount = useSessionArtifactsCount();
- const resolvedTab = activeTab === 'artifacts' ? 'artifacts' : activeTab === 'review' && reviewPanel ? 'review' : 'planning';
+ const resolvedTab =
+ activeTab === 'artifacts' && artifactsCount > 0
+ ? 'artifacts'
+ : activeTab === 'review' && reviewPanel
+ ? 'review'
+ : 'planning';
const tabs = [
{
key: 'planning',
@@ -115,12 +120,14 @@ function ExpandedSingleAgentArea({
count: `${completedTasks}/${totalTasks}`,
icon: <img src={teamProcessIcon} width={16} height={16} aria-hidden="true" />,
},
- {
- key: 'artifacts',
- label: t('artifacts.tab'),
- count: artifactsCount,
- icon: <FileText size={16} />,
- },
+ ...(artifactsCount > 0
+ ? [{
+ key: 'artifacts' as const,
+ label: t('artifacts.tab'),
+ count: artifactsCount,
+ icon: <FileText size={16} />,
+ }]
+ : []),
...(reviewPanel ? [{ key: 'review' as const, label: t('codeMode.review'), icon: <FileCheck2 size={16} /> }] : []),
];
diff --git a/jiuwenswarm/channels/web/frontend/src/components/teamArea/index.tsx b/jiuwenswarm/channels/web/frontend/src/components/teamArea/index.tsx
index 5544900637..cf4f550988 100644
--- a/jiuwenswarm/channels/web/frontend/src/components/teamArea/index.tsx
+++ b/jiuwenswarm/channels/web/frontend/src/components/teamArea/index.tsx
@@ -123,7 +123,11 @@ function ExpandedTeamArea({
const { t } = useTranslation();
const { completedTasks, progressTasks, teamTasks, totalTasks } = useTaskPlanningMetrics();
const artifactsCount = useSessionArtifactsCount();
- const resolvedTab = activeTab === 'review' && !reviewPanel ? 'planning' : activeTab;
+ const resolvedTab =
+ (activeTab === 'artifacts' && artifactsCount === 0) ||
+ (activeTab === 'review' && !reviewPanel)
+ ? 'planning'
+ : activeTab;
const selectedMember = useMemo(() => {
if (!externalSelectedMemberId) return null;
@@ -146,12 +150,14 @@ function ExpandedTeamArea({
label: t('team.membersTab'),
icon: <img src={teamIcon} width={16} height={16} />,
},
- {
- key: 'artifacts',
- label: t('artifacts.tab'),
- count: artifactsCount,
- icon: <FileText size={16} />,
- },
+ ...(artifactsCount > 0
+ ? [{
+ key: 'artifacts' as const,
+ label: t('artifacts.tab'),
+ count: artifactsCount,
+ icon: <FileText size={16} />,
+ }]
+ : []),
...(reviewPanel ? [{ key: 'review' as const, label: t('codeMode.review'), icon: <FileCheck2 size={16} /> }] : []),
];