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

Copy Markdown View Source

Behaviour: how a shell routes input.

Carved out of MingaEditor.Shell. This is the natural home for the focus-tree mouse routing in #1435 and any future "click-to-focus" semantics — those are presentation concerns the shell owns, not the editing model.

Summary

Types

Shell-specific state. Each shell defines its own struct.

Workspace state (the editing context shared by all shells).

Callbacks

Handle a shell-specific event (tool prompt, nav flash, git status, etc.).

Handle a shell-specific GUI action from the native frontend.

Returns the input handler stack for this shell. Overlay handlers (picker, completion, conflict prompt) sit above the surface and intercept keys first; surface handlers (dashboard, file tree, agent panel, mode dispatch) handle keys when no overlay claims them.

Types

shell_state()

@type shell_state() :: term()

Shell-specific state. Each shell defines its own struct.

workspace()

@type workspace() :: MingaEditor.Workspace.State.t()

Workspace state (the editing context shared by all shells).

Callbacks

handle_event(shell_state, workspace, event)

@callback handle_event(shell_state(), workspace(), event :: term()) ::
  {shell_state(), workspace()}

Handle a shell-specific event (tool prompt, nav flash, git status, etc.).

handle_gui_action(shell_state, workspace, action)

@callback handle_gui_action(shell_state(), workspace(), action :: term()) ::
  {shell_state(), workspace()}

Handle a shell-specific GUI action from the native frontend.

input_handlers(editor_state)

@callback input_handlers(editor_state :: term()) :: %{
  overlay: [module()],
  surface: [module()]
}

Returns the input handler stack for this shell. Overlay handlers (picker, completion, conflict prompt) sit above the surface and intercept keys first; surface handlers (dashboard, file tree, agent panel, mode dispatch) handle keys when no overlay claims them.