Files
Teknium c5a4a20bcd fix(cli): review findings on the glyph layout
- Batch calls mark the entry that failed: tool rows come from typed (verb, detail, failure)
  parts built with the same per-entry suffix logic as the ┊ renderer.
- A fast failure keeps its reason ([exit 1]); only the timing waits for 0.1s.
- Tab-to-queue submits directly with mode="queue" instead of re-entering Enter, whose paste
  and backslash-continuation rules could turn the key into a newline.
- The footer keeps the battery reading and vim mode label.
- Non-streamed answers print with soft wrap, so the terminal re-flows them on resize.
- _Panel moves to its own cli_panel module (cli_render stays under 1,000 lines).
- busy_input_mode resolution lives in one function, tested through load_cli_config.
2026-10-19 07:12:58 -07:00

29 lines
1.2 KiB
Python

"""Bordered overlay panels (approval, clarify, sudo, pickers) for the classic CLI's live region."""
from hermes_cli.cli_render import _append_blank_panel_line, _append_panel_line
class _Panel:
"""Fragment accumulator for one bordered overlay panel (``(style, text)`` tuples)."""
def __init__(self, border: str, box_width: int, title: str = "", title_style: str = ""):
self.lines, self.border, self.width = [], border, box_width
self._row, self._blank = _append_panel_line, _append_blank_panel_line
if title:
# Title inlined into the top rule: ``╭─ Title ───╮``.
self.lines.append((border, "╭─ "))
self.lines.append((title_style, title))
self.lines.append((border, " " + ("─" * max(0, box_width - len(title) - 3)) + "╮\n"))
else:
self.lines.append((border, "╭" + ("─" * box_width) + "╮\n"))
def row(self, style: str, text: str) -> None:
self._row(self.lines, self.border, style, text, self.width)
def blank(self) -> None:
self._blank(self.lines, self.border, self.width)
def close(self) -> list:
self.lines.append((self.border, "╰" + ("─" * self.width) + "╯\n"))
return self.lines