[PATCH 05/26] lucid: show current play name in dynamic display
Daniel Gomez <[email protected]> Tue, 19 May 2026 15:28:02 +0200
| Newsgroups | dev.linux.lists.kdevops |
|---|---|
| Message-ID | <[email protected]> |
From: Daniel Gomez <[email protected]> In dynamic mode the live TUI reprints the task header, running hosts, and recent tasks on every refresh but never the enclosing play banner. Once a long task fills the screen or the user scrolls the terminal back, the PLAY: line disappears and it becomes unclear which play is currently running, especially in tmux panes without scrollback. Capture the current play name in v2_playbook_on_play_start and render it as the first header line in _redraw_display so the play context stays visible alongside the task information for as long as the play is active. The static-mode PLAY: banner is still printed unchanged; this only augments the dynamic display. Generated-by: Claude AI Signed-off-by: Daniel Gomez <[email protected]> --- callback_plugins/lucid.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/callback_plugins/lucid.py b/callback_plugins/lucid.py index 58d85391..dac768a5 100644 --- a/callback_plugins/lucid.py +++ b/callback_plugins/lucid.py @@ -98,6 +98,7 @@ class CallbackModule(CallbackBase): self.current_task_name: str = "" self.current_task_hosts: list[str] = [] self.play_hosts: list[str] = [] # All hosts in current play + self.current_play_name: str = "" # Current play name for dynamic display # Dynamic display state self.display_lines = 0 @@ -419,6 +420,7 @@ class CallbackModule(CallbackBase): hosts_str = str(hosts) msg = f"\nPLAY: {name} [{hosts_str}]" + self.current_play_name = f"PLAY: {name} [{hosts_str}]" self._display_message(msg, C.COLOR_HIGHLIGHT) self._write_to_log(msg) @@ -730,6 +732,10 @@ class CallbackModule(CallbackBase): # Build new display lines = [] + # Play header + if self.current_play_name: + lines.append(self._truncate_line(self.current_play_name, term_width)) + # Task header - truncate to terminal width if self.current_task_name: task_line = f"TASK: {self.current_task_name}" -- 2.53.0