← back to Rentv Sheet Enrich
rentv :9797 legend: persist the 'more colors' fold state across re-renders (Cody fix)
4be38e7f43a26b8d643ef9da77278270cd587b9d · 2026-08-13 20:43:03 -0700 · Steve Abrams
Expanding the one-off-colors fold then renaming/resetting a color re-rendered the panel
and silently collapsed it. A module-scope _minorOpen now remembers the fold state and
restores it after each render.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Files touched
Diff
commit 4be38e7f43a26b8d643ef9da77278270cd587b9d
Author: Steve Abrams <steve@designerwallcoverings.com>
Date: Thu Aug 13 20:43:03 2026 -0700
rentv :9797 legend: persist the 'more colors' fold state across re-renders (Cody fix)
Expanding the one-off-colors fold then renaming/resetting a color re-rendered the panel
and silently collapsed it. A module-scope _minorOpen now remembers the fold state and
restores it after each render.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
---
public_live/index.html | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/public_live/index.html b/public_live/index.html
index a0918d0..4f48294 100644
--- a/public_live/index.html
+++ b/public_live/index.html
@@ -576,6 +576,7 @@ function provName(hex){ const o=LS.get('cname.'+hex,null); if(o!=null&&o!=='')re
return 'Needs email / Outreach pending'; // magenta/pink
}
function colorTally(){ const t={}; for(const hx of Object.values(COLORS))t[hx]=(t[hx]||0)+1; return Object.entries(t).sort((a,b)=>b[1]-a[1]); }
+let _minorOpen=false; // persist the 'more one-off colors' fold state across re-renders
function renderLegend(){ let p=$('#legendpanel'); if(p&&document.activeElement&&p.contains(document.activeElement))return; // don't nuke a name mid-edit
if(!p){p=document.createElement('div');p.id='legendpanel';p.className='legendpanel';document.body.appendChild(p);}
const items=colorTally();
@@ -587,7 +588,9 @@ function renderLegend(){ let p=$('#legendpanel'); if(p&&document.activeElement&&
+primary.map(row).join('')
+(minor.length?`<div class="lgmore" id="lgmore">▸ ${minor.length} more one-off colors</div><div class="lgminor" id="lgminor" style="display:none">${minor.map(row).join('')}</div>`:'');
p.querySelector('.lgclose').onclick=closeLegend;
- const mo=p.querySelector('#lgmore'); if(mo)mo.onclick=()=>{ const mn=p.querySelector('#lgminor'),open=mn.style.display!=='none'; mn.style.display=open?'none':'block'; mo.textContent=(open?'▸ ':'▾ ')+minor.length+' more one-off colors'; };
+ const mo=p.querySelector('#lgmore');
+ if(mo){ if(_minorOpen){ p.querySelector('#lgminor').style.display='block'; mo.textContent='▾ '+minor.length+' more one-off colors'; } // restore fold state
+ mo.onclick=()=>{ const mn=p.querySelector('#lgminor'); _minorOpen=(mn.style.display==='none'); mn.style.display=_minorOpen?'block':'none'; mo.textContent=(_minorOpen?'▾ ':'▸ ')+minor.length+' more one-off colors'; }; }
p.querySelectorAll('.lgreset').forEach(b=>b.onclick=()=>{ localStorage.removeItem('rc2.cname.'+b.dataset.hx); renderLegend(); });
p.querySelectorAll('.lgname').forEach(el=>{ el.onblur=()=>{ if(window._legEsc){window._legEsc=false;return;} const v=el.textContent.trim(); if(v)LS.set('cname.'+el.dataset.hx, v); };
el.onkeydown=e=>{ if(e.key==='Enter'){e.preventDefault();el.blur();} }; });
← 06105fe rentv :9797 legend: fold the long tail of one-off color tint
·
back to Rentv Sheet Enrich
·
rentv :9797 status data: strip enrichment-green mis-captures 51390ef →