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/controls.js | 209 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 209 insertions(+) create mode 100644 scripts/theme-studio/controls.js (limited to 'scripts/theme-studio/controls.js') diff --git a/scripts/theme-studio/controls.js b/scripts/theme-studio/controls.js new file mode 100644 index 000000000..e98a69a5c --- /dev/null +++ b/scripts/theme-studio/controls.js @@ -0,0 +1,209 @@ +// controls.js -- the custom dropdown / detail-editor / expander control +// factories, extracted from app.js for navigability. Inlined raw at the +// CONTROLS_J token: these are hoisting function declarations plus the +// dropdown popup state, so the token's position preserves execution order. +// Custom color dropdown: a real swatch + name + hex per row, since native +//