aboutsummaryrefslogtreecommitdiff
path: root/scripts/theme-studio/previews.js
Commit message (Collapse)AuthorAgeFilesLines
* feat(theme-studio): expose EAT terminal faces with a previewCraig Jennings8 hours1-0/+12
| | | | Add EAT as a theme-studio app so its faces become editable in the studio: the 16 named ANSI palette faces, the SGR attribute faces (bold, faint, italic, slow/fast blink), and the three shell-prompt annotation faces. renderEatPreview draws a sample terminal with the palette rows, colored ls output, and the prompt annotations, so editing a face updates the preview live. No seed colors are set, so the faces sit at their own defaults until themed, consistent with the vanilla pass. Mirrors the existing ghostel terminal app.
* feat(theme-studio): bind dashboard preview list items to dashboard-items-faceCraig Jennings11 hours1-11/+11
| | | | The dashboard preview rendered the project/bookmark/recent rows as plain text, so editing dashboard-items-face didn't recolor them. Wrap those rows in dashboard-items-face so the preview reflects the face. It inherits widget-button (unspecified) while unset, so the rows stay bare until the face is themed -- this only makes the preview responsive. Completes the dashboard preview's face coverage.
* feat(theme-studio): nerd-icons gallery as a hue-ordered icon gridCraig Jennings32 hours1-11/+28
| | | | | | | | | | The nerd-icons pane is now a grid: one row per color face, the rows ordered by hue so families cluster, distinct icons (deduped within a color) drawn in their color with the icon's nerd-font name beneath. A "preview:" dropdown above the grid picks the glyph size in points, with Left/Right arrows to step it. Single-pane apps show it disabled, naming the preview. This replaces the v1 legend in the pane, whose data is still captured for round-trip. build-nerd-icons-legend.el is now a library. A cj/nerd-icons-write-legend entry point requires nerd-icons only at write time, so the capture logic loads and unit-tests without it. It dedupes icons by name within a face, computes each face's native hue, and orders the groups by hue. Writing the test surfaced a latent bug: face-hsl used (cadr (assoc t spec)), which grabs the first keyword instead of the plist. It only worked because the real faces fall through to the face-foreground branch. I fixed it to a correct t-clause parse. Coverage: 7 ERT capture tests (dedupe, hue order, lightness tiebreak, name sort, skip rules), 4 Python validator edges, and browser gates for the grid and the size dropdown. Locate stays color-level: clicking a color flashes its icons, and clicking an icon flashes its color row. Icons aren't individually editable, so there's nothing per-icon to select.
* fix(theme-studio): render nerd-icon glyphs in previews instead of tofuCraig Jennings35 hours1-5/+22
| | | | | | | | The legend, dashboard, and package previews drew nerd-icon glyphs as empty boxes. The font-family never reached them: PREVIEW_FONT was spliced into inline style="..." attributes with a double-quoted family name, so the inner quote closed the attribute early and the font was silently dropped. Dropping the quotes fixes it. A no-space family name needs none. I embedded the glyph font directly: Symbols Nerd Font Mono, encoded with fontTools (woff2_compress output is rejected by headed Chrome and Firefox), inlined as a data: URI under the unique family name ThemeStudioNerd so it resolves to the embed rather than a system-installed copy of the same name. The page is self-contained and renders on any clone. I added a #fonttest gate that parses previewLines output and asserts the resolved font-family plus glyph coverage, plus a make font target that re-encodes the woff2 with fontTools.
* feat(theme-studio): bespoke nerd-icons filetype-legend preview (phase 2)Craig Jennings43 hours1-0/+11
| | | | | | Register nerd-icons as a bespoke app whenever its captured legend is valid: the 34 color faces stay editable rows, and the legend rides APPS['nerd-icons'].legend. A new renderNerdIconsPreview draws each curated filetype's glyph in its mapped face's effective color, read through the same registry the other previews use, so recoloring a face repaints every row mapped to it. When the legend is absent the generic inventory app stands in. The #nerdiconstest browser gate covers the wiring, the dir-row owner, and the recolor-repaint. Claude-Session: https://claude.ai/code/session_01BqrdWUo9GcznYX2pZr76gZ
* feat(theme-studio): locate preview elements by hover and clickCraig Jennings2 days1-1/+21
| | | | | | | | Hovering a data-face preview element shows its section, face, and effective value in the preview-label info line, and the element's title carries the full record: effective fg/bg plus a per-attribute source note (direct, inherited-from-X, default, or cleared-rendering-as-default). Clicking an on-pane element scrolls to and flashes its assignment row. Off-pane and cross-surface elements stay hover-only. A single owner-qualified registry keyed by {owner, face} backs both data-face surfaces, package and UI, so the same face name under two owners never collides. The pure helpers in app-core.js take all state as arguments and return data. The one stateful adapter, previewSpan, lives in previews.js and emits the escaped markup. os() stays a package-owner wrapper over previewSpan, and a unified locateClick dispatcher replaces the per-surface click branches. Covered by test-locate.mjs and four new browser gates. Full harness green.
* refactor(theme-studio): extract per-package previews into previews.jsCraig Jennings7 days1-0/+463
The ~28 renderXxxPreview functions plus ofs/os/previewLines were ~460 lines of bespoke sample content sitting in the middle of the controller. I moved them to a new previews.js, spliced into the page through a PREVIEWS_J token the same way the other inlined libs are, and left the PACKAGE_PREVIEWS registry and dispatcher in app.js. app.js drops from 1233 to 759 lines, and the sample data now lives apart from the table/control machinery.