feat(tui): implement TuiMaterializer bridging A2A event queue to conversation view with ThoughtBlockWidget #11164

Merged
HAL9000 merged 4 commits from pr/10589-tui-materializer into master 2026-06-15 11:14:32 +00:00

4 Commits

Author SHA1 Message Date
HAL9000 dcffc83e69 fix(tui): resolve lint and AmbiguousStep errors in TuiMaterializer
CI / load-versions (pull_request) Successful in 15s
CI / push-validation (pull_request) Successful in 29s
CI / lint (pull_request) Successful in 38s
CI / build (pull_request) Successful in 37s
CI / typecheck (pull_request) Successful in 1m18s
CI / security (pull_request) Successful in 1m19s
CI / quality (pull_request) Successful in 1m16s
CI / helm (pull_request) Successful in 40s
CI / unit_tests (pull_request) Successful in 7m1s
CI / docker (pull_request) Successful in 1m31s
CI / integration_tests (pull_request) Successful in 10m45s
CI / coverage (pull_request) Successful in 9m34s
CI / status-check (pull_request) Successful in 2s
- Fix ruff format violations: collapse list comprehension in
  materializer.py, collapse function signature, collapse decorators
  and assertion in tui_materializer_steps.py, remove trailing
  whitespace in vulture_whitelist.py
- Remove duplicate Behave step definitions from tui_materializer_steps.py
  that conflicted with output_rendering_steps.py and
  project_commands_coverage_steps.py: create status handle,
  create code handle, close panel handle, close status handle,
  no error should be raised
- Rename render_element_for_tui step texts to avoid conflict with
  tui_first_run_steps.py: rendered text should contain/be empty ->
  render output should contain/be empty
- Update tui_materializer.feature to use renamed step texts and
  replace no error should be raised with materializer still running

ISSUES CLOSED: #11164
2026-06-15 06:56:15 -04:00
HAL9000 36b9e763ea fix(lint): fix import ordering in _tui_renderers.py
The Tree and TreeNode imports were not in alphabetical order, causing ruff I001 lint
violation. Reordered to comply with CONTRIBUTING.md import rules.

ISSUES CLOSED: #5326
2026-06-15 06:56:15 -04:00
HAL9000 ceaec0641e fix(tui): replace # type: ignore with TreeNode proper typing in _tui_renderers.py
ISSUES CLOSED: #5326
2026-06-15 06:56:15 -04:00
HAL9000 dba2e71e7d feat(tui): implement TuiMaterializer bridging A2A event queue to conversation view with ThoughtBlockWidget
Implemented the TuiMaterializer class that bridges the Output Rendering
Framework to Textual UI widgets, enabling all CLI command producers to
render in the TUI without modification. Split the module into three files
to stay under the 500-line file limit: main materializer.py (TuiMaterializer
class), _tui_events.py (event type constants and event model), and
_tui_renderers.py (all rendering helper functions).

The TuiMaterializer implements the MaterializationStrategy protocol and
maps ElementHandle events (Panel, Table, Status, Progress, Tree, Code,
Diff, Separator, ActionHint, Text) to plain-text renderings for TUI display.
Supports real-time streaming updates and A2A event routing for
PermissionRequest and ThoughtBlock events. Thread-safe with lock guards on
all shared state mutations.

Added comprehensive Behave BDD test suite covering all element types,
callback invocation, rendered output accumulation, A2A routing logic, and
concurrent thread safety verification.

ISSUES CLOSED: #5326
2026-06-15 06:56:15 -04:00