← back to Rentv
fix(deals/closings-admin): party drill-downs filter by FIRM not the full 'Firm (agent, agent…)' string — clicking a broker chip now finds the firm's 449/806 deals instead of just itself (dead-drill → live). Display keeps full attribution; both twins fixed
773a0d05df3873852bcd2263be20d0e31118f18c · 2026-08-06 08:55:03 -0700 · Steve
Files touched
M public/closings.htmlM public/deals.html
Diff
commit 773a0d05df3873852bcd2263be20d0e31118f18c
Author: Steve <steve@designerwallcoverings.com>
Date: Thu Aug 6 08:55:03 2026 -0700
fix(deals/closings-admin): party drill-downs filter by FIRM not the full 'Firm (agent, agent…)' string — clicking a broker chip now finds the firm's 449/806 deals instead of just itself (dead-drill → live). Display keeps full attribution; both twins fixed
---
public/closings.html | 5 ++++-
public/deals.html | 5 ++++-
2 files changed, 8 insertions(+), 2 deletions(-)
diff --git a/public/closings.html b/public/closings.html
index fc6a9f97..ed8f0a95 100644
--- a/public/closings.html
+++ b/public/closings.html
@@ -204,6 +204,9 @@ const fmtDateTime=v=>{if(!v)return'';const s=String(v);
const md=s.match(/^(\d{4})-(\d{2})-(\d{2})$/);
if(md)return new Date(+md[1],+md[2]-1,+md[3]).toLocaleDateString(undefined,{month:'short',day:'numeric',year:'numeric'});
const dt=new Date(s);return isNaN(dt)?'':dt.toLocaleString(undefined,{month:'short',day:'numeric',year:'numeric',hour:'numeric',minute:'2-digit'});};
+// Party drill filters by the FIRM (strip a "(agent, agent…)" roster) so clicking a broker/party chip
+// finds the firm's OTHER deals, not just this one — the full-string value matched only itself (1 deal).
+const firmKey=v=>{const t=String(v||'').split('(')[0].trim().replace(/[,;]\s*$/,'');return t||String(v||'');};
const isManual=d=>d._manual||String(d.id||'').startsWith('mc');
function pills(){
@@ -250,7 +253,7 @@ function render(){
<div class="body">
<div class="addr">${esc(d.address||d.title)}</div>
${loc?`<div class="meta"><span class="drill" data-filt="q" data-val="${esc(loc)}" title="Filter by ${esc(loc)}">📍 <b>${esc(loc)}</b></span>${d.size_label?`<span>📐 ${esc(d.size_label)}</span>`:''}${d.year_built?`<span>🏗 ${esc(d.year_built)}</span>`:''}</div>`:''}
- ${(d.buyer||d.seller||d.broker)?`<div class="meta parties">${d.buyer?`<span class="party" data-party="${esc(d.buyer)}" title="Buyer — click to see this party's deals">🟢 <b>${esc(d.buyer)}</b></span>`:''}${d.seller?`<span class="party" data-party="${esc(d.seller)}" title="Seller — click to filter">🔴 ${esc(d.seller)}</span>`:''}${d.broker?`<span class="party" data-party="${esc(d.broker)}" title="Broker — click to filter">🤝 ${esc(d.broker)}</span>`:''}</div>`:''}
+ ${(d.buyer||d.seller||d.broker)?`<div class="meta parties">${d.buyer?`<span class="party" data-party="${esc(firmKey(d.buyer))}" title="Buyer — click to see this firm's deals">🟢 <b>${esc(d.buyer)}</b></span>`:''}${d.seller?`<span class="party" data-party="${esc(firmKey(d.seller))}" title="Seller — click to filter">🔴 ${esc(d.seller)}</span>`:''}${d.broker?`<span class="party" data-party="${esc(firmKey(d.broker))}" title="Broker — click to filter">🤝 ${esc(d.broker)}</span>`:''}</div>`:''}
${(d.address&&d.title)?`<h3>${esc(d.title)}</h3>`:''}
${d.created_at?`<div class="when" title="${esc(d.created_at)}">🕓 Added ${esc(fmtDateTime(d.created_at))}</div>`:''}
<div class="cardfoot">
diff --git a/public/deals.html b/public/deals.html
index c28f32d2..218f45d4 100644
--- a/public/deals.html
+++ b/public/deals.html
@@ -222,6 +222,9 @@ const fmtDateTime=v=>{if(!v)return'';const s=String(v);
const md=s.match(/^(\d{4})-(\d{2})-(\d{2})$/);
if(md)return new Date(+md[1],+md[2]-1,+md[3]).toLocaleDateString(undefined,{month:'short',day:'numeric',year:'numeric'});
const dt=new Date(s);return isNaN(dt)?'':dt.toLocaleString(undefined,{month:'short',day:'numeric',year:'numeric',hour:'numeric',minute:'2-digit'});};
+// Party drill filters by the FIRM (strip a "(agent, agent…)" roster) so clicking a broker/party chip
+// finds the firm's OTHER deals, not just this one — the full-string value matched only itself (1 deal).
+const firmKey=v=>{const t=String(v||'').split('(')[0].trim().replace(/[,;]\s*$/,'');return t||String(v||'');};
const isManual=d=>d._manual||String(d.id||'').startsWith('md');
function pillRow(hostId,list,cur,pick){
@@ -275,7 +278,7 @@ function render(){
<div class="body">
<div class="addr">${esc(d.address||d.title)}</div>
${loc?`<div class="meta"><span class="drill" data-filt="q" data-val="${esc(loc)}" title="Filter by ${esc(loc)}">📍 <b>${esc(loc)}</b></span>${d.size_label?`<span>📐 ${esc(d.size_label)}</span>`:''}${d.year_built?`<span>🏗 ${esc(d.year_built)}</span>`:''}</div>`:''}
- ${(d.buyer||d.seller||d.broker)?`<div class="meta parties">${d.buyer?`<span class="drill" data-filt="q" data-val="${esc(d.buyer)}" title="Buyer — filter by ${esc(d.buyer)}">🟢 <b>${esc(d.buyer)}</b></span>`:''}${d.seller?`<span class="drill" data-filt="q" data-val="${esc(d.seller)}" title="Seller — filter by ${esc(d.seller)}">🔴 ${esc(d.seller)}</span>`:''}${d.broker?`<span class="drill" data-filt="q" data-val="${esc(d.broker)}" title="Broker — filter by ${esc(d.broker)}">🤝 ${esc(d.broker)}</span>`:''}</div>`:''}
+ ${(d.buyer||d.seller||d.broker)?`<div class="meta parties">${d.buyer?`<span class="drill" data-filt="q" data-val="${esc(firmKey(d.buyer))}" title="Buyer — filter by ${esc(firmKey(d.buyer))}">🟢 <b>${esc(d.buyer)}</b></span>`:''}${d.seller?`<span class="drill" data-filt="q" data-val="${esc(firmKey(d.seller))}" title="Seller — filter by ${esc(firmKey(d.seller))}">🔴 ${esc(d.seller)}</span>`:''}${d.broker?`<span class="drill" data-filt="q" data-val="${esc(firmKey(d.broker))}" title="Broker — filter by ${esc(firmKey(d.broker))}">🤝 ${esc(d.broker)}</span>`:''}</div>`:''}
${(d.address&&d.title)?`<h3>${esc(d.title)}</h3>`:''}
${d.created_at?`<div class="when" title="${esc(d.created_at)}">🕓 Added ${esc(fmtDateTime(d.created_at))}</div>`:''}
<div class="cardfoot">
← 46c1d8d2 PR intel: CRM auth routes + capability middleware (login/log
·
back to Rentv
·
Add 'News Map' to sitewide nav + resolve straggler cities to 5707ef5f →