[object Object]

← back to Commercialrealestate

CRCP scope Cycle 5: empty-state fires on any scoped grid that resolves to 0 rows (drop arrBefore>0 clause) so an empty-source grid also explains itself instead of rendering a bare blank

adbdad4a48de22632f71c5286b9cbb3bf55c287e · 2026-08-20 16:02:03 -0700 · Steve

Files touched

Diff

commit adbdad4a48de22632f71c5286b9cbb3bf55c287e
Author: Steve <steve@designerwallcoverings.com>
Date:   Thu Aug 20 16:02:03 2026 -0700

    CRCP scope Cycle 5: empty-state fires on any scoped grid that resolves to 0 rows (drop arrBefore>0 clause) so an empty-source grid also explains itself instead of rendering a bare blank
---
 public/crcp-scope.js | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/public/crcp-scope.js b/public/crcp-scope.js
index fc1e25a..8586c5f 100644
--- a/public/crcp-scope.js
+++ b/public/crcp-scope.js
@@ -136,7 +136,9 @@
     if (document.querySelector("[data-crcp-empty]")) return;   // empty-state already shown, don't double
     if (scoped.ranked === 0 && scoped.total > 0) {             // main grid scoped but city has none
       bar.insertAdjacentElement("afterend", emptyNote("No CRCP listings in <b>" + CITY.label + "</b> yet."));
-    } else if (scoped.arrMatched && scoped.arrAfter === 0 && scoped.arrBefore > 0 && !isDirectory) {
+    } else if (scoped.arrMatched && scoped.arrAfter === 0 && !isDirectory) {
+      // fires whether the city filtered a populated grid to 0 OR the source array is itself
+      // empty (arrBefore===0) — a blank scoped grid must always explain itself, never render bare.
       bar.insertAdjacentElement("afterend", emptyNote("No listings in <b>" + CITY.label + "</b> for this view yet."));
     }
   }

← ed37f76 CRCP: stop tracking generated data reports (afternoon/reside  ·  back to Commercialrealestate  ·  auto-data-snapshot: 2026-08-20T17:19:08 (2 data files) — dat 804a788 →