Skip to content

Commit 97f3eca

Browse files
committed
[#23897] Applied revision (Pub/Sub tools + UI updates)
Signed-off-by: danipiza <dpizarrogallego@gmail.com>
1 parent 09a77c7 commit 97f3eca

6 files changed

Lines changed: 280 additions & 109 deletions

File tree

src/vulcanai/console/console.py

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,28 @@ class VulcanConsole(App):
5050
# Two panels: left (log + input) and right (history + variables)
5151
# Right panel: 48 characters length
5252
# Left panel: fills remaining space
53+
54+
55+
# #right {
56+
# width: 48;
57+
# layout: vertical;
58+
# border: tall #56AA08;
59+
# padding: 0;
60+
# }
61+
62+
# #logcontent {
63+
# height: auto;
64+
# min-height: 1;
65+
# max-height: 1fr;
66+
# border: tall #333333;
67+
# }
68+
69+
# #streamcontent {
70+
# height: 0;
71+
# min-height: 0;
72+
# border: tall #56AA08;
73+
# display: none;
74+
# }
5375
CSS = """
5476
Screen {
5577
layout: horizontal;
@@ -77,7 +99,7 @@ class VulcanConsole(App):
7799
#streamcontent {
78100
height: 0;
79101
min-height: 0;
80-
border: tall #56AA08;
102+
border: solid #56AA08;
81103
display: none;
82104
}
83105

src/vulcanai/console/logger.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,8 @@ class VulcanAILogger:
4545
"executor": "#15B606",
4646
"vulcanai": "#56AA08",
4747
"user": "#91DD16",
48-
"validator": "#C49C00",
49-
"tool": "#EB921E",
48+
"validator": "#9600C4",
49+
"tool": "#C49C00",
5050
"error": "#FF0000",
5151
"console": "#8F6296",
5252
"warning": "#D8C412",

src/vulcanai/console/modal_screens.py

Lines changed: 35 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414

1515
from textual import events
1616
from textual.app import ComposeResult
17+
from textual.content import Content
1718
from textual.containers import Container, Horizontal, Vertical, VerticalScroll
1819
from textual.screen import ModalScreen
1920
from textual.widgets import Button, Checkbox, Input, Label, RadioButton, RadioSet
@@ -170,9 +171,16 @@ class CheckListModal(ModalScreen[list[str] | None]):
170171
}
171172
172173
.btns {
173-
height: 3; /* give buttons row a fixed height */
174-
padding-top: 1;
175-
content-align: right middle;
174+
height: auto;
175+
width: 100%;
176+
margin-top: 1;
177+
padding: 0;
178+
content-align: center middle;
179+
align-horizontal: center;
180+
}
181+
182+
.btns Button {
183+
padding: 0 3;
176184
}
177185
"""
178186

@@ -209,6 +217,18 @@ def on_mount(self) -> None:
209217

210218

211219
class RadioListModal(ModalScreen[str | None]):
220+
class SquareRadioButton(RadioButton):
221+
# BUTTON_INNER = '●'
222+
@property
223+
def _button(self) -> Content:
224+
button_style = self.get_visual_style("toggle--button")
225+
symbol = "☒" if self.value else "☐"
226+
return Content.assemble(
227+
(" ", button_style),
228+
(symbol, button_style),
229+
(" ", button_style),
230+
)
231+
212232
CSS = """
213233
RadioListModal {
214234
align: center middle;
@@ -218,7 +238,6 @@ class RadioListModal(ModalScreen[str | None]):
218238
width: 60%;
219239
max-width: 90%;
220240
height: 40%;
221-
border: round $accent;
222241
padding: 1 2;
223242
background: $panel;
224243
}
@@ -233,9 +252,16 @@ class RadioListModal(ModalScreen[str | None]):
233252
}
234253
235254
.btns {
236-
height: 3;
237-
padding-top: 1;
238-
content-align: right middle;
255+
height: auto;
256+
width: 100%;
257+
margin-top: 1;
258+
padding: 0;
259+
content-align: center middle;
260+
align-horizontal: center;
261+
}
262+
263+
.btns Button {
264+
padding: 0 1;
239265
}
240266
"""
241267

@@ -255,15 +281,15 @@ def compose(self) -> ComposeResult:
255281
with VerticalScroll(classes="radio-list"):
256282
with RadioSet(id="radio-set"):
257283
for i, line in enumerate(self.lines):
258-
yield RadioButton(line, id=f"rb{i}", value=(i == self.default_index))
284+
yield self.SquareRadioButton(line, id=f"rb{i}", value=(i == self.default_index))
259285

260286
# Buttons
261287
with Horizontal(classes="btns"):
262288
yield Button("Cancel", variant="default", id="cancel")
263289
yield Button("Submit", variant="primary", id="submit")
264290

265291
def on_mount(self) -> None:
266-
first_rb = self.query_one(RadioButton)
292+
first_rb = self.query_one(self.SquareRadioButton)
267293
self.set_focus(first_rb)
268294

269295
def on_button_pressed(self, event: Button.Pressed) -> None:

src/vulcanai/core/executor.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -277,9 +277,9 @@ def _call_tool(
277277
msg += "'{"
278278
for key, value in arg_dict.items():
279279
if first:
280-
msg += f"[validator]'{key}'[/validator]: " + f"[registry]'{value}'[/registry]"
280+
msg += f"[tool]'{key}'[/tool]: " + f"[registry]'{value}'[/registry]"
281281
else:
282-
msg += f", [validator]'{key}'[/validator]: " + f"[registry]'{value}'[/registry]"
282+
msg += f", [tool]'{key}'[/tool]: " + f"[registry]'{value}'[/registry]"
283283
first = False
284284
msg += "}'"
285285
self.logger.log_executor(msg)

src/vulcanai/core/plan_types.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ def __str__(self) -> str:
8989
lines.append(f"- <bold>Plan Summary</bold>: {self.summary}\n")
9090

9191
color_tool = VulcanAILogger.vulcanai_theme["executor"]
92-
color_variable = VulcanAILogger.vulcanai_theme["validator"]
92+
color_variable = VulcanAILogger.vulcanai_theme["tool"]
9393
color_value = VulcanAILogger.vulcanai_theme["registry"]
9494
color_error = VulcanAILogger.vulcanai_theme["error"]
9595

0 commit comments

Comments
 (0)