From 8c032ca51e9cb8bca87b97cd778596a1abe75b8b Mon Sep 17 00:00:00 2001 From: Craig Jennings Date: Thu, 18 Jun 2026 22:17:55 -0500 Subject: feat(theme-studio): replace the style toggles with weight/slant/underline/strike controls The B/I/U/S toggle buttons in the syntax, UI, and package tables become a weight selector (light/normal/medium/semibold/bold/heavy), a slant selector (normal/italic/oblique), and box-like underline and strike controls. The underline control sets line or wave plus a color, and the strike control sets a color. A face can now reach the full weight range and a wavy or colored underline, not just bold and italic on-off. All four controls come from one mkStyleControls helper shared across the three tables, and underline and strike share mkLineStyleControl (the box-control pattern, parameterized for a styled line vs a plain toggle). With the real controls in place I dropped the transitional legacyStyleOn/toggleLegacyStyle shim and its tests. The overflow attributes (distant-fg, family, overline, inverse, extend, and inherit/height for ui and syntax) move into a per-row expander next. Verified by screenshot and the browser style gate, which now drives a weight-select change and an underline-wave click through the model. Full suite green: Python 59, Node 198, ERT 41, plus the browser hash gates. --- scripts/theme-studio/test-app-core.mjs | 17 +---------------- 1 file changed, 1 insertion(+), 16 deletions(-) (limited to 'scripts/theme-studio/test-app-core.mjs') diff --git a/scripts/theme-studio/test-app-core.mjs b/scripts/theme-studio/test-app-core.mjs index b39eb44d3..d5f015d93 100644 --- a/scripts/theme-studio/test-app-core.mjs +++ b/scripts/theme-studio/test-app-core.mjs @@ -7,7 +7,7 @@ import assert from 'node:assert/strict'; import { readFileSync } from 'node:fs'; import { fileURLToPath } from 'node:url'; import { - nameToHex, migrateLegacyFace, legacyStyleOn, toggleLegacyStyle, normalizePkgFace, buildPkgmap, packagesForExport, mergePackagesInto, effResolve, resolveSyntaxFg, resolveUiAttr, dropdownRowTextColor, paletteOptionList, spanNeighborHex, slugify, + nameToHex, migrateLegacyFace, normalizePkgFace, buildPkgmap, packagesForExport, mergePackagesInto, effResolve, resolveSyntaxFg, resolveUiAttr, dropdownRowTextColor, paletteOptionList, spanNeighborHex, slugify, clearPalettePlan, deletePaletteColumnPlan, groundColumnMembersFromPalette, areAllLocked, lockToggleLabel, toggleLockSet, galleryModel, appViewKeysSorted, faceBoxNonDefaults, stepViewIndex, } from './app-core.js'; @@ -662,21 +662,6 @@ test('migrateLegacyFace: Boundary — a new-shape face passes through unchanged assert.deepEqual(migrateLegacyFace(migrateLegacyFace(f)), f); }); -test('legacyStyleOn / toggleLegacyStyle: Normal — bridge the B/I/U/S buttons to the model', () => { - const f = { weight: null, slant: null, underline: null, strike: null }; - assert.equal(legacyStyleOn(f, 'bold'), false); - toggleLegacyStyle(f, 'bold'); assert.equal(f.weight, 'bold'); assert.equal(legacyStyleOn(f, 'bold'), true); - toggleLegacyStyle(f, 'bold'); assert.equal(f.weight, null); - toggleLegacyStyle(f, 'italic'); assert.equal(f.slant, 'italic'); - toggleLegacyStyle(f, 'underline'); assert.deepEqual(f.underline, { style: 'line', color: null }); - toggleLegacyStyle(f, 'underline'); assert.equal(f.underline, null); - toggleLegacyStyle(f, 'strike'); assert.deepEqual(f.strike, { color: null }); -}); - -test('legacyStyleOn: Boundary — a non-bold weight reads the bold button as off', () => { - assert.equal(legacyStyleOn({ weight: 'semibold' }, 'bold'), false); -}); - test('normalizePkgFace: Normal — carries the additive attribute model', () => { const f = normalizePkgFace({ fg: 'blue', 'distant-fg': '#222222', family: 'Iosevka', -- cgit v1.2.3