aboutsummaryrefslogtreecommitdiff
path: root/scripts/theme-studio/theme-studio.html
diff options
context:
space:
mode:
authorCraig Jennings <c@cjennings.net>2026-07-02 13:10:54 -0400
committerCraig Jennings <c@cjennings.net>2026-07-02 13:10:54 -0400
commit67a609dd5e98df4df9a3fb40104817e0c25e5582 (patch)
tree636b75b2e874b286e6e97db2f85f4bf1ea0fcd8b /scripts/theme-studio/theme-studio.html
parentc3e183da48cc6c807b301a25c91fc0eaaec89a14 (diff)
downloaddotemacs-67a609dd5e98df4df9a3fb40104817e0c25e5582.tar.gz
dotemacs-67a609dd5e98df4df9a3fb40104817e0c25e5582.zip
feat(theme-studio): screenshot harness + ecosystem coverage policy
Two speedrun-enabling pieces. A #preview=<app>&theme=<json> hash handler plus screenshot-previews.sh shoot any app's face table and live preview headlessly under a real theme (WIP.json by default), so preview work can be verified without a human clicking through the studio. The README gains the coverage policy: the studio themes popular packages even when uninstalled, pinning their faces rather than dropping them, and unloaded packages' previews matter more, not less.
Diffstat (limited to 'scripts/theme-studio/theme-studio.html')
-rw-r--r--scripts/theme-studio/theme-studio.html23
1 files changed, 23 insertions, 0 deletions
diff --git a/scripts/theme-studio/theme-studio.html b/scripts/theme-studio/theme-studio.html
index 8cb6cc02..8e219fcd 100644
--- a/scripts/theme-studio/theme-studio.html
+++ b/scripts/theme-studio/theme-studio.html
@@ -3499,6 +3499,29 @@ function initApp(){
}
initApp();
addEventListener('resize',()=>{syncPaneHeight('uitable','mockframe');syncPaneHeight('pkgtable','pkgpreview');});
+// #preview=<app-key>[&theme=<json-url>]: select that app on load and hide the
+// topbar + palette so its face table + live preview render from the top of the
+// page (headless screenshots can't scroll reliably). An optional theme URL is
+// fetched and imported first, so shots show a real theme instead of untitled
+// (fresh headless profiles have no localStorage; Chrome needs
+// --allow-file-access-from-files for a file:// fetch). Drives the screenshot
+// harness (screenshot-previews.sh), same hash-URL pattern as the browser gates.
+// The title flip lets the harness confirm the selection landed.
+if(location.hash.startsWith('#preview=')){
+ const q=location.hash.slice(9).split('&theme=');
+ const k=decodeURIComponent(q[0]);
+ const showApp=()=>{
+ if(!APPS[k])return;
+ const s=document.getElementById('viewsel');
+ if(!s)return;
+ s.value=k;onViewChange();document.title='PREVIEW '+k;
+ document.querySelectorAll('.topbar, body > section')
+ .forEach(e=>{e.style.display='none';});};
+ if(q[1])fetch(decodeURIComponent(q[1])).then(r=>r.text())
+ .then(t=>{applyImported(t);showApp();})
+ .catch(()=>{document.title='PREVIEW THEME-LOAD-FAILED';showApp();});
+ else showApp();
+}
// Shared gate harness. Each call site keeps its literal location.hash==='#NAMEtest'
// check (run-tests.sh greps it); gate() owns the ok/notes/A setup and the verdict
// postamble. Note format standardized to ' fails=note1,note2'.