From 31a84b95e307c85599c824150bbde943e18f3775 Mon Sep 17 00:00:00 2001 From: justin Date: Tue, 28 Apr 2026 03:24:08 -0500 Subject: [PATCH] Fix CTA not including RMD quality issues in remediation list - Always rebuild CTA when observer fires (removes stale CTA first) - Check both label and full card text for service detection - Add dedup guards on service list Co-Authored-By: Claude Opus 4.6 (1M context) --- .../tools/fcc-compliance-check/index.html | 21 +++++++++++-------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/site/public/tools/fcc-compliance-check/index.html b/site/public/tools/fcc-compliance-check/index.html index 94fa545..14b6f76 100644 --- a/site/public/tools/fcc-compliance-check/index.html +++ b/site/public/tools/fcc-compliance-check/index.html @@ -409,23 +409,26 @@ Send reset link // Remediation CTA — rebuild if FRN changed (user searched new company) var currentFrn = (document.getElementById("entity-frn").textContent || "").replace(/\D/g, ""); var existingCta = document.getElementById("pw-remediation-cta"); - if (existingCta && existingCta.dataset.frn && existingCta.dataset.frn !== currentFrn) { + if (existingCta) { + // Remove CTA if FRN changed or if we need to rebuild existingCta.remove(); existingCta = null; } - if (!existingCta) { + { var actionCards = checks.querySelectorAll(":scope > .bg-red-50, :scope > .bg-amber-50"); if (actionCards.length > 0) { var services = []; actionCards.forEach(function(rc) { - var t = rc.textContent; + var t = rc.textContent || ""; var lbl = rc.querySelector("p") ? rc.querySelector("p").textContent : ""; - if (lbl.indexOf("CPNI") >= 0) services.push("cpni"); - else if (lbl.indexOf("499-Q") >= 0) services.push("499q"); - else if (lbl.indexOf("499-A") >= 0) services.push("499a"); - else if (lbl.indexOf("RMD") >= 0 && services.indexOf("rmd") < 0) services.push("rmd"); - else if (lbl.indexOf("STIR") >= 0) services.push("stir"); - else if (lbl.indexOf("Broadband") >= 0 || lbl.indexOf("BDC") >= 0) services.push("bdc"); + // Check both label and full text to catch quality sub-checks + var combined = lbl + " " + t; + if (combined.indexOf("CPNI") >= 0) services.push("cpni"); + else if (combined.indexOf("499-Q") >= 0) services.push("499q"); + else if (combined.indexOf("499-A") >= 0 && services.indexOf("499a") < 0) services.push("499a"); + else if (combined.indexOf("RMD") >= 0 && services.indexOf("rmd") < 0) services.push("rmd"); + else if (combined.indexOf("STIR") >= 0) services.push("stir"); + else if ((combined.indexOf("Broadband") >= 0 || combined.indexOf("BDC") >= 0) && services.indexOf("bdc") < 0) services.push("bdc"); }); if (services.length > 0) { var hasBdcQuestion = !!checks.querySelector(".pw-bdc-toggle");