Umbrella behaviour for pluggable presentation shells.
A shell owns layout, chrome, input routing, buffer lifecycle, and tab queries. Each responsibility is a focused sub-behaviour:
MingaEditor.Shell.Layout—compute_layout/1MingaEditor.Shell.Chrome—build_chrome/4,render/1MingaEditor.Shell.InputRouter—input_handlers/1,handle_event/3,handle_gui_action/3MingaEditor.Shell.BufferLifecycle—on_buffer_added/5,on_buffer_switched/2,on_buffer_died/3,on_agent_event/4MingaEditor.Shell.TabQueries—active_tab/1,find_tab_by_buffer/2,active_tab_kind/1,set_tab_session/3,active_session/1
This umbrella declares only init/1 (the constructor every shell
needs); all other callbacks live on their respective sub-behaviours.
Existing shells (Traditional, Board) implement the umbrella plus
every sub-behaviour. A future tab-less shell can implement just the
sub-behaviours it cares about (e.g., skip TabQueries entirely if
no tab UI is rendered) and EditorState/AgentAccess callers that
go through Shell.active_session/1 will continue to work because
they read through the field, not the type.
Implementation
Implement init/1 plus the sub-behaviours your shell needs, then
set the module as the :shell field on MingaEditor.State. The
Editor GenServer dispatches to the active shell for presentation
concerns.
Available shells
MingaEditor.Shell.Traditional— tab-based editor with file tree, modeline, picker, and agent panel. The default shell.MingaEditor.Shell.Board— agent supervisor card view.
Summary
Types
Why a buffer was added — re-exported here from Shell.BufferLifecycle
so existing call sites that use MingaEditor.Shell.buffer_add_context/0
keep compiling.
Shell-specific state. Each shell defines its own struct.
Workspace state (the editing context shared by all shells).
Callbacks
Initialize shell state from config. Called once during Editor startup. Returns the shell's initial state.
Types
@type buffer_add_context() :: MingaEditor.Shell.BufferLifecycle.buffer_add_context()
Why a buffer was added — re-exported here from Shell.BufferLifecycle
so existing call sites that use MingaEditor.Shell.buffer_add_context/0
keep compiling.
@type shell_state() :: term()
Shell-specific state. Each shell defines its own struct.
@type workspace() :: MingaEditor.Workspace.State.t()
Workspace state (the editing context shared by all shells).
Callbacks
@callback init(opts :: keyword()) :: shell_state()
Initialize shell state from config. Called once during Editor startup. Returns the shell's initial state.