Skip to main content

Terminal UI primitives for Kollabor: design system, key parsing, terminal state, visual effects

Project description

kollabor-tui

kollabor-tui is the terminal UI package for Kollabor.

It owns rendering primitives, terminal state, input parsing, design-system components, widgets, status layout, modals, fullscreen sessions, message display, tool display, and alternate-view support. TUI code in the app should use these components rather than writing directly to terminal renderer internals.

Current Role

  • Provide the design system used by messages, status widgets, modals, and tools.
  • Track terminal size and layout state through shared helpers.
  • Coordinate message display and alternate-buffer/fullscreen transitions.
  • Parse keyboard input and route it through modal/status/input controllers.
  • Render tool calls, thinking blocks, profile modals, command menus, and widgets.
  • Provide reusable widgets for plugin/config UI surfaces.

Architecture

Module/Directory Responsibility
design_system/ themes, colors, icons, gradients, boxes, inline widgets
terminal_state.py terminal dimensions and global state helpers
terminal_renderer.py main terminal active-area renderer
message_coordinator.py message flow and alternate-buffer coordination
message_display_service.py message display policy and suppression logic
message_renderer.py / tool_display.py message/tool formatting
render_loop.py / render_layout.py render triggers and screen regions
input/ / input_handler.py input loop, key handling, command mode, paste
status/ status layout, widgets, navigation, inline editors
modals/ modal state, overlays, actions, renderers
fullscreen/ fullscreen plugin/session manager and renderer
altview/ alternate-view stack/session/display queue
widgets/ text, dropdown, checkbox, tree, slider, file browser widgets
display_tap.py / buffer_manager.py display capture and buffering

Usage

from kollabor_tui import T, get_terminal_size, solid_fg

width, height = get_terminal_size()
line = solid_fg("hello".ljust(width), T().primary)

For application rendering, prefer MessageDisplayCoordinator, fullscreen manager/session APIs, and terminal-state helpers. Avoid direct manipulation of TerminalRenderer render-state internals.

Known Gaps

  • Rendering behavior is sensitive to terminal lifecycle, alternate buffers, and resize events; risky changes need read-only lifecycle tracing before patches.
  • Some display policy lives across message_display_service.py, message_coordinator.py, and tool_display.py; regression tests should cover classification/display paths together.
  • The package exposes many public imports from __init__.py; a smaller stable facade would make downstream usage clearer.
  • Visual behavior often needs real terminal or screenshot-style verification in addition to unit tests.

Roadmap

Phase 1: Rendering stability

  • Document the steady-state draw, modal/fullscreen transition, and resize recovery contracts.
  • Add focused regression tests for tool display classification and suppression.
  • Keep terminal size access centralized through terminal_state.py.

Phase 2: Public API cleanup

  • Split stable public APIs from compatibility exports.
  • Add examples for widgets, status widgets, fullscreen plugins, and altviews.
  • Make design-system usage patterns consistent across all TUI surfaces.

Phase 3: Verification tooling

  • Add repeatable terminal/screenshot verification for fullscreen and complex render paths.
  • Improve diagnostics for render loop hibernation, buffering, and active-area state.
  • Document plugin UI extension points with real examples.

Development

Targeted validation examples:

python -m py_compile packages/kollabor-tui/src/kollabor_tui/*.py
python -m pytest tests/unit/mcp/test_mcp_status_plugin.py -q

Dependencies

  • kollabor-events

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

kollabor_tui-0.5.7.tar.gz (340.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

kollabor_tui-0.5.7-py3-none-any.whl (407.1 kB view details)

Uploaded Python 3

File details

Details for the file kollabor_tui-0.5.7.tar.gz.

File metadata

  • Download URL: kollabor_tui-0.5.7.tar.gz
  • Upload date:
  • Size: 340.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for kollabor_tui-0.5.7.tar.gz
Algorithm Hash digest
SHA256 05cabe798511d58a452b7123c8c9b8531acb746e2ae7e14b9a96bba09d88f727
MD5 50e086933d2104c5e016e8d1b4ee4f96
BLAKE2b-256 045c6b4ec4944973e0d88b317fcd4b5ea2e74ac8b0f599931bb4b7d091babb40

See more details on using hashes here.

File details

Details for the file kollabor_tui-0.5.7-py3-none-any.whl.

File metadata

  • Download URL: kollabor_tui-0.5.7-py3-none-any.whl
  • Upload date:
  • Size: 407.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for kollabor_tui-0.5.7-py3-none-any.whl
Algorithm Hash digest
SHA256 e6206caccf1d9ab641bf578baa79920ab1ca3634a6251a06b0a3f1fddbddc177
MD5 79e0dfe6225fa34de7099427fc7c2508
BLAKE2b-256 ae0ccdb843ca09bea0f2b665876328636c47437aeb4f32e84d63eb9a91568287

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page