refactor: improve stats panel styling and add version display

This commit is contained in:
0xallam
2026-01-19 21:46:13 -08:00
parent 3d4b1bfb08
commit e948f06d64
3 changed files with 10 additions and 6 deletions

View File

@@ -60,7 +60,7 @@ Screen {
max-height: 15;
background: transparent;
padding: 0;
margin: 0;
margin-top: 1;
}
#vulnerabilities_panel {

View File

@@ -1228,6 +1228,9 @@ class StrixTUIApp(App): # type: ignore[misc]
if stats_text:
stats_content.append(stats_text)
version = get_package_version()
stats_content.append(f"\n v{version}", style="white")
from rich.panel import Panel
stats_panel = Panel(

View File

@@ -371,7 +371,8 @@ def build_tui_stats_text(tracer: Any, agent_config: dict[str, Any] | None = None
if agent_config:
llm_config = agent_config["llm_config"]
model = getattr(llm_config, "model_name", "Unknown")
stats_text.append(model, style="dim")
stats_text.append("", style="#22c55e")
stats_text.append(model, style="white")
llm_stats = tracer.get_total_llm_stats()
total_stats = llm_stats["total"]
@@ -379,11 +380,11 @@ def build_tui_stats_text(tracer: Any, agent_config: dict[str, Any] | None = None
total_tokens = total_stats["input_tokens"] + total_stats["output_tokens"]
if total_tokens > 0:
stats_text.append("\n ")
stats_text.append(f"{format_token_count(total_tokens)} tokens", style="dim")
stats_text.append(f"{format_token_count(total_tokens)} tokens", style="white")
if total_stats["cost"] > 0:
stats_text.append("\n")
stats_text.append(f"${total_stats['cost']:.2f} spent", style="dim")
stats_text.append(" · ", style="white")
stats_text.append(f"${total_stats['cost']:.2f}", style="white")
return stats_text