From 7a7b1c164867c60325a8b9644a777e4e5cdf52ce Mon Sep 17 00:00:00 2001 From: Craig Jennings Date: Mon, 15 Jun 2026 17:30:03 -0500 Subject: refactor(theme-studio): drop the per-row reset column from package faces Package faces was the only tier with a per-row reset button, in its own column. The syntax and ui tiers rely on the bulk reset alone, and the column cost horizontal space the table needs. I removed the per-row cell and its header, so the bulk reset (next to "lock all") is the single reset path now, matching the other tiers. A #viewtest assertion confirms the package rows carry no per-row reset button. The two weren't equivalent: the per-row button reset one face to its default, the bulk reset clears every unlocked face in the app. Losing single-face reset is the accepted tradeoff. --- scripts/theme-studio/theme-studio.html | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'scripts/theme-studio/theme-studio.html') diff --git a/scripts/theme-studio/theme-studio.html b/scripts/theme-studio/theme-studio.html index 9f74e79e2..458243b5d 100644 --- a/scripts/theme-studio/theme-studio.html +++ b/scripts/theme-studio/theme-studio.html @@ -235,7 +235,7 @@
-
face △fg △bg △stylecontrast △inherit △size △box
+
face △fg △bg △stylecontrast △inherit △size △box
@@ -1982,7 +1982,7 @@ function buildPkgTable(){ const app=curApp(),tb=document.getElementById('pkgbody');if(!tb)return;tb.innerHTML=''; const flt=(document.getElementById('pkgfilter').value||'').trim().toLowerCase(); const inh=[''].concat(BASE_INHERITS).concat(APPS[app].faces.map(r=>r[0])); - for(const [face,label,def] of APPS[app].faces){ + for(const [face,label] of APPS[app].faces){ if(flt&&!(face.toLowerCase().includes(flt)||label.toLowerCase().includes(flt)))continue; const f=PKGMAP[app][face],tr=document.createElement('tr');tr.dataset.face=face; const c0=document.createElement('td');c0.className='cat';c0.textContent=label;c0.title=face;c0.style.cursor='pointer';c0.onclick=()=>flashPkgPreview(face); @@ -1997,9 +1997,8 @@ function buildPkgTable(){ const ch=document.createElement('td');const hin=document.createElement('input');hin.type='number';hin.min='0.8';hin.max='2.5';hin.step='0.05';hin.value=f.height||1;hin.className='hstep';hin.onchange=()=>{f.height=parseFloat(hin.value)||1;f.source='user';pkgChanged();};ch.appendChild(hin); const cc=document.createElement('td');cc.style.fontSize='10pt';cc.style.whiteSpace='nowrap';const efg=effFg(pkgEffFg(app,face)),ebg=effBg(pkgEffBg(app,face)),r=contrast(efg,ebg);cc.innerHTML=crHtml(r); const cx=document.createElement('td');const boxCtl=mkBoxControl(()=>f.box,b=>{f.box=b;f.source='user';pkgChanged();},{compact:true});cx.appendChild(boxCtl); - const cr=document.createElement('td');const rb=document.createElement('button');rb.className='sbtn';rb.textContent='↺';rb.title='reset to default';rb.onclick=()=>{PKGMAP[app][face]=seedFace(def);pkgChanged();};cr.appendChild(rb); - const cL=mkLockCell('pkg:'+app+':'+face,[fgd,bgd,...pkBtns,isel,hin,boxCtl,rb]); - tr.append(c0,cL,cf,cb,cw,cc,ci,ch,cx,cr);tb.appendChild(tr); + const cL=mkLockCell('pkg:'+app+':'+face,[fgd,bgd,...pkBtns,isel,hin,boxCtl]); + tr.append(c0,cL,cf,cb,cw,cc,ci,ch,cx);tb.appendChild(tr); } applyTableSort('pkgbody'); updateLockToggle('pkg'); @@ -3160,6 +3159,7 @@ if(location.hash==='#viewtest'){let ok=true;const notes=[];const A=(c,n)=>{if(!c const firstApp=Object.keys(APPS)[0];sel.value=firstApp;onViewChange(); A(!vis('view-code')&&!vis('view-ui')&&vis('view-pkg'),'pkg-view-only'); A(curApp()===firstApp,'curApp-returns-selected-app'); + A(!document.querySelector('#pkgbody .sbtn[title="reset to default"]'),'no-per-row-reset-button'); } document.title='VIEWTEST '+(ok?'PASS':'FAIL'); const d=document.createElement('div');d.id='viewtest';d.textContent='VIEWTEST '+(ok?'PASS':'FAIL')+(notes.length?' fails='+notes.join(','):'');document.body.appendChild(d);} -- cgit v1.2.3