From 5be1a8058ac760b25889cc291bbca6af5e093b2a Mon Sep 17 00:00:00 2001 From: Craig Jennings Date: Tue, 9 Jun 2026 04:45:18 -0500 Subject: chore(todo): stage the theme-studio generate.py extraction refactor --- todo.org | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/todo.org b/todo.org index 0460819d..fdbc04f0 100644 --- a/todo.org +++ b/todo.org @@ -176,6 +176,24 @@ Phase 1. Palette anchors + OKLCH shade generation (reusing colormath.js), the RO Phase 2. Initial state from seed() plus seedPkgmap for the non-org packages; all-tier reseed button with a scope-named overwrite warning, resetting non-org to their APPS defaults; regenerate dupre-revised.json. Gate: #selftest PASS; default-on-open equals seed(); artifact round-trip (regenerated dupre-revised.json imports back to the same seeded state); Chrome eyeball. *** TODO Seeding-engine test surface :solo:tests: Keep #seedtest, #selftest, the default-on-open check, the dupre-revised round-trip, node --check, and Chrome validation green. +** TODO [#B] theme-studio refactor — extract app from generate.py :feature:theme-studio:refactor: +Examined 2026-06-09. generate.py is 1378 lines, ~1300 of them a single triple-quoted string holding the whole app (CSS + HTML + ~1000+ lines of JS). That string is the root of every refactor here: the app logic can't be unit-tested (only =colormath.js= is, because it is the one extracted module); backslash-doubling in the string caused real bugs this session (the multi-line export strip, the =#deltatest= regex); and there is no lint, highlight, or brace-check until Chrome runs it. The rest of the directory is healthy: =colormath.js= (pure, 100/96 tested) and =build-theme.el= (13 small functions) are the model. + +Run the whole set in NO-APPROVALS mode: TDD per stage (characterization hash tests before each behavior-preserving move; node unit tests as extraction makes logic importable), commit + push at each green stage. Tooling committed at c7518d6f before starting. Order: +*** TODO Stage 1 — characterization net + extract CSS and JS to files :solo:tests: +First add hash tests pinning the behaviors the move must preserve: =#locktest= (locking a row disables its dropdown; clear-unlocked resets unlocked + skips locked, per tier) plus any gap the existing gates miss. Then move the =