From b8150eb158bf53933199104a8ac5b084f3800a2c Mon Sep 17 00:00:00 2001 From: abhishek Date: Fri, 4 Sep 2026 16:36:50 +0530 Subject: [PATCH] health score --- src/features/store-admin/HealthScorePanel.tsx | 39 +++++++++++++++++-- 1 file changed, 35 insertions(+), 4 deletions(-) diff --git a/src/features/store-admin/HealthScorePanel.tsx b/src/features/store-admin/HealthScorePanel.tsx index 2bee114..b44bc29 100644 --- a/src/features/store-admin/HealthScorePanel.tsx +++ b/src/features/store-admin/HealthScorePanel.tsx @@ -43,9 +43,29 @@ export function HealthScorePanel({ product }: { product: Product }) { retry: false, }); - // Nothing to look up. Not an error and not worth a line of chrome saying so: - // most products in this catalogue were typed in or imported from a sheet. - if (!brand || !imageId) return null; + /* + * No catalogue link, so there is nothing to look up. + * + * This used to render nothing at all, on the reasoning that most products + * here were typed in or imported from a sheet and a line of chrome on every + * one of them is noise. That was wrong in the way that matters: somebody who + * has been told the console shows health scores opens a product, sees no + * section whatsoever, and concludes the feature is broken. Silence and + * failure look identical. + * + * One quiet line costs a few pixels in a drawer and answers the question. + */ + if (!brand || !imageId) { + return ( + + + ); + } if (query.isLoading) { return ( @@ -60,7 +80,18 @@ export function HealthScorePanel({ product }: { product: Product }) { const shown = present(query.data ?? null); - if (shown.isEmpty) return null; + // The service has never heard of this product — a different answer from + // "known but unscored", and said differently, for the same reason as above. + if (shown.isEmpty) { + return ( + + + ); + } if (shown.isPending) { return (