trading_agent.terminal.widgets.desk_picker
¶
A dialog listing the desks, for switching the chat to another one.
It returns the chosen desk's name, or None when the user presses Escape.
Typical usage example:
app.push_screen(DeskPicker(desks, 'general'), on_chosen)
DeskPicker
¶
Bases: ModalScreen[str | None]
The desk list.
Creates the dialog.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
desks
|
list[dict[str, Any]]
|
The desk summaries from GET /api/desks. |
required |
current
|
str
|
The desk the chat shows now. |
required |
Source code in src/trading_agent/terminal/widgets/desk_picker.py
compose
¶
Builds the dialog.
Yields:
| Type | Description |
|---|---|
Widget
|
The title and the list. |
Source code in src/trading_agent/terminal/widgets/desk_picker.py
on_mount
¶
Highlights the current desk.
Source code in src/trading_agent/terminal/widgets/desk_picker.py
on_option_list_option_selected
¶
Returns the chosen desk.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
event
|
OptionSelected
|
The choice. |
required |