aboutsummaryrefslogtreecommitdiff
path: root/scripts/theme-studio/app.js
diff options
context:
space:
mode:
authorCraig Jennings <c@cjennings.net>2026-06-16 05:10:38 -0500
committerCraig Jennings <c@cjennings.net>2026-06-16 05:10:38 -0500
commitafd2ddad818cdbf9f4b77d43efb91c35b6c57946 (patch)
tree970b50e89b274aa9d26f46e83d5b77bb55ac2ef4 /scripts/theme-studio/app.js
parent1208d96a10e7982650bf1a1118018b5ba471cc60 (diff)
downloaddotemacs-afd2ddad818cdbf9f4b77d43efb91c35b6c57946.tar.gz
dotemacs-afd2ddad818cdbf9f4b77d43efb91c35b6c57946.zip
feat(theme-studio): alphabetize packages in the assignment dropdown
The assignment-view dropdown listed package faces in APPS build order (bespoke apps first, then inventory). generate.py builds them that way, so the list wasn't alphabetical. I added a pure appViewKeysSorted helper that orders the app keys by display label, and buildViewSel uses it. The @code and @ui editor entries above the divider are unchanged.
Diffstat (limited to 'scripts/theme-studio/app.js')
-rw-r--r--scripts/theme-studio/app.js6
1 files changed, 3 insertions, 3 deletions
diff --git a/scripts/theme-studio/app.js b/scripts/theme-studio/app.js
index a4e0da9c1..3ebd37587 100644
--- a/scripts/theme-studio/app.js
+++ b/scripts/theme-studio/app.js
@@ -519,14 +519,14 @@ function curApp(){const s=document.getElementById('viewsel');const v=s&&s.value;
function pkgEffFg(app,face,seen){return effResolve(PKGMAP,app,face,'fg',seen);}
function pkgEffBg(app,face,seen){return effResolve(PKGMAP,app,face,'bg',seen);}
// One dropdown drives the whole assignment panel: two editor entries (@code,
-// @ui) then a non-selectable "package faces" optgroup holding every app, in
-// APPS order. onViewChange shows exactly one of the three view blocks.
+// @ui) then a non-selectable "package faces" optgroup holding every app,
+// alphabetically by label. onViewChange shows exactly one of the three view blocks.
function buildViewSel(){const s=document.getElementById('viewsel');if(!s)return;s.innerHTML='';
const mk=(v,t)=>{const o=document.createElement('option');o.value=v;o.textContent=t;return o;};
s.appendChild(mk('@code','color/code assignments'));
s.appendChild(mk('@ui','ui faces'));
const og=document.createElement('optgroup');og.label='package faces';
- for(const app in APPS)og.appendChild(mk(app,APPS[app].label));
+ for(const app of appViewKeysSorted(APPS))og.appendChild(mk(app,APPS[app].label));
s.appendChild(og);}
function onViewChange(){const s=document.getElementById('viewsel');const v=(s&&s.value)||'@code';
const show=(id,on)=>{const e=document.getElementById(id);if(e)e.style.display=on?'':'none';};