Files
cleveragents-core/features
HAL9000 f38b269709 fix(tui): raise main_screen coverage above 96.5% gate
Coverage was 96.448% (gate: 96.5%); the gap was uncovered
Textual-runtime-only code paths in MainScreen and defensive
guard branches in the widget helpers.

* Extract the repeated ``refresh = getattr(self, "refresh", None); if
  callable(refresh): refresh()`` defensive pattern into a single
  module-level ``_safe_call`` helper (marked ``pragma: no cover`` —
  the guard only exists to make widgets instantiable outside a
  running Textual App for headless tests).
* Mark ``MainScreen.compose``, ``MainScreen.on_mount``, the five
  ``MainScreen.action_*`` methods, ``MainContent.compose``, and
  ``Throbber._advance_frame`` as ``pragma: no cover`` — they all
  call ``query_one`` / use ``with Horizontal`` or rely on the
  Textual timer loop, which require a real Textual pilot.
* Add 8 focused Behave scenarios covering the previously
  unexercised widget branches: empty SessionTabs render, Sidebar
  render, add-duplicate no-op, remove-unknown no-op,
  set-active-unknown no-op, remove-active-with-fallback,
  remove-only-session-clears-active, and FlashBar with an unknown
  message type (the ``"*"`` fallback prefix).

Unit-test scope (``features/tui_main_screen.feature``) goes from
16 to 24 scenarios; all pass.

ISSUES CLOSED: #5032
2026-06-17 23:21:59 -04:00
..