Skip to content

trading_agent.terminal.widgets.progress_line

The live line above the message box while a desk works, as in Claude Code.

It shows a turning spark, words saying what the desk is doing, the tool's most telling argument, and the time so far. The words follow the web page's TurnProgress.tsx: "Waiting in the queue", the running tool's activity, "Writing the answer", or a thinking word that stays the same for the whole turn.

Typical usage example:

line = ProgressLine() line.follow(turn) line.follow(None)

ProgressLine

ProgressLine()

Bases: Static

The progress line; hidden while no turn runs.

Creates the line, hidden.

Source code in src/trading_agent/terminal/widgets/progress_line.py
def __init__(self):
    """Creates the line, hidden."""
    super().__init__('', id='progress-line')
    self._turn: chat_items.ChatTurn | None = None
    self._tick = 0
    self._formatter = formatter.Formatter()
    self._describer = tool_describer.ToolDescriber()

on_mount

on_mount()

Starts the animation timer.

Source code in src/trading_agent/terminal/widgets/progress_line.py
def on_mount(self) -> None:
    """Starts the animation timer."""
    self.display = False
    self.set_interval(_TICK_SECONDS, self._advance)

follow

follow(turn)

Shows the progress of a turn, or hides the line.

Parameters:

Name Type Description Default
turn ChatTurn | None

The turn that is waiting or running, or None when the desk is idle.

required
Source code in src/trading_agent/terminal/widgets/progress_line.py
def follow(self, turn: chat_items.ChatTurn | None) -> None:
    """Shows the progress of a turn, or hides the line.

    Args:
        turn (chat_items.ChatTurn | None): The turn that is waiting or running, or None when the desk is idle.
    """
    self._turn = turn
    self.display = turn is not None
    self._draw()