From d6b10d04b4d3f5a74bdb6beb001824b97fc98969 Mon Sep 17 00:00:00 2001 From: Craig Jennings Date: Wed, 24 Jun 2026 19:17:23 -0400 Subject: refactor(theme-studio): extract control factories to controls.js, drop dead previewFaceAttrs I split the custom dropdown, detail-editor, and expander factories out of app.js into controls.js (205 lines), spliced back at a CONTROLS_J token by generate.py. The token sits at the exact extraction point, so the assembled page is byte-identical and every gate passes unchanged. app.js drops from 927 to 721 lines. I also removed previewFaceAttrs (function, export, and test). It was test-only dead code whose docstring stalely claimed the gate calls it. The gate uses assertPreviewFaces instead. --- scripts/theme-studio/test-locate.mjs | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) (limited to 'scripts/theme-studio/test-locate.mjs') diff --git a/scripts/theme-studio/test-locate.mjs b/scripts/theme-studio/test-locate.mjs index 5e36aa808..09d15b8bc 100644 --- a/scripts/theme-studio/test-locate.mjs +++ b/scripts/theme-studio/test-locate.mjs @@ -8,7 +8,7 @@ import { test } from 'node:test'; import assert from 'node:assert/strict'; import { - buildLocateRegistry, locateFaceMeta, formatLocateTitle, previewFaceAttrs, isLocateOnPane, + buildLocateRegistry, locateFaceMeta, formatLocateTitle, isLocateOnPane, } from './app-core.js'; // A constructed model: two package apps that BOTH own a face literally named @@ -142,15 +142,6 @@ test('formatLocateTitle: Error — an unassigned meta reads "unassigned"', () => assert.equal(formatLocateTitle(locateFaceMeta('org-faces', 'ghost', reg)), 'ghost, unassigned'); }); -// --- previewFaceAttrs: owner-aware validation ------------------------------- - -test('previewFaceAttrs: Normal — a known owner/face validates; a bad owner is rejected', () => { - const reg = buildLocateRegistry(APPS, PKGMAP, UIMAP, MAP); - assert.ok(previewFaceAttrs('org-faces', 'org-todo', reg), 'known face validates'); - assert.equal(previewFaceAttrs('org-mode', 'minibuffer-prompt', reg), null, 'a UI face under a package owner is rejected'); - assert.equal(previewFaceAttrs('nope', 'org-todo', reg), null, 'an unknown owner is rejected'); -}); - // --- lifecycle + perf ------------------------------------------------------- test('buildLocateRegistry: lifecycle — a rebuild after an edit reflects the new value', () => { -- cgit v1.2.3