Source-owned registry for extension sidebar contributions.
Extensions register sidebar metadata once, then publish snapshots whenever their content changes. The editor render and layout paths read the cached registry state directly instead of invoking extension callbacks per frame.
Summary
Types
Action handler invoked through the editor action pipeline.
Registered sidebar entry.
Sidebar placement.
Registration attributes.
Contribution source that owns a sidebar.
Registry table name.
Functions
Returns the first visible left sidebar, if any.
Returns all registered sidebars ordered by priority and id.
Returns the default production sidebar registry table.
Dispatches a semantic action through the registered action handler.
Makes one visible left sidebar focused and clears focus from the rest.
Returns a sidebar by id.
Publishes a cached snapshot for a sidebar.
Registers or replaces a sidebar owned by source.
Updates sidebar focus state.
Updates sidebar visibility.
Returns the sidebar registry table for a state-like value.
Unregisters a sidebar when it is owned by the caller's source.
Removes every sidebar owned by a source.
Returns visible registered sidebars ordered by priority and id.
Types
@type action_handler() :: MingaEditor.Extension.Sidebar.Entry.action_handler()
Action handler invoked through the editor action pipeline.
@type entry() :: MingaEditor.Extension.Sidebar.Entry.t()
Registered sidebar entry.
@type placement() :: MingaEditor.Extension.Sidebar.Entry.placement()
Sidebar placement.
@type register_attrs() :: %{ :id => String.t(), :display_name => String.t(), optional(:description) => String.t(), optional(:placement) => placement(), optional(:priority) => integer(), optional(:preferred_width) => pos_integer(), optional(:visible?) => boolean(), optional(:focused?) => boolean(), optional(:semantic_kind) => String.t(), optional(:icon) => String.t(), optional(:input_handler) => module() | nil, optional(:action_handler) => action_handler(), optional(:badge_count) => non_neg_integer() | nil, optional(:snapshot) => MingaEditor.Extension.Sidebar.Snapshot.t() }
Registration attributes.
@type source() :: Minga.Extension.ContributionCleanup.contribution_source()
Contribution source that owns a sidebar.
@type table() :: atom()
Registry table name.
Functions
@spec active_left() :: entry() | nil
Returns the first visible left sidebar, if any.
@spec all() :: [entry()]
Returns all registered sidebars ordered by priority and id.
@spec default_table() :: table()
Returns the default production sidebar registry table.
@spec dispatch_action(MingaEditor.State.t(), String.t(), String.t(), map()) :: MingaEditor.State.t()
Dispatches a semantic action through the registered action handler.
@spec dispatch_action(table(), MingaEditor.State.t(), String.t(), String.t(), map()) :: MingaEditor.State.t()
Makes one visible left sidebar focused and clears focus from the rest.
Returns a sidebar by id.
@spec publish_snapshot( source(), String.t(), MingaEditor.Extension.Sidebar.Snapshot.t() | keyword() | map() ) :: :ok | {:error, term()}
Publishes a cached snapshot for a sidebar.
@spec register(source(), register_attrs() | keyword()) :: :ok | {:error, term()}
Registers or replaces a sidebar owned by source.
@spec register(table(), source(), register_attrs() | keyword()) :: :ok | {:error, term()}
Updates sidebar focus state.
Updates sidebar visibility.
@spec start_link(keyword()) :: GenServer.on_start()
Returns the sidebar registry table for a state-like value.
Unregisters a sidebar when it is owned by the caller's source.
@spec unregister_source(source()) :: :ok
Removes every sidebar owned by a source.
@spec visible() :: [entry()]
Returns visible registered sidebars ordered by priority and id.