|
5 | 5 | from textual.app import ComposeResult |
6 | 6 | from textual.containers import Container, Horizontal, Vertical |
7 | 7 | from textual.reactive import reactive |
8 | | -from textual.widgets import Button, Select, TextArea |
| 8 | +from textual.widgets import Button, Select, TabbedContent, TabPane, TextArea |
9 | 9 |
|
10 | 10 |
|
11 | 11 | def mock_json_from_schema(schema: Dict[str, Any]) -> Dict[str, Any]: |
@@ -63,32 +63,31 @@ def __init__(self, **kwargs): |
63 | 63 | ) |
64 | 64 |
|
65 | 65 | 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 | + ) |
92 | 91 |
|
93 | 92 | async def on_select_changed(self, event: Select.Changed) -> None: |
94 | 93 | """Update JSON input when user selects an entrypoint.""" |
|
0 commit comments