From 66bd3bf0cf23be72818c4f33348db5f3f4214913 Mon Sep 17 00:00:00 2001 From: CleverThis Date: Tue, 28 Apr 2026 12:33:37 +0000 Subject: [PATCH] fix(tui): set default THEME to dracula on TUI app class MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The _TextualCleverAgentsTuiApp class was missing the THEME class variable, causing Textual to use its default textual-dark theme instead of the Dracula theme required by the spec (docs/specification.md §TUI Theme). Added THEME: ClassVar[str] = "dracula" to the class and a corresponding BDD scenario tagged @tdd_issue @tdd_issue_4742 to verify the fix. ISSUES CLOSED: #4742 --- features/steps/tui_app_coverage_steps.py | 10 ++++++++++ features/tui_app_coverage.feature | 8 ++++++++ src/cleveragents/tui/app.py | 1 + 3 files changed, 19 insertions(+) diff --git a/features/steps/tui_app_coverage_steps.py b/features/steps/tui_app_coverage_steps.py index fcf125b6c..9bfae6063 100644 --- a/features/steps/tui_app_coverage_steps.py +++ b/features/steps/tui_app_coverage_steps.py @@ -510,3 +510,13 @@ def step_alias_check(context): assert ( context._tui_app_mod.CleverAgentsTuiApp.__name__ == "_TextualCleverAgentsTuiApp" ) + + +# --------------------------------------------------------------------------- +# THEME class variable (issue #4742) +# --------------------------------------------------------------------------- +@then('the app class should have THEME set to "{theme}"') +def step_theme_class_var(context, theme: str) -> None: + assert theme == context._tui_app.THEME, ( + f"Expected THEME='{theme}', got '{context._tui_app.THEME}'" + ) diff --git a/features/tui_app_coverage.feature b/features/tui_app_coverage.feature index 2392dca85..a610e42ea 100644 --- a/features/tui_app_coverage.feature +++ b/features/tui_app_coverage.feature @@ -196,3 +196,11 @@ Feature: TUI App Coverage And I call on_mount on the app And I submit "!true" to the app Then the conversation widget should contain "(empty output)" + + # --- THEME class variable (issue #4742) --- + + @tdd_issue @tdd_issue_4742 + Scenario: The Textual TUI app has THEME set to dracula by default + Given a mock command router and persona state + When I instantiate the Textual TUI app + Then the app class should have THEME set to "dracula" diff --git a/src/cleveragents/tui/app.py b/src/cleveragents/tui/app.py index ca663fa8f..b1ff00785 100644 --- a/src/cleveragents/tui/app.py +++ b/src/cleveragents/tui/app.py @@ -89,6 +89,7 @@ if _TEXTUAL_AVAILABLE: """Main TUI app.""" CSS_PATH: ClassVar[str] = "cleveragents.tcss" + THEME: ClassVar[str] = "dracula" BINDINGS: ClassVar[list[tuple[str, str, str]]] = [ ("ctrl+q", "quit", "Quit"), ("f1", "help", "Help"), -- 2.52.0