From c8933cc8e64caa9ac1145e5c9cf8d40cac90a1ed Mon Sep 17 00:00:00 2001 From: Tymoteusz Czech <2625371+Tymek@users.noreply.github.com> Date: Mon, 9 Jun 2025 13:00:17 +0200 Subject: [PATCH] feat: rename health insights to technical debt insights on dashboard (#10082) --- .../ProjectSetupComplete.tsx | 75 ++++++++++++++++++- 1 file changed, 74 insertions(+), 1 deletion(-) diff --git a/frontend/src/component/personalDashboard/ProjectSetupComplete.tsx b/frontend/src/component/personalDashboard/ProjectSetupComplete.tsx index 19a5edbf65..befc0c2f34 100644 --- a/frontend/src/component/personalDashboard/ProjectSetupComplete.tsx +++ b/frontend/src/component/personalDashboard/ProjectSetupComplete.tsx @@ -65,8 +65,29 @@ const ProjectHealthMessage: FC<{ : 'Remember to archive your stale feature flags to keep the project health growing.'; const keepDoingMessage = 'This indicates that you are doing a good job of archiving your feature flags.'; + const avgCurrentTechnicalDebt = 100 - (avgHealthCurrentWindow ?? 0); + const avgPastTechnicalDebt = 100 - (avgHealthPastWindow ?? 0); if (trend === 'improved') { + if (healthToTechDebtEnabled) { + return ( + <> + + On average, your project technical debt went down from{' '} + + {avgPastTechnicalDebt}% + {' '} + to{' '} + + {avgCurrentTechnicalDebt}% + {' '} + during the last 4 weeks. + + {keepDoingMessage} + + ); + } + return ( <> @@ -81,6 +102,25 @@ const ProjectHealthMessage: FC<{ } if (trend === 'declined') { + if (healthToTechDebtEnabled) { + return ( + <> + + On average, your project technical debt went up from{' '} + + {avgPastTechnicalDebt}% + {' '} + to{' '} + + {avgCurrentTechnicalDebt}% + {' '} + during the last 4 weeks. + + {improveMessage} + + ); + } + return ( <> @@ -95,6 +135,21 @@ const ProjectHealthMessage: FC<{ } if (trend === 'consistent') { + if (healthToTechDebtEnabled) { + return ( + <> + + On average, your project technical debt has remained at{' '} + + {avgCurrentTechnicalDebt}% + {' '} + during the last 4 weeks. + + {keepDoingMessage} + + ); + } + return ( <> @@ -112,6 +167,21 @@ const ProjectHealthMessage: FC<{ } if (trend === 'unknown') { + if (healthToTechDebtEnabled) { + return ( + <> + + Your current project technical debt is{' '} + + {avgCurrentTechnicalDebt}% + + . + + {improveMessage} + + ); + } + return ( <> @@ -132,6 +202,7 @@ export const ProjectSetupComplete: FC<{ project: string; insights: PersonalDashboardProjectDetailsSchemaInsights; }> = ({ project, insights }) => { + const healthToTechDebtEnabled = useFlag('healthToTechDebt'); const projectHealthTrend = determineProjectHealthTrend(insights); return ( @@ -140,7 +211,9 @@ export const ProjectSetupComplete: FC<{ <> - Project health + {healthToTechDebtEnabled + ? 'Technical debt' + : 'Project health'} }