← back to Dw Pitch Followup
fix: ✓ emailed date chip appears immediately after send — repaint live cards by DOM lookup (active.card was detached after board re-renders), update SENT_IDX in memory for same-client cards in other lists, and refresh sent-index on tab focus for cross-device visibility
a923a04df3c3041e390e4358e441abf1a8eb8a44 · 2026-07-15 10:45:44 -0700 · Steve Abrams
Files touched
Diff
commit a923a04df3c3041e390e4358e441abf1a8eb8a44
Author: Steve Abrams <steve@designerwallcoverings.com>
Date: Wed Jul 15 10:45:44 2026 -0700
fix: ✓ emailed date chip appears immediately after send — repaint live cards by DOM lookup (active.card was detached after board re-renders), update SENT_IDX in memory for same-client cards in other lists, and refresh sent-index on tab focus for cross-device visibility
---
public/index.html | 17 +++++++++++++++++
1 file changed, 17 insertions(+)
diff --git a/public/index.html b/public/index.html
index 4c1ee92..1ffbbe0 100644
--- a/public/index.html
+++ b/public/index.html
@@ -837,6 +837,23 @@ layout=LS('layout','board');
// Load the real "who have we emailed" index first (best-effort) so every card can show a
// live emailed-date chip, then render the lists. A slow/failed index never blocks the board.
window.SENT_IDX={}; window.FU_CACHE={};
+// Refresh the sent-index when the tab regains focus (a tab left open on another
+// machine/browser otherwise NEVER learns about sends made elsewhere), then paint
+// the ✓ emailed chip onto any visible card that gained a send. Cheap: one GET,
+// server caches 60s, repaints only cards that were missing the chip.
+let _idxBusy=false;
+async function refreshSentIdx(){
+ if(_idxBusy)return; _idxBusy=true;
+ try{
+ const j=await fetch(API('/api/sent-index')).then(r=>r.json());
+ window.SENT_IDX=j.idx||window.SENT_IDX;
+ document.querySelectorAll('.card').forEach(c=>{
+ const row=c._row; if(!row||!row.email||c.querySelector('.chip.sent'))return;
+ if(SENT_IDX[String(row.email).trim().toLowerCase()])repaintSentCards(row.email);
+ });
+ }catch{/* best-effort — next focus retries */}finally{_idxBusy=false;}
+}
+document.addEventListener('visibilitychange',()=>{if(document.visibilityState==='visible')refreshSentIdx()});
Promise.allSettled([
fetch(API('/api/sent-index')).then(r=>r.json()).then(j=>{window.SENT_IDX=j.idx||{}}),
fetch(API('/api/followup-cache')).then(r=>r.json()).then(j=>{window.FU_CACHE=j.map||{}}),
← 177117e Show invoice # + current internal note on every pitch card —
·
back to Dw Pitch Followup
·
Make invoice # on the note chip + notes editor clickable — o 109d6a3 →