diff options
| author | Craig Jennings <c@cjennings.net> | 2026-07-02 22:09:55 -0400 |
|---|---|---|
| committer | Craig Jennings <c@cjennings.net> | 2026-07-02 22:09:55 -0400 |
| commit | 1e10023c65acb36b5e6c378771d8a1773b1b3f9e (patch) | |
| tree | 5d8b59448a7f277ffd3fa6ec63290ceda2caabb7 /scripts/theme-studio/test_generate.py | |
| parent | 2a971d4637dfa1e21e37dc3b6429e9e8743b68ed (diff) | |
| download | dotemacs-1e10023c65acb36b5e6c378771d8a1773b1b3f9e.tar.gz dotemacs-1e10023c65acb36b5e6c378771d8a1773b1b3f9e.zip | |
fix(theme-studio): pin mode-line at an absolute height
mode-line's :height was unspecified, so a buffer that remaps its default
face larger (the nov reading view) inflated its modeline with it. Seed an
absolute 130 (1/10pt) on mode-line — build_uimap gains
apply_modeline_height_default, mirroring the hover-box default — and set
it in WIP.json. Also drop the stray :height 2 from mode-line-inactive
(a JSON integral-float collapse that rendered inactive bars at 0.2pt);
inactive now inherits mode-line's height. Theme regenerated and loaded
live; the editable-height spec covers making this tunable in the studio.
Diffstat (limited to 'scripts/theme-studio/test_generate.py')
| -rw-r--r-- | scripts/theme-studio/test_generate.py | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/scripts/theme-studio/test_generate.py b/scripts/theme-studio/test_generate.py index d4f36372..0ba35dcc 100644 --- a/scripts/theme-studio/test_generate.py +++ b/scripts/theme-studio/test_generate.py @@ -326,6 +326,25 @@ class GeneratorStateHelpers(unittest.TestCase): generate.apply_hover_box_default(uimap) self.assertEqual(uimap["mode-line-highlight"]["box"], {"style": "line", "width": 2, "color": "#abcdef"}) + def test_mode_line_defaults_to_absolute_height(self): + # mode-line must carry a fixed 1/10pt height so it never tracks a + # buffer's enlarged default face (the nov-reading modeline bug). + # Both branches: with and without a defaults snapshot. + self.assertEqual(generate.UIMAP["mode-line"]["height"], 130) + self.assertIsInstance(generate.UIMAP["mode-line"]["height"], int) + no_snapshot = generate.build_uimap(generate.UI_FACES, DefaultFaces(None)) + self.assertEqual(no_snapshot["mode-line"]["height"], 130) + + def test_mode_line_inactive_gets_no_height_seed(self): + # mode-line-inactive inherits mode-line's absolute height; seeding its + # own value would just duplicate state. + self.assertIsNone(generate.UIMAP["mode-line-inactive"]["height"]) + + def test_modeline_height_default_yields_to_existing_height(self): + uimap = {"mode-line": ui_face_spec({"height": 142})} + generate.apply_modeline_height_default(uimap) + self.assertEqual(uimap["mode-line"]["height"], 142) + def test_build_syntax_uses_map_and_style_fallbacks_without_defaults_snapshot(self): syntax = generate.build_syntax( {"kw": [None, True]}, |
