From 5d9b378e55984404bbf504835c96c6474b5546f3 Mon Sep 17 00:00:00 2001 From: justin Date: Tue, 28 Apr 2026 04:58:59 -0500 Subject: [PATCH] Scroll to results anchor when search result is clicked Immediate scroll before the FCC lookup starts, so the user sees the loading spinner even when the search results list is long. Co-Authored-By: Claude Opus 4.6 (1M context) --- site/public/_astro/hoisted.aBLqmOPy.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/site/public/_astro/hoisted.aBLqmOPy.js b/site/public/_astro/hoisted.aBLqmOPy.js index 3a4b8bc..831d90c 100644 --- a/site/public/_astro/hoisted.aBLqmOPy.js +++ b/site/public/_astro/hoisted.aBLqmOPy.js @@ -3,7 +3,7 @@ import"./hoisted.yFz1BYXO.js";const k=window.__PW_API||"https://api.performancew ${s.frn?`FRN: ${s.frn}`:""} ${s.filer_id?`Filer ID: ${s.filer_id}`:""} (${C}) - `,i.addEventListener("click",()=>{s.frn?(f.value=s.frn,m()):h("This record has no FRN. Enter an FRN manually to run a compliance check.")}),n.appendChild(i)}}catch{t("search-count").textContent="Search failed. Please try again.",t("search-results")?.classList.remove("hidden")}finally{p.disabled=!1,p.textContent="Search"}}}async function m(){const e=f.value.replace(/\D/g,"").padStart(10,"0");if(e.length!==10||e==="0000000000"){h("Please enter a valid 10-digit FRN.");return}const r=new URL(window.location.href);r.searchParams.set("frn",e),history.replaceState(null,"",r.toString()),t("loading")?.classList.remove("hidden"),t("results")?.classList.add("hidden"),t("error-box")?.classList.add("hidden"),l.disabled=!0,l.textContent="Checking...";try{const o=await fetch(`${k}/api/v1/fcc/lookup?frn=${e}`),d=await o.json();if(!o.ok){h(d.error||"Lookup failed. Please try again.");return}$(d)}catch{h("Could not reach the compliance checker. Please try again.")}finally{t("loading")?.classList.add("hidden"),l.disabled=!1,l.textContent="Check Compliance"}}function h(e){const r=t("error-box"),o=t("error-msg");o.textContent=e,r.classList.remove("hidden"),t("loading")?.classList.add("hidden"),l.disabled=!1,l.textContent="Check Compliance"}function $(e){t("entity-name").textContent=e.entity_name||"Unknown Entity",t("entity-frn").textContent=e.frn;const r=e.cores;r.address?t("entity-address").textContent=[r.address,r.city,r.state,r.zip].filter(Boolean).join(", "):t("entity-address").textContent="Address not available from CORES";const o=t("checks-container");o.innerHTML="";for(const n of e.checks){const a={green:{bg:"bg-green-50",border:"border-green-200",icon:"text-green-600",text:"text-green-800"},yellow:{bg:"bg-amber-50",border:"border-amber-200",icon:"text-amber-600",text:"text-amber-800"},red:{bg:"bg-red-50",border:"border-red-200",icon:"text-red-600",text:"text-red-800"},unknown:{bg:"bg-gray-50",border:"border-gray-200",icon:"text-gray-400",text:"text-gray-600"}},s=a[n.status]||a.unknown,i={green:'',yellow:'',red:'',unknown:''},u=document.createElement("div");u.className=`${s.bg} ${s.border} border rounded-xl p-4 flex items-start gap-3`,u.innerHTML=` + `,i.addEventListener("click",()=>{s.frn?(f.value=s.frn,document.getElementById("pw-results-anchor")?.scrollIntoView({behavior:"smooth",block:"start"}),m()):h("This record has no FRN. Enter an FRN manually to run a compliance check.")}),n.appendChild(i)}}catch{t("search-count").textContent="Search failed. Please try again.",t("search-results")?.classList.remove("hidden")}finally{p.disabled=!1,p.textContent="Search"}}}async function m(){const e=f.value.replace(/\D/g,"").padStart(10,"0");if(e.length!==10||e==="0000000000"){h("Please enter a valid 10-digit FRN.");return}const r=new URL(window.location.href);r.searchParams.set("frn",e),history.replaceState(null,"",r.toString()),t("loading")?.classList.remove("hidden"),t("results")?.classList.add("hidden"),t("error-box")?.classList.add("hidden"),l.disabled=!0,l.textContent="Checking...";try{const o=await fetch(`${k}/api/v1/fcc/lookup?frn=${e}`),d=await o.json();if(!o.ok){h(d.error||"Lookup failed. Please try again.");return}$(d)}catch{h("Could not reach the compliance checker. Please try again.")}finally{t("loading")?.classList.add("hidden"),l.disabled=!1,l.textContent="Check Compliance"}}function h(e){const r=t("error-box"),o=t("error-msg");o.textContent=e,r.classList.remove("hidden"),t("loading")?.classList.add("hidden"),l.disabled=!1,l.textContent="Check Compliance"}function $(e){t("entity-name").textContent=e.entity_name||"Unknown Entity",t("entity-frn").textContent=e.frn;const r=e.cores;r.address?t("entity-address").textContent=[r.address,r.city,r.state,r.zip].filter(Boolean).join(", "):t("entity-address").textContent="Address not available from CORES";const o=t("checks-container");o.innerHTML="";for(const n of e.checks){const a={green:{bg:"bg-green-50",border:"border-green-200",icon:"text-green-600",text:"text-green-800"},yellow:{bg:"bg-amber-50",border:"border-amber-200",icon:"text-amber-600",text:"text-amber-800"},red:{bg:"bg-red-50",border:"border-red-200",icon:"text-red-600",text:"text-red-800"},unknown:{bg:"bg-gray-50",border:"border-gray-200",icon:"text-gray-400",text:"text-gray-600"}},s=a[n.status]||a.unknown,i={green:'',yellow:'',red:'',unknown:''},u=document.createElement("div");u.className=`${s.bg} ${s.border} border rounded-xl p-4 flex items-start gap-3`,u.innerHTML=` ${i[n.status]||i.unknown}