diff --git a/contributors/emails/p.minervini@gmail.com b/contributors/emails/p.minervini@gmail.com new file mode 100644 index 0000000000..eabaa93cb9 --- /dev/null +++ b/contributors/emails/p.minervini@gmail.com @@ -0,0 +1,2 @@ +pminervini +# PR #104222 salvage diff --git a/hermes_cli/skin_engine.py b/hermes_cli/skin_engine.py index 8df06db4bb..f4a662855d 100644 --- a/hermes_cli/skin_engine.py +++ b/hermes_cli/skin_engine.py @@ -512,6 +512,7 @@ def get_prompt_toolkit_style_overrides() -> Dict[str, str]: palette: Dict[str, str] = {} for name, key, fallback in _STYLE_PALETTE: palette[name] = skin.get_color(key, palette[fallback[1:]] if fallback.startswith("@") else fallback) + # This badge paints both sides; foreground-only light remapping destroys its contrast. palette["badge_bg"] = skin.colors.get( "status_bar_strong", skin.colors.get("banner_title", "#FFD700")) palette["badge_fg"] = skin.colors.get("status_bar_bg", "#1a1a2e") diff --git a/tests/cli/test_cli_light_mode.py b/tests/cli/test_cli_light_mode.py index 0763cc4ff6..fb5d3fb15e 100644 --- a/tests/cli/test_cli_light_mode.py +++ b/tests/cli/test_cli_light_mode.py @@ -134,10 +134,29 @@ class TestLightModeRemap: class TestSkinConfigHook: - """The salvage wraps SkinConfig.get_color at module import time so - every skin color read goes through the light-mode remap. Verify - the hook installed and functions correctly. - """ + """Exercise the installed color hook, including self-painted badge colors.""" + + @pytest.mark.parametrize("skin_name", ["default", "sisyphus"]) + def test_badge_preserves_its_paired_colors_in_light_mode( + self, cli_mod, monkeypatch, skin_name + ): + from hermes_cli.skin_engine import ( + get_active_skin, get_prompt_toolkit_style_overrides, set_active_skin, + ) + + monkeypatch.setenv("HERMES_LIGHT", "1") + previous = get_active_skin().name + try: + set_active_skin(skin_name) + skin = get_active_skin() + background = skin.colors.get("status_bar_strong", skin.colors.get("banner_title", "#FFD700")) + foreground = skin.colors.get("status_bar_bg", "#1a1a2e") + assert get_prompt_toolkit_style_overrides()["status-bar-session-title"] == ( + f"bg:{background} {foreground} bold" + ) + finally: + set_active_skin(previous) + def test_hook_installed(self, cli_mod): from hermes_cli.skin_engine import SkinConfig