diff options
| author | Craig Jennings <c@cjennings.net> | 2026-06-24 05:46:43 -0400 |
|---|---|---|
| committer | Craig Jennings <c@cjennings.net> | 2026-06-24 05:46:43 -0400 |
| commit | 5e72000497732e7d20c179d2562e4bfacc1e3fbe (patch) | |
| tree | 7731134bf5d36359543cc407fddfbcbc30dc12df /scripts/theme-studio/test_generate.py | |
| parent | a98dc772708f33e90aaeb4572a13bf22d065a022 (diff) | |
| download | dotemacs-5e72000497732e7d20c179d2562e4bfacc1e3fbe.tar.gz dotemacs-5e72000497732e7d20c179d2562e4bfacc1e3fbe.zip | |
feat(theme-studio): bespoke nerd-icons filetype-legend preview (phase 2)
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
Diffstat (limited to 'scripts/theme-studio/test_generate.py')
| -rw-r--r-- | scripts/theme-studio/test_generate.py | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/scripts/theme-studio/test_generate.py b/scripts/theme-studio/test_generate.py index 7ff207e43..58541cbae 100644 --- a/scripts/theme-studio/test_generate.py +++ b/scripts/theme-studio/test_generate.py @@ -641,6 +641,21 @@ class NerdIconsLegend(unittest.TestCase): self.assertIsNone(generate.load_nerd_icons_legend(path)) self.assertIn("invalid", out.getvalue()) + def test_nerd_icons_registered_as_bespoke_legend_app(self): + app = generate.APPS.get("nerd-icons") + self.assertIsNotNone(app, "nerd-icons should be a bespoke app with the legend present") + self.assertEqual(app["preview"], "nerdicons") + self.assertTrue(app.get("legend")) + self.assertGreaterEqual(len(app["faces"]), 30) + # The dir-completion face is a different package and keeps its own app. + self.assertIn("nerd-icons-completion", generate.APPS) + + def test_nerd_icons_app_faces_are_seeded_with_native_colors(self): + # apply_default_face_seeds fills the editable rows from emacs-default-faces.json. + rows = {r[0]: r[2] for r in generate.APPS["nerd-icons"]["faces"]} + self.assertIn("nerd-icons-blue", rows) + self.assertTrue(rows["nerd-icons-blue"], "nerd-icons-blue should carry a native seed") + if __name__ == "__main__": unittest.main() |
