refactor(display)!: remove deprecated backends, simplify protocol, and add BorderMode/UI rendering

- Remove SixelDisplay and KittyDisplay backends (unmaintained)
- Simplify Display protocol: reduce docstring noise, emphasize duck typing
- Add BorderMode enum (OFF, SIMPLE, UI) for flexible border rendering
- Rename render_border to _render_simple_border
- Add render_ui_panel() to compose main viewport with right-side UI panel
- Add new render_border() dispatcher supporting BorderMode
- Update __all__ to expose BorderMode, render_ui_panel, PygameDisplay
- Clean up DisplayRegistry: remove deprecated method docstrings
- Update tests: remove SixelDisplay import, assert sixel not in registry
- Add TODO comment to WebSocket backend about streaming improvements

This is a breaking change (removal of backends) but enables cleaner architecture and interactive UI panel.

Closes #13, #21
This commit is contained in:
2026-03-18 12:18:02 -07:00
parent 60ae4f7dfb
commit 36afbacb6b
6 changed files with 144 additions and 657 deletions

View File

@@ -77,11 +77,13 @@ class TestDisplayRegistry:
DisplayRegistry.initialize()
assert DisplayRegistry.get("terminal") == TerminalDisplay
assert DisplayRegistry.get("null") == NullDisplay
from engine.display.backends.sixel import SixelDisplay
from engine.display.backends.pygame import PygameDisplay
from engine.display.backends.websocket import WebSocketDisplay
assert DisplayRegistry.get("websocket") == WebSocketDisplay
assert DisplayRegistry.get("sixel") == SixelDisplay
assert DisplayRegistry.get("pygame") == PygameDisplay
# Removed backends (sixel, kitty) should not be present
assert DisplayRegistry.get("sixel") is None
def test_initialize_idempotent(self):
"""initialize can be called multiple times safely."""