From 9fa70d45e9cf787f9b1288e2e34f6220e5dd132e Mon Sep 17 00:00:00 2001 From: Mark Benson <41453195+thealternator89@users.noreply.github.com> Date: Thu, 16 Apr 2026 07:05:46 +1200 Subject: [PATCH] feat: prioritize manual task effort and show calculated subtask effort as secondary --- src/renderer/components/ProjectView.tsx | 16 +++++++++------- src/renderer/components/TaskView.tsx | 17 ++++++----------- 2 files changed, 15 insertions(+), 18 deletions(-) diff --git a/src/renderer/components/ProjectView.tsx b/src/renderer/components/ProjectView.tsx index b620d0e..160edc0 100644 --- a/src/renderer/components/ProjectView.tsx +++ b/src/renderer/components/ProjectView.tsx @@ -238,6 +238,7 @@ const ProjectView: React.FC = () => { return { displayValue: manualEffort, contributionValue: manualEffort || 0, + calculatedValue: 0, hasAnyEstimation: isManualSet, type: isManualSet ? 'manual' : 'none' }; @@ -253,28 +254,29 @@ const ProjectView: React.FC = () => { }); const contributionValue = isManualSet ? manualEffort : childContributionSum; - const displayValue = isManualSet ? Math.max(manualEffort, childContributionSum) : childContributionSum; + const displayValue = isManualSet ? manualEffort : childContributionSum; if (!isManualSet) { return { displayValue, contributionValue, + calculatedValue: childContributionSum, hasAnyEstimation: childrenHaveEstimation, type: displayValue > 0 ? 'calculated' : 'none' }; } - // Manual effort is set. If no children have estimation, don't decorate. - if (!childrenHaveEstimation) { - return { displayValue, contributionValue, hasAnyEstimation: true, type: 'manual' }; + // Manual effort is set. + if (!childrenHaveEstimation || childContributionSum === 0) { + return { displayValue, contributionValue, calculatedValue: childContributionSum, hasAnyEstimation: true, type: 'manual' }; } if (manualEffort > childContributionSum) { - return { displayValue, contributionValue, hasAnyEstimation: true, type: 'manual-higher' }; + return { displayValue, contributionValue, calculatedValue: childContributionSum, hasAnyEstimation: true, type: 'manual-higher' }; } else if (manualEffort === childContributionSum) { - return { displayValue, contributionValue, hasAnyEstimation: true, type: 'manual-equal' }; + return { displayValue, contributionValue, calculatedValue: childContributionSum, hasAnyEstimation: true, type: 'manual-equal' }; } else { - return { displayValue, contributionValue, hasAnyEstimation: true, type: 'calculated-higher' }; + return { displayValue, contributionValue, calculatedValue: childContributionSum, hasAnyEstimation: true, type: 'calculated-higher' }; } }; diff --git a/src/renderer/components/TaskView.tsx b/src/renderer/components/TaskView.tsx index a257d02..f50f918 100644 --- a/src/renderer/components/TaskView.tsx +++ b/src/renderer/components/TaskView.tsx @@ -226,7 +226,7 @@ const TaskView: React.FC = () => { if (res.hasEstimation) hasChildrenEstimation = true; }); - const effectiveValue = isManualSet ? Math.max(manualValue, childSum) : childSum; + const effectiveValue = isManualSet ? manualValue : childSum; if (!isManualSet) { return { @@ -238,8 +238,8 @@ const TaskView: React.FC = () => { }; } - // Manual effort is set. If no children have estimation, don't decorate. - if (!hasChildrenEstimation) { + // Manual effort is set. + if (!hasChildrenEstimation || childSum === 0) { return { effectiveValue, manualValue, calculatedValue: childSum, hasChildrenEstimation: false, type: 'manual' }; } @@ -373,16 +373,11 @@ const TaskView: React.FC = () => { {effortInfo.type === 'calculated-higher' && } {effortInfo.effectiveValue} days - {effortInfo.manualValue !== null && effortInfo.calculatedValue !== null && ( + {effortInfo.manualValue !== null && (effortInfo.calculatedValue || 0) > 0 && (