aboutsummaryrefslogtreecommitdiff
path: root/scripts/theme-studio
diff options
context:
space:
mode:
authorCraig Jennings <c@cjennings.net>2026-06-24 05:54:19 -0400
committerCraig Jennings <c@cjennings.net>2026-06-24 05:54:19 -0400
commitde0c3f89889ed05e906dceaddf4068f2d417a0ac (patch)
tree4c54aa61ee3b7b999c92d951f8518437e1085207 /scripts/theme-studio
parent99cb7324bbd29342f57fa07dec74c366b9195382 (diff)
downloaddotemacs-de0c3f89889ed05e906dceaddf4068f2d417a0ac.tar.gz
dotemacs-de0c3f89889ed05e906dceaddf4068f2d417a0ac.zip
test(nerd-icons): dir-precedence probe + legend round-trip (phase 4)
Lock the dir-precedence decision with an ERT probe: when a dir icon already carries nerd-icons-completion-dir-face, the advice's prepended nerd-icons-yellow is first in the face list and wins. Extend the #nerdiconstest browser gate with an export/import round-trip over an assigned nerd-icons color, asserting it re-imports to the same state and that the separate nerd-icons-completion dir-face stays out of the nerd-icons app. Claude-Session: https://claude.ai/code/session_01BqrdWUo9GcznYX2pZr76gZ
Diffstat (limited to 'scripts/theme-studio')
-rw-r--r--scripts/theme-studio/browser-gates.js9
-rw-r--r--scripts/theme-studio/theme-studio.html9
2 files changed, 18 insertions, 0 deletions
diff --git a/scripts/theme-studio/browser-gates.js b/scripts/theme-studio/browser-gates.js
index e428ae58c..a4412d0b5 100644
--- a/scripts/theme-studio/browser-gates.js
+++ b/scripts/theme-studio/browser-gates.js
@@ -835,6 +835,15 @@ if(location.hash==='#nerdiconstest')gate('nerdiconstest',A=>{
A(els.length===mapped.length,'every '+target+' row rendered ('+els.length+'/'+mapped.length+')');
A(els.length>0&&els.every(e=>/#abcdef/i.test(e.getAttribute('style')||'')),'recolor repaints the mapped rows');
});
+ // Export/import round-trip over an assigned nerd-icons color; the separate
+ // nerd-icons-completion app (dir-face) is untouched by the nerd-icons pane.
+ const m=seedPkgmap();
+ m['nerd-icons']['nerd-icons-blue']={fg:'#123456',bg:null,weight:null,slant:null,inherit:null,height:1,source:'user'};
+ const exp=packagesForExport(m);
+ A(exp['nerd-icons']&&exp['nerd-icons']['nerd-icons-blue']&&exp['nerd-icons']['nerd-icons-blue'].fg==='#123456','assigned nerd-icons color exports');
+ const round=seedPkgmap();mergePackagesInto(round,exp);
+ A(round['nerd-icons']&&round['nerd-icons']['nerd-icons-blue'].fg==='#123456','nerd-icons color re-imports to the same state');
+ A(!(exp['nerd-icons']&&('nerd-icons-completion-dir-face' in exp['nerd-icons'])),'dir-face stays out of the nerd-icons app');
}
});
// picker-distinct gate (open with #pickertest): the color picker panel must stand
diff --git a/scripts/theme-studio/theme-studio.html b/scripts/theme-studio/theme-studio.html
index 8724ef559..556f61e60 100644
--- a/scripts/theme-studio/theme-studio.html
+++ b/scripts/theme-studio/theme-studio.html
@@ -4120,6 +4120,15 @@ if(location.hash==='#nerdiconstest')gate('nerdiconstest',A=>{
A(els.length===mapped.length,'every '+target+' row rendered ('+els.length+'/'+mapped.length+')');
A(els.length>0&&els.every(e=>/#abcdef/i.test(e.getAttribute('style')||'')),'recolor repaints the mapped rows');
});
+ // Export/import round-trip over an assigned nerd-icons color; the separate
+ // nerd-icons-completion app (dir-face) is untouched by the nerd-icons pane.
+ const m=seedPkgmap();
+ m['nerd-icons']['nerd-icons-blue']={fg:'#123456',bg:null,weight:null,slant:null,inherit:null,height:1,source:'user'};
+ const exp=packagesForExport(m);
+ A(exp['nerd-icons']&&exp['nerd-icons']['nerd-icons-blue']&&exp['nerd-icons']['nerd-icons-blue'].fg==='#123456','assigned nerd-icons color exports');
+ const round=seedPkgmap();mergePackagesInto(round,exp);
+ A(round['nerd-icons']&&round['nerd-icons']['nerd-icons-blue'].fg==='#123456','nerd-icons color re-imports to the same state');
+ A(!(exp['nerd-icons']&&('nerd-icons-completion-dir-face' in exp['nerd-icons'])),'dir-face stays out of the nerd-icons app');
}
});
// picker-distinct gate (open with #pickertest): the color picker panel must stand