Pure tagged-union lifecycle owner for exclusive input-capturing modals.
Conflict modals are sticky under open/2; transition/2 is unconditional.
Completion trigger bookkeeping and stale-tab dismissal receive the required
active-tab context as values rather than reaching into Editor state.
Summary
Functions
Returns whether a modal is active.
Closes a completed modal.
Returns the active command-completion payload.
Returns the inner completion value when completion is active.
Returns the source-owned generation for the active completion presentation.
Returns the active completion trigger or a fresh trigger.
Dismisses a canceled modal.
Dismisses completion whose owner does not match the active tab id.
Returns whether the modal has the expected tag.
Updates completion through an explicit user-navigation transition.
Returns the closed modal value.
Opens an exact modal value, preserving an active conflict against other variants.
Records completion-trigger lifecycle using explicit active-tab context.
Returns the active tag, or :none.
Transitions to an exact modal value unconditionally, bypassing conflict stickiness.
Updates the active inner completion value.
Types
@type active() :: {:picker, MingaEditor.State.ModalOverlay.Picker.t()} | {:prompt, MingaEditor.State.ModalOverlay.Prompt.t()} | {:completion, MingaEditor.State.ModalOverlay.Completion.t()} | {:command_completion, MingaEditor.State.ModalOverlay.CommandCompletion.t()} | {:conflict, MingaEditor.State.ModalOverlay.Conflict.t()}
@type t() :: :none | active()
@type variant() :: :picker | :prompt | :completion | :command_completion | :conflict
Functions
Returns whether a modal is active.
@spec close(t()) :: :none
Closes a completed modal.
@spec command_completion(t()) :: MingaEditor.State.ModalOverlay.CommandCompletion.t() | nil
Returns the active command-completion payload.
@spec completion(t()) :: Minga.Editing.Completion.t() | nil
Returns the inner completion value when completion is active.
@spec completion_generation(t()) :: non_neg_integer()
Returns the source-owned generation for the active completion presentation.
@spec completion_trigger(t()) :: MingaEditor.CompletionTrigger.t()
Returns the active completion trigger or a fresh trigger.
@spec dismiss(t()) :: :none
Dismisses a canceled modal.
@spec dismiss_if_stale(t(), MingaEditor.State.Tab.id() | nil) :: t()
Dismisses completion whose owner does not match the active tab id.
Returns whether the modal has the expected tag.
@spec none() :: t()
Returns the closed modal value.
Opens an exact modal value, preserving an active conflict against other variants.
@spec put_completion_trigger( t(), MingaEditor.CompletionTrigger.t(), MingaEditor.State.Tab.id() | nil, pos_integer() ) :: t()
Records completion-trigger lifecycle using explicit active-tab context.
Returns the active tag, or :none.
Transitions to an exact modal value unconditionally, bypassing conflict stickiness.
@spec update_completion(t(), (Minga.Editing.Completion.t() -> Minga.Editing.Completion.t())) :: t()
Updates the active inner completion value.