aboutsummaryrefslogtreecommitdiff
path: root/scripts/theme-studio/browser-gates.js
Commit message (Collapse)AuthorAgeFilesLines
* refactor(theme-studio): polish the expander (underline inside, dynamic ↵Craig Jennings37 hours1-5/+15
| | | | | | | | | | | | | | colspan, nd flag) Three cleanups to the per-row expander from 3B-2. The underline control moves from the in-row style cell into the expander, next to overline. The row keeps weight, slant, and strike inline, so the style cell drops from three wrapped rows to two and the table reads flatter. mkExpander no longer hardcodes each table's colspan. tableColCount reads the column count from the table's header, so a detail row spans correctly even if a column is added later. A collapsed expander now flags itself when it hides an attribute that differs from the face's default, so a non-default value is never invisible. overflowNonDefault (app-core.js, unit-tested) compares the expander's attributes against the default. The toggle re-checks after every edit and gets the gold marker when any differ. faceBoxNonDefaults drops underline from the in-row style box in the same move, since underline is now the expander's concern. The #expandtest gate covers the underline control in its new home, its wavy write, and the flag appearing then clearing. Full suite green: Python 59, Node 201, ERT 41, plus the browser hash gates.
* feat(theme-studio): add a per-row expander for the overflow face attributesCraig Jennings37 hours1-2/+33
| | | | | | | | | | Each row in the syntax, UI, and package tables gets a "more" toggle that reveals a detail row beneath it, holding the attributes that don't fit a column: distant-fg, family, overline, inverse, and extend. The syntax and UI tables also get inherit and height there, since they have no inline column for those. Packages already do, so their expander leaves them out. One mkDetailEditor builds the editor and one mkExpander wires the toggle plus the hidden detail row, both shared across the three tables. The detail controls join the row's lock cell, so locking a row disables them too. Detail rows ride along when a table is sorted: applyTableSort now sorts only the main rows and re-attaches each detail row right after its parent (matched by data-detail-for), so a sort never separates the pair. The new #expandtest browser gate covers the toggle, the field set, the model writes, and the package expander dropping inherit/height. This is the last editor piece for the face-attribute work. Every attribute the model and emitter support is now reachable from the UI. Full suite green: Python 59, Node 198, ERT 41, plus the browser hash gates.
* feat(theme-studio): replace the style toggles with ↵Craig Jennings40 hours1-14/+20
| | | | | | | | | | | | 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.
* refactor(theme-studio): cut the face model over to weight/slant/objectsCraig Jennings40 hours1-32/+32
| | | | | | | | | | 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.
* fix(theme-studio): open the palette collapsed to base colorsCraig Jennings4 days1-0/+11
| | | | The studio opened with every column's span tints expanded, so the first view was crowded with colors the user hadn't asked to see. I set paletteShowFull to false in initApp, so the palette opens showing one tile per column and the existing arrow control expands the spans. The flip lives in the boot path rather than the module default, so the palette gates keep their full-palette baseline. The two that assert span tiles (#counttest, #paltoggletest) now opt into full mode explicitly. A new #paldefaulttest gate asserts the opening collapsed state.
* fix(theme-studio): make the color picker stand out from the pageCraig Jennings4 days1-0/+15
| | | | The picker panel's background (#161412) sat a few shades off the page background (#0d0b0a), so it was hard to tell apart from the page. I gave it the studio's gold accent border (#e8bd30) and lifted the background to #1f1c19, both already used in the toolbar chrome, so the panel reads as a distinct surface. The #pickertest gate asserts the accent border and a per-channel background lift of at least 12 over the page, so the distinction can't quietly regress.
* feat(theme-studio): add gnus as a view packageCraig Jennings4 days1-0/+15
| | | | mu4e renders the open message with gnus, so the article-view headers, quote levels, signature, and inline emphasis are all gnus faces, not mu4e ones. gnus ships them as bright greens on a dark background, and the theme had no way to reach them. I added gnus as a bespoke view package: the article-view face set in face_data.py with palette seeds that mirror the mu4e header treatment, a realistic preview (header block, emphasized body, an 11-level quoted reply chain, signature), and a #gnustest gate that asserts every emitted face is a real gnus face. Theming and exporting gnus in the studio retires the green in the live view.
* fix(theme-studio): redesign the mu4e preview as a realistic headers listCraig Jennings4 days1-0/+13
| | | | The old mu4e preview was cramped and referenced faces that aren't in the mu4e inventory (mu4e-moved-face, mu4e-attach-number-face, mu4e-cited-1..7, mu4e-compose-header-face), so those rendered unthemed. I rebuilt it as a realistic mu4e screen: a status bar, a column header, and one row per message state (unread, replied, flagged, forwarded, draft, trashed, related) with the current line on the highlight background, then a compact message view and the compose separator. It now exercises all 27 mu4e inventory faces and only those. The new #mupreviewtest gate asserts every data-face is a real mu4e face.
* feat(theme-studio): realistic README preview for markdown-modeCraig Jennings4 days1-0/+17
| | | | markdown-mode fell back to the generic preview (bare face names). I added renderMarkdownPreview, a realistic README that exercises the markdown faces in context: front matter, headers, bold/italic, inline and fenced code, links, lists and checkboxes, a blockquote with a footnote, a table, strikethrough, highlight, math, and inline HTML. A PREVIEW_KEYS map in app_inventory routes markdown-mode to the renderer, and the #mdtest gate checks every data-face it emits is a real markdown face.
* feat(theme-studio): prev/next arrows to step the view dropdownCraig Jennings4 days1-0/+18
| | | | I added left and right arrow buttons flanking the view dropdown. They step the selection to the previous or next item and re-render the faces table and preview, so you can walk the list without reopening the dropdown. A pure stepViewIndex helper clamps the index to the option range, no wrap. stepView sets the selection and calls onViewChange.
* feat(theme-studio): move the contrast verdict into a hoverCraig Jennings4 days1-0/+11
| | | | The contrast column showed "5.4 PASS". The number's color already encodes the tier (green AAA, grey AA, red fail), so the PASS/FAIL word was redundant. I dropped it and put the WCAG meaning in the cell's hover via a pure contrastTitle helper. crHtml now renders just the colored number. verdictFor stays for the covered-overlay worst-case readout, which is unchanged.
* feat(theme-studio): mark per-face setting boxes that differ from defaultCraig Jennings4 days1-0/+21
| | | | A non-default height looks identical to the default in the size input, so a stray 1.1 hides in plain sight. I added a small gold corner flag on any per-face setting cell (fg, bg, style, inherit, size, box) whose value differs from the face's seed default. A pure faceBoxNonDefaults helper computes the per-box flags. buildPkgTable resolves fg/bg to hex before comparing, so a palette-name-vs-hex difference doesn't read as a change.
* feat(theme-studio): alphabetize packages in the assignment dropdownCraig Jennings4 days1-3/+3
| | | | The assignment-view dropdown listed package faces in APPS build order (bespoke apps first, then inventory). generate.py builds them that way, so the list wasn't alphabetical. I added a pure appViewKeysSorted helper that orders the app keys by display label, and buildViewSel uses it. The @code and @ui editor entries above the divider are unchanged.
* refactor(theme-studio): drop the too-similar-colors warning boxCraig Jennings5 days1-11/+0
| | | | The warning box under the palette wasn't useful there; the same ΔE info is reachable per-chip via the nearest-ΔE tooltip and inline contrast. Remove renderPaletteWarnings, the #palwarn element, its CSS, and the #deltatest gate. paletteWarnings still runs for the per-chip nearest distance.
* refactor(theme-studio): extract a groundPair() helperCraig Jennings5 days1-10/+10
| | | | The literal {bg:MAP['bg'],fg:MAP['p']} repeated 32 times across app.js, palette-actions.js, and the browser gates. Replace it with a groundPair() helper. Named groundPair, not ground, to avoid colliding with the local ground bindings destructured from columnsFromPalette. No behavior change; node tests and browser gates are the safety net.
* feat(theme-studio): 2D gallery color picker for the assignment dropdownsCraig Jennings5 days1-3/+34
| | | | | | | | | | - The color dropdown opens a grid, not a long list. - The grid mirrors the palette: ground strip, then a row per family. - Members run dark to light, with the current color outlined. - A default chip clears the assignment. - A (gone) cell shows a color no longer in the palette. - The trigger and step buttons stay the same. - All three tiers share the one dropdown.
* feat(theme-studio): show view-area > element usages on palette tile hoverCraig Jennings5 days1-0/+16
| | | | I added paletteUsages, which enumerates every place a color is assigned, grouped by view area (the view dropdown's names: color/code assignments, ui faces, each package app) and the element within it. renderPalette builds the per-area scopes once and appends the list to each used tile's hover title, under the existing name/hex/nearest-deltaE line. Node tests and a #usagetest gate cover it.
* feat(theme-studio): flag gone color assignments with a borderCraig Jennings5 days1-0/+17
| | | | An assignment pointing at a color no longer in the palette showed only as "(gone)" on hover. I added a distinct solid border to the swatch whenever its current value resolves to "(gone)", so a broken assignment reads at a glance. The solid red outline is set apart from the dashed unused-tile flag, keeping the two palette-state cues distinguishable. A #gonetest gate covers the flagged and unflagged cases.
* feat(theme-studio): flag unused palette tiles and columnsCraig Jennings5 days1-0/+21
| | | | | | I added usedPaletteHexes, a reverse lookup over the syntax, ui, and package assignments (plus the ground endpoints) that resolves each reference to a hex. renderPalette outlines a tile whose color is referenced nowhere and outlines a whole column when none of its colors are used, so dead colors stand out for pruning before a theme ships. The check is biased safe: an unresolvable reference marks nothing, so a color that is actually used is never flagged. Node tests cover the lookup. A #unusedtest gate covers the tile and column flags.
* feat(theme-studio): add a palette display toggle for base colors vs full spansCraig Jennings5 days1-0/+20
| | | | I added an arrow control to the palette that collapses every column to its base color (right arrow) or expands to the full spans (down arrow), to conserve vertical space. Ground steps collapse too, leaving bg and fg. A #paltoggletest gate covers the collapse and the expand.
* fix(theme-studio): clamp generated palette spans to the bg/fg boundsCraig Jennings5 days1-6/+9
| | | | | | Spanning a color generated steps toward pure black and white, so a column could produce colors darker than bg or lighter than fg. I changed regenColumn to ramp the dark side toward the darker ground endpoint and the light side toward the lighter one, bounded by bg and fg. Pure black/white duplicates are still skipped, and callers that pass no ground fall back to the old black/white ramp. Node tests cover the bounded span and the no-ground fallback. The #counttest gate asserts the regenerated column stays within the bg/fg bounds.
* refactor(theme-studio): drop dead bindings and CSS left by the cluster workCraig Jennings5 days1-2/+2
|
* feat(theme-studio): reflow the B/I/U/S style buttons into a 2x2 clusterCraig Jennings5 days1-0/+10
| | | | | | The four style buttons sat in a horizontal row, the widest part of the style column. I wrapped them in the same 2x2 grid the box control uses, so they form a square (still multi-toggle, since bold and italic combine). The column narrows to roughly half its width across all three tiers. A #styletest gate confirms the four buttons live in a .stylecluster.
* feat(theme-studio): compact the box control into a 2x2 button clusterCraig Jennings5 days1-2/+23
| | | | | | | | The box control was a wide select plus a color swatch, pinning the box column at 166px. I replaced the select with a 2x2 cluster of radio buttons for the four styles: blank (no box), □ (line), ▼ (pressed), ▲ (raised). The color swatch now shows only while a box style is active, so the no-box case stays narrow. The column drops to 76px across all three tiers. A #boxtest gate covers the cluster: four buttons, radio selection, and the swatch hiding when no box is set. #beveltest now drives the style through the cluster button instead of the removed select. The same cluster shape sets up the B/I/U/S style column next.
* refactor(theme-studio): drop the per-row reset column from package facesCraig Jennings5 days1-0/+1
| | | | | | Package faces was the only tier with a per-row reset button, in its own column. The syntax and ui tiers rely on the bulk reset alone, and the column cost horizontal space the table needs. I removed the per-row cell and its header, so the bulk reset (next to "lock all") is the single reset path now, matching the other tiers. A #viewtest assertion confirms the package rows carry no per-row reset button. The two weren't equivalent: the per-row button reset one face to its default, the bulk reset clears every unlocked face in the app. Losing single-face reset is the accepted tradeoff.
* refactor(theme-studio): collapse assignment views into one dropdown panelCraig Jennings5 days1-0/+25
| | | | | | The assignment area was three stacked sections (color/code, ui faces, package faces), and package faces carried its own application selector. I merged them into one panel driven by a single dropdown: color/code assignments, ui faces, then a non-selectable "package faces" optgroup holding every app in order. Picking an entry swaps the left table and right preview, so only one view shows at a time. curApp now reads the selected app from that dropdown, and the old appsel is gone. A #viewtest browser gate locks in the dropdown order, the optgroup, and the one-view-at-a-time switching.
* chore(theme-studio): remove dead code and clear a type warningCraig Jennings6 days1-1/+1
| | | | | | | | | - ramp (app-core.js) and its test-ramp.mjs: superseded by regenColumn, no production caller. - optList (app-core.js) and its tests: superseded by paletteOptionList. - ITALIC in generate.py: computed, never read (ITALIC_MAP is the live one). - a stray empty string in MU4E_FACES that .split() silently dropped. - the dead #familytest alias in the columntest gate, which HASHES never listed. - widen face_rows to Sequence[str], clearing the list-invariance warnings on the APPS calls.
* fix(theme-studio): make broken browser gates fail instead of silently passingCraig Jennings6 days1-4/+8
| | | | | | run-tests.sh scored each browser gate by grepping the dumped DOM for the gate name and taking the first match. A gate that throws before setting its verdict left its own inlined source as the first match, and that source, "GATENAME '+(ok?'PASS':'FAIL')", contains the literal PASS, so the run reported green for a gate that never produced a verdict. The matcher now requires a resolved "GATENAME PASS" or "GATENAME FAIL". That exposed two gates that had been throwing unnoticed. baseedittest still referenced fam after the variable was renamed to column, so it ReferenceError'd. columntest read getComputedStyle on a palette chip captured before a re-render detached it, so the match returned null and threw. baseedittest now uses column, and columntest re-queries the live chip by its selection index.
* feat(theme-studio): auto-dim split previewCraig Jennings6 days1-0/+19
| | | | | | | | auto-dim-other-buffers is a package face, not a theme face, so build-inventory.el (it scans only elpa/straight packages) never listed it and the studio couldn't theme it. This adds it as a bespoke app. The preview is a vertical split: the focused window on the left in real syntax colors, the same code on the right collapsed to the single auto-dim-other-buffers face, the way Emacs renders a non-selected window. Both panes follow the language selector. A trailing row shows auto-dim-other-buffers-hide, whose foreground matches the background so it vanishes when dimmed. A #autodimtest gate covers the split, the uniform recolor, and language sync.
* feat(theme-studio): palette generator and preview fidelityCraig Jennings6 days1-3/+87
| | | | | | | | | | Two strands land together because the generated theme-studio.html bundles every source file into one page and can't be split cleanly. The palette generator is a preview-first panel: palette-generator-core.js plans the palette and palette-generator-ui.js draws it. Generated colors stay inspectable and tunable through the existing selector, and committing one creates a normal base column. It adds source-mode and scheme controls, a configurable accent count, and color names from color-names.json. For preview fidelity, syntax and UI colors now resolve through the real Emacs inherit chains, so the preview matches how Emacs renders the theme. resolveSyntaxFg pins dec to ty (Emacs has no decorator face) and otherwise follows comment-delimiter to comment, doc to string, property to variable, function-call to function-name. resolveUiAttr walks mode-line-inactive to mode-line and line-number-current-line to line-number. The decorator label now reads "decorator to type" to match the type face Emacs uses for it. Design recorded in the two theme-studio specs under docs/.
* Update theme studio palette workflowCraig Jennings7 days1-33/+60
|
* Add theme studio box color controlsCraig Jennings7 days1-2/+14
|
* Shorten theme studio reset erase labelsCraig Jennings7 days1-1/+1
|
* Clarify theme studio reset and erase actionsCraig Jennings7 days1-7/+17
|
* Add theme studio face color step arrowsCraig Jennings7 days1-8/+18
|
* Preview selected theme studio chip while pickingCraig Jennings7 days1-0/+5
|
* Change theme studio spans to endpoint divisionsCraig Jennings7 days1-1/+3
|
* Fix theme studio span endpoint tilesCraig Jennings7 days1-4/+10
|
* Fix theme studio ground endpoint editCraig Jennings7 days1-0/+10
|
* Fix theme studio fg endpoint selectionCraig Jennings7 days1-2/+9
|
* Refine theme studio tile name editingCraig Jennings7 days1-0/+9
|
* Make theme studio column delete saferCraig Jennings7 days1-1/+7
|
* Add theme studio column deleteCraig Jennings7 days1-0/+12
|
* Refactor theme studio palette testsCraig Jennings7 days1-0/+428