From 0d4492618a59b404a557edb679a2b1c832d8a686 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ga=C5=A1per=20Grom?= Date: Tue, 4 Aug 2026 03:33:36 +0100 Subject: [PATCH 01/11] feat: migrate health score display to v2 IN-1212 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Gašper Grom --- .../details/collection-health-score-pill.vue | 7 + .../details/collection-project-item.vue | 15 +- .../details/health-score-details.vue | 112 ++++----------- .../components/overview/trust-score-v2.vue | 93 +++++++++++++ .../project/services/overview.api.service.ts | 13 +- .../modules/project/views/overview.vue | 128 ++---------------- .../shared/components/health-score.vue | 11 +- .../app/components/shared/types/tanstack.ts | 1 + frontend/config/trust-score.ts | 23 ++++ frontend/server/api/badge/health-score.ts | 13 +- .../[slug]/overview/health-score-v2.get.ts | 32 +++++ frontend/types/overview/responses.types.ts | 8 ++ frontend/types/project.ts | 10 ++ 13 files changed, 248 insertions(+), 218 deletions(-) create mode 100644 frontend/app/components/modules/project/components/overview/trust-score-v2.vue create mode 100644 frontend/server/api/project/[slug]/overview/health-score-v2.get.ts diff --git a/frontend/app/components/modules/collection/components/details/collection-health-score-pill.vue b/frontend/app/components/modules/collection/components/details/collection-health-score-pill.vue index b5f16d276..741ba1b6c 100644 --- a/frontend/app/components/modules/collection/components/details/collection-health-score-pill.vue +++ b/frontend/app/components/modules/collection/components/details/collection-health-score-pill.vue @@ -31,6 +31,7 @@ import LfxChip from '~/components/uikit/chip/chip.vue'; const props = defineProps<{ score: number; + healthLabel?: string | null; unavailable?: boolean; }>(); @@ -39,7 +40,13 @@ const props = defineProps<{ // labeled metrics chip). Duplicated rather than shared: only two call sites (row/card) and the // logic is ~10 lines, so a composable would be more ceremony than the duplication it avoids. // health-score.vue itself is intentionally left untouched (used elsewhere in the app). +// +// Prefers the API's real healthLabel (IN-1212, v2) when present; falls back to deriving the +// label from the score for sparse rows where the pipe didn't return a label. const healthScoreLabel = computed(() => { + if (props.healthLabel) { + return props.healthLabel.charAt(0).toUpperCase() + props.healthLabel.slice(1); + } const score = props.score; if (score >= 80) return 'Excellent'; if (score >= 60) return 'Healthy'; diff --git a/frontend/app/components/modules/collection/components/details/collection-project-item.vue b/frontend/app/components/modules/collection/components/details/collection-project-item.vue index 0e0af44db..e488f8bed 100644 --- a/frontend/app/components/modules/collection/components/details/collection-project-item.vue +++ b/frontend/app/components/modules/collection/components/details/collection-project-item.vue @@ -74,7 +74,10 @@ SPDX-License-Identifier: MIT trigger-event="hover" :allow-pass-through="true" > - + @@ -161,7 +164,8 @@ SPDX-License-Identifier: MIT
+ + diff --git a/frontend/app/components/modules/project/views/overview.vue b/frontend/app/components/modules/project/views/overview.vue index 2c48c0bed..25ed9980a 100644 --- a/frontend/app/components/modules/project/views/overview.vue +++ b/frontend/app/components/modules/project/views/overview.vue @@ -16,6 +16,7 @@ SPDX-License-Identifier: MIT :health-score-v2="healthScoreV2Data?.healthScoreV2 ?? null" :health-label="healthScoreV2Data?.healthLabel ?? null" :status="healthScoreV2Status" + :is-repo-selected="selectedRepositories.length > 0" /> ({ projectSlug: route.params.slug as string, diff --git a/frontend/config/trust-score.ts b/frontend/config/trust-score.ts index a29d23156..927fb8da3 100644 --- a/frontend/config/trust-score.ts +++ b/frontend/config/trust-score.ts @@ -72,7 +72,7 @@ export interface HealthScoreV2Config { export const healthScoreV2Config: Record = { excellent: { label: 'Excellent', ghBadgeColor: '#10B981' }, healthy: { label: 'Healthy', ghBadgeColor: '#A7F3D0' }, - fair: { label: 'Fair', ghBadgeColor: '#0094FF' }, + fair: { label: 'Fair', ghBadgeColor: '#F59E0B' }, concerning: { label: 'Concerning', ghBadgeColor: '#F59E0B' }, critical: { label: 'Critical', ghBadgeColor: '#EF4444' }, unavailable: { label: 'Unavailable', ghBadgeColor: '#9CA3AF' }, From cce2c46e3292700dcb9a9b93fa4792a6660df711 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ga=C5=A1per=20Grom?= Date: Tue, 4 Aug 2026 12:03:48 +0100 Subject: [PATCH 08/11] fix: make archived-state exclusive with score content, gate share badge correctly IN-1212 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Gašper Grom --- .../components/overview/trust-score-v2.vue | 130 +++++++++--------- 1 file changed, 68 insertions(+), 62 deletions(-) diff --git a/frontend/app/components/modules/project/components/overview/trust-score-v2.vue b/frontend/app/components/modules/project/components/overview/trust-score-v2.vue index 96ddbe24a..c9b67abce 100644 --- a/frontend/app/components/modules/project/components/overview/trust-score-v2.vue +++ b/frontend/app/components/modules/project/components/overview/trust-score-v2.vue @@ -4,77 +4,79 @@ SPDX-License-Identifier: MIT -->