aboutsummaryrefslogtreecommitdiff
path: root/scripts/theme-studio/browser-gates.js
diff options
context:
space:
mode:
authorCraig Jennings <c@cjennings.net>2026-06-16 08:27:53 -0500
committerCraig Jennings <c@cjennings.net>2026-06-16 08:27:53 -0500
commitc96c1e9f94f52876b3a8c6ab8e35a00e5f556f3d (patch)
treeb9ae25a0f4a2dad3309f088aea9adf4d78a091eb /scripts/theme-studio/browser-gates.js
parent5c74f731862d8e8464f06d77a1d5ae2f0f3d5a1d (diff)
downloaddotemacs-c96c1e9f94f52876b3a8c6ab8e35a00e5f556f3d.tar.gz
dotemacs-c96c1e9f94f52876b3a8c6ab8e35a00e5f556f3d.zip
feat(theme-studio): add gnus as a view package
mu4e renders the open message with gnus, so the article-view headers, quote levels, signature, and inline emphasis are all gnus faces, not mu4e ones. gnus ships them as bright greens on a dark background, and the theme had no way to reach them. I added gnus as a bespoke view package: the article-view face set in face_data.py with palette seeds that mirror the mu4e header treatment, a realistic preview (header block, emphasized body, an 11-level quoted reply chain, signature), and a #gnustest gate that asserts every emitted face is a real gnus face. Theming and exporting gnus in the studio retires the green in the live view.
Diffstat (limited to 'scripts/theme-studio/browser-gates.js')
-rw-r--r--scripts/theme-studio/browser-gates.js15
1 files changed, 15 insertions, 0 deletions
diff --git a/scripts/theme-studio/browser-gates.js b/scripts/theme-studio/browser-gates.js
index 550177c34..2748f326e 100644
--- a/scripts/theme-studio/browser-gates.js
+++ b/scripts/theme-studio/browser-gates.js
@@ -778,6 +778,21 @@ if(location.hash==='#mupreviewtest'){let ok=true;const notes=[];const A=(c,n)=>{
A(used.includes(f),'preview includes '+f);
document.title='MUPREVIEWTEST '+(ok?'PASS':'FAIL');
const d=document.createElement('div');d.id='mupreviewtest';d.textContent='MUPREVIEWTEST '+(ok?'PASS':'FAIL')+(notes.length?' fails='+notes.join(','):'');document.body.appendChild(d);}
+// gnus-preview gate (open with #gnustest): gnus is its own view package (it drives
+// the mu4e article view), and every data-face its preview emits is a real gnus face.
+if(location.hash==='#gnustest'){let ok=true;const notes=[];const A=(c,n)=>{if(!c){ok=false;notes.push(n);}};
+ A(!!APPS['gnus'],'gnus is a registered view package');
+ A(APPS['gnus']&&APPS['gnus'].preview==='gnus','gnus uses the gnus preview renderer');
+ const box=document.createElement('div');box.innerHTML=renderGnusPreview();
+ const valid=new Set((APPS['gnus']&&APPS['gnus'].faces||[]).map(r=>r[0]));
+ const used=[...box.querySelectorAll('[data-face]')].map(e=>e.dataset.face);
+ A(used.length>=20,'preview exercises many faces ('+used.length+')');
+ const bad=used.filter(f=>!valid.has(f));
+ A(bad.length===0,'every data-face is a real gnus face; bad='+bad.join(','));
+ for(const f of ['gnus-header-name','gnus-header-from','gnus-header-subject','gnus-cite-1','gnus-cite-attribution','gnus-signature','gnus-button','gnus-emphasis-highlight-words'])
+ A(used.includes(f),'preview includes '+f);
+ document.title='GNUSTEST '+(ok?'PASS':'FAIL');
+ const d=document.createElement('div');d.id='gnustest';d.textContent='GNUSTEST '+(ok?'PASS':'FAIL')+(notes.length?' fails='+notes.join(','):'');document.body.appendChild(d);}
// Box-cluster gate (open with #boxtest): the box control is a 2x2 cluster of
// four radio buttons (none / line / pressed / raised); the color swatch shows
// only while a box style is active.