MingaEditor.Shell.Chrome behaviour (Minga v0.1.0)

Copy Markdown View Source

Behaviour: how a shell builds chrome (tab bar, modeline, file tree, overlays) and renders complete frames.

Carved out of MingaEditor.Shell so the rendering responsibility is declared as a focused contract independent of input routing or buffer lifecycle.

Summary

Callbacks

Returns a chrome struct with draw lists for each UI region. The shell decides which chrome elements exist and how they render.

Runs the full render pipeline (content, chrome, compose, emit) and sends commands to the frontend. Returns updated state with cached render data.

Callbacks

build_chrome(editor_state, layout, scrolls, cursor_info)

@callback build_chrome(
  editor_state :: term(),
  layout :: MingaEditor.Layout.t(),
  scrolls :: map(),
  cursor_info :: term()
) :: MingaEditor.RenderPipeline.Chrome.t()

Returns a chrome struct with draw lists for each UI region. The shell decides which chrome elements exist and how they render.

render(editor_state)

@callback render(editor_state :: term()) :: term()

Runs the full render pipeline (content, chrome, compose, emit) and sends commands to the frontend. Returns updated state with cached render data.