Add background styling to finish and reporting tool renderers
- Wrap finish_scan and create_vulnerability_report tool output in Padding with dark grey background (#141414) - Refactor TUI rendering to support heterogeneous renderables (Text, Padding, Group) instead of just Text - Update _render_streaming_content and _render_tool_content_simple to return Any renderable type - Handle interrupted messages by composing with Group instead of appending to Text
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
from typing import Any, ClassVar
|
||||
|
||||
from rich.padding import Padding
|
||||
from rich.text import Text
|
||||
from textual.widgets import Static
|
||||
|
||||
@@ -8,6 +9,7 @@ from .registry import register_tool_renderer
|
||||
|
||||
|
||||
FIELD_STYLE = "bold #4ade80"
|
||||
BG_COLOR = "#141414"
|
||||
|
||||
|
||||
@register_tool_renderer
|
||||
@@ -56,5 +58,7 @@ class FinishScanRenderer(BaseToolRenderer):
|
||||
text.append("\n ")
|
||||
text.append("Generating final report...", style="dim")
|
||||
|
||||
padded = Padding(text, 2, style=f"on {BG_COLOR}")
|
||||
|
||||
css_classes = cls.get_css_classes("completed")
|
||||
return Static(text, classes=css_classes)
|
||||
return Static(padded, classes=css_classes)
|
||||
|
||||
Reference in New Issue
Block a user