From d2360a7e2184bc16ac7b85e5a32ccb5df53eebcf Mon Sep 17 00:00:00 2001 From: "[dyad]" Date: Tue, 20 Jan 2026 14:39:26 +0100 Subject: [PATCH] [dyad] Updated image tab indicator logic - wrote 1 file(s) --- src/components/meta-form.tsx | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/components/meta-form.tsx b/src/components/meta-form.tsx index b1b7587..b24fac7 100644 --- a/src/components/meta-form.tsx +++ b/src/components/meta-form.tsx @@ -101,8 +101,19 @@ export function MetaForm() { // Images Tab let imagesColor: IndicatorColor = "gray"; if (metaData.images && metaData.images.length > 0) { + const totalImages = metaData.images.length; const missingAltCount = metaData.images.filter((img) => !img.alt).length; - imagesColor = missingAltCount > 0 ? "red" : "green"; + + if (missingAltCount === 0) { + imagesColor = "green"; + } else { + const missingPercentage = missingAltCount / totalImages; + if (missingPercentage > 0.5) { + imagesColor = "red"; + } else { + imagesColor = "yellow"; + } + } } // FAQ Tab