From 1e10023c65acb36b5e6c378771d8a1773b1b3f9e Mon Sep 17 00:00:00 2001 From: Craig Jennings Date: Thu, 2 Jul 2026 22:09:55 -0400 Subject: fix(theme-studio): pin mode-line at an absolute height MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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. --- scripts/theme-studio/test_generate.py | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'scripts/theme-studio/test_generate.py') 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]}, -- cgit v1.2.3