Skip to content

Plugin TUI: Core bridge + renderer (Phases 1-2) #230

@hegner123

Description

@hegner123

Coroutine Bridge + Primitive Renderer

Implements the foundational coroutine bridge and rendering layer for plugin UIs. Replaces the old PTY approach (issues #98-#101, now closed) with in-process Lua coroutine yield/resume.

Plan: ai/plans/plugin/PLUGIN_TUI_SCREENS.md — Phases 1 + 2

Phase 1: Core Bridge (internal/plugin/ui_bridge.go, ui_primitives.go)

  • CoroutineBridge — Create, Start, Resume, Close lifecycle
  • Layout table parser — Lua table → PluginLayout / PluginPrimitive with validation
  • Event builder — Go values → Lua event table
  • Action parser — Lua action table → PluginAction struct
  • Enable coroutine library when plugin has screens or interfaces
  • Unit tests with mock Lua functions

Phase 2: Renderer (internal/plugin/ui_renderer.go)

  • Each primitive type's Render(width, height, focused, accent) method
  • PluginLayoutGrid + []CellContent conversion
  • Single primitive rendering for inline mode
  • Snapshot tests for each primitive

Primitives

list, detail, text, table, input, select, tree — all defined as Lua table shapes, parsed and rendered by Go.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    Status

    Todo

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions