Skip to content

Commit 4914c65

Browse files
authored
Merge pull request #532 from UiPath/fix/terminal_style
fix: terminal style
2 parents db0faf1 + c93f5f0 commit 4914c65

4 files changed

Lines changed: 51 additions & 185 deletions

File tree

src/uipath/_cli/_dev/_terminal/__init__.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
from textual.app import App, ComposeResult
1111
from textual.binding import Binding
1212
from textual.containers import Container, Horizontal
13-
from textual.widgets import Button, ListView
13+
from textual.widgets import Button, Footer, ListView
1414

1515
from ..._runtime._contracts import (
1616
UiPathErrorContract,
@@ -34,8 +34,8 @@ class UiPathDevTerminal(App[Any]):
3434

3535
BINDINGS = [
3636
Binding("q", "quit", "Quit"),
37-
Binding("n", "new_run", "New Run"),
38-
Binding("r", "execute_run", "Execute"),
37+
Binding("n", "new_run", "New"),
38+
Binding("r", "execute_run", "Run"),
3939
Binding("c", "clear_history", "Clear History"),
4040
Binding("escape", "cancel", "Cancel"),
4141
]
@@ -76,6 +76,8 @@ def compose(self) -> ComposeResult:
7676
# Run details panel (initially hidden)
7777
yield RunDetailsPanel(id="details-panel", classes="hidden")
7878

79+
yield Footer()
80+
7981
async def on_button_pressed(self, event: Button.Pressed) -> None:
8082
"""Handle button press events."""
8183
if event.button.id == "new-run-btn":

src/uipath/_cli/_dev/_terminal/_components/_history.py

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,14 @@
22

33
from textual.app import ComposeResult
44
from textual.containers import Container, Vertical
5-
from textual.widgets import Button, ListItem, ListView, Static
5+
from textual.widgets import (
6+
Button,
7+
ListItem,
8+
ListView,
9+
Static,
10+
TabbedContent,
11+
TabPane,
12+
)
613

714
from .._models._execution import ExecutionRun
815

@@ -16,11 +23,16 @@ def __init__(self, **kwargs):
1623
self.selected_run: Optional[ExecutionRun] = None
1724

1825
def compose(self) -> ComposeResult:
19-
with Vertical():
20-
yield ListView(id="run-list", classes="run-list")
21-
yield Button(
22-
"+ New Run", id="new-run-btn", variant="primary", classes="new-run-btn"
23-
)
26+
with TabbedContent():
27+
with TabPane("History", id="history-tab"):
28+
with Vertical():
29+
yield ListView(id="run-list", classes="run-list")
30+
yield Button(
31+
"+ New",
32+
id="new-run-btn",
33+
variant="primary",
34+
classes="new-run-btn",
35+
)
2436

2537
def add_run(self, run: ExecutionRun):
2638
"""Add a new run to history."""

src/uipath/_cli/_dev/_terminal/_components/_new.py

Lines changed: 26 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
from textual.app import ComposeResult
66
from textual.containers import Container, Horizontal, Vertical
77
from textual.reactive import reactive
8-
from textual.widgets import Button, Select, TextArea
8+
from textual.widgets import Button, Select, TabbedContent, TabPane, TextArea
99

1010

1111
def mock_json_from_schema(schema: Dict[str, Any]) -> Dict[str, Any]:
@@ -63,32 +63,31 @@ def __init__(self, **kwargs):
6363
)
6464

6565
def compose(self) -> ComposeResult:
66-
with Vertical():
67-
options = [(path, path) for path in self.entrypoint_paths]
68-
yield Select(
69-
options,
70-
id="entrypoint-select",
71-
value=self.selected_entrypoint,
72-
allow_blank=False,
73-
)
74-
75-
yield TextArea(
76-
text=self.initial_input,
77-
language="json",
78-
id="json-input",
79-
classes="input-field json-input",
80-
)
81-
82-
with Horizontal(classes="run-actions"):
83-
yield Button(
84-
"▶ Run", id="execute-btn", variant="primary", classes="action-btn"
85-
)
86-
yield Button(
87-
"Cancel",
88-
id="cancel-btn",
89-
variant="default",
90-
classes="action-btn cancel-btn",
91-
)
66+
with TabbedContent():
67+
with TabPane("New run", id="new-tab"):
68+
with Vertical():
69+
options = [(path, path) for path in self.entrypoint_paths]
70+
yield Select(
71+
options,
72+
id="entrypoint-select",
73+
value=self.selected_entrypoint,
74+
allow_blank=False,
75+
)
76+
77+
yield TextArea(
78+
text=self.initial_input,
79+
language="json",
80+
id="json-input",
81+
classes="input-field json-input",
82+
)
83+
84+
with Horizontal(classes="run-actions"):
85+
yield Button(
86+
"▶ Run",
87+
id="execute-btn",
88+
variant="primary",
89+
classes="action-btn",
90+
)
9291

9392
async def on_select_changed(self, event: Select.Changed) -> None:
9493
"""Update JSON input when user selects an entrypoint."""

0 commit comments

Comments
 (0)