From 643aeb498d27ec8dbbf9b8154a32632664d5c743 Mon Sep 17 00:00:00 2001 From: ittoview Date: Wed, 13 May 2026 19:29:22 +0100 Subject: [PATCH] fix: show relevant option progress for scoped practice --- src/pages/PerformanceDomainPracticePage.tsx | 58 ++++++++++++++++----- 1 file changed, 44 insertions(+), 14 deletions(-) diff --git a/src/pages/PerformanceDomainPracticePage.tsx b/src/pages/PerformanceDomainPracticePage.tsx index caed628..bfb40d1 100644 --- a/src/pages/PerformanceDomainPracticePage.tsx +++ b/src/pages/PerformanceDomainPracticePage.tsx @@ -369,30 +369,60 @@ export default function PerformanceDomainPracticePage() { -
- {[ - { label: '目标', data: expectedGoalProgress }, - { label: '要点', data: keyPointProgress }, - ].map((item) => { - const isFull = item.data.total > 0 && item.data.completed >= item.data.total - return ( -
-
- {item.label} - {item.data.completed}/{item.data.total} +
+ {(() => { + const activeProgress = progress.scope === 'expectedGoal' ? expectedGoalProgress : keyPointProgress + const activeLabel = progress.scope === 'expectedGoal' ? '目标' : '要点' + const isFull = activeProgress.total > 0 && activeProgress.completed >= activeProgress.total + + if (progress.scope === 'all') { + return ( +
+ {[ + { label: '目标', data: expectedGoalProgress }, + { label: '要点', data: keyPointProgress }, + ].map((item) => { + const itemFull = item.data.total > 0 && item.data.completed >= item.data.total + return ( +
+
+ {item.label} + {item.data.completed}/{item.data.total} +
+
+
+
+
+ ) + })}
-
+ ) + } + + return ( +
+
+ {activeLabel} + {activeProgress.completed}/{activeProgress.total} +
+
) - })} + })()}