aboutsummaryrefslogtreecommitdiff
path: root/scripts/theme-studio/default_faces.py
Commit message (Collapse)AuthorAgeFilesLines
* refactor(theme-studio): derive the Python face model from one spec listCraig Jennings24 hours1-40/+39
| | | | STYLE_DEFAULTS, default_faces.seed, and capture-default-faces' ATTRS each hand-listed the face attributes, so adding one meant editing three places in step. face_specs.FACE_ATTRS is now one row per attribute carrying the model key, default, capture keyword, snapshot field, and seed transform kind. STYLE_DEFAULTS derives from it (same keys, order, and values), seed iterates it applying the per-kind extraction, and the capture probe map derives its emacs-attr to snapshot-field pairs from it. The snapshot-to-model translation stays genuinely per-attribute (colors prefer the Hex variant, flags become objects, weight/slant are value-narrowed), but the attribute list itself is now single-sourced. Verified byte-identical: STYLE_DEFAULTS and ATTRS match the old literals, the generated page is unchanged, and the suite is green. app-core.js mirrors this list by hand since the page is a separate runtime.
* feat(theme-studio): seed faces with their default distant-fg, overline, ↵Craig Jennings33 hours1-0/+14
| | | | | | | | | | inverse, and extend The studio now pre-fills the additive attributes a face carries in stock Emacs, so it opens closer to reality. default_faces.seed reads distant-foreground, overline, inverse-video, and extend from the captured snapshot, the same way it already reads weight, slant, underline, and strike. lazy-highlight, for example, opens with its black distant-foreground instead of blank, and the faces that extend to the window edge open with that flag set. The capture script gains overline in its attribute map and probe, so the next snapshot refresh records it too. I didn't re-run the capture here. distant-fg, inverse-video, and extend are already in the committed snapshot, so reading them seeds every face that has them, and stock faces almost never set overline. A fresh capture (python3 scripts/theme-studio/capture-default-faces.py) is a larger, separate refresh, since the new probe field touches all 687 face blocks. Imported presets are unaffected, since they carry their own face data and never re-read the snapshot. Only a fresh studio session sees the richer seeds. Full suite green: Python 61, Node 201, ERT 41, plus the browser hash gates.
* refactor(theme-studio): cut the face model over to weight/slant/objectsCraig Jennings36 hours1-4/+9
| | | | | | | | | | I replaced the legacy bold/italic/underline/strike booleans with the final model shape across both sides of the tool. weight (light/normal/medium/semibold/bold/heavy) and slant (normal/italic/oblique) replace the bold/italic flags, underline becomes {style: line|wave, color}, strike becomes {color}, and null means unset. A single migration converts a legacy face on the way in, mirrored as migrateLegacyFace in app-core.js and migrate_legacy in face_specs.py so the JS and Python models can't drift. It runs on import (applyImported, mergePackagesInto) and on every seed that face_spec touches. The captured-snapshot seed (default_faces.seed) narrows the same way it did before. Only bold and italic survive, as weight "bold" and slant "italic", so the generated themes stay byte-identical. The B/I/U/S toggle buttons keep working through a transitional bridge (legacyStyleOn / toggleLegacyStyle). The weight/slant dropdowns and underline/strike controls that replace them land next. The live previews read the new shape, with a weight name mapped to a numeric CSS font-weight. The cutover is proven emit-neutral two ways. An ERT test asserts the migrated shapes emit the same attributes as the legacy booleans, and deep-migrating every face in dupre, distinguished, sterling, now, theme, and WIP then running build-theme yields byte-identical output. Full suite green: Python 59, Node 200, ERT 41, plus the browser hash gates.
* Add theme studio default face drift summaryCraig Jennings7 days1-0/+32
|
* Extract theme studio default face adapterCraig Jennings7 days1-0/+128