Groups picker-related fields from EditorState.
Tracks the current picker instance, the source module providing candidates, the buffer index to restore on cancel, and the action-menu overlay state.
Summary
Types
Action menu state: {actions, selected_index} or nil when closed.
Contribution source semantically authorized to provide picker candidates.
Latest-wins guard for async candidate fetches. Each open_async mints a fresh
reference; a result whose revision doesn't match the live picker's is stale and
dropped. A newer search, project switch, or reopen supersedes older in-flight
fetches.
Async loading status for sources that fetch candidates in the background.
Latest native query edit accepted by the BEAM.
Correlation generation for native full-query editing.
Source-switch state for the picker currently shown.
Source metadata installed by a picker source transition.
Functions
Installs an accepted native query and advances its acknowledgement.
Mints a fresh fetch revision and marks the picker as loading.
Starts a fresh native query-editing generation.
Accepts normalized candidates for the current asynchronous fetch.
Returns whether revision is the picker's current (live) fetch revision.
Returns whether a native query edit belongs to this picker and is newer than its acknowledgement.
Records a user-visible failure for the current asynchronous fetch.
Builds the semantic state for an asynchronous picker before fetching starts.
Returns the visible prefix for a switched source.
Returns true if a picker is currently open.
Returns whether this picker is semantically owned by a contribution source.
Returns a picker state with updated source context.
Retargets an open picker while retaining its session-owned fields.
Updates the inner MingaEditor.UI.Picker instance.
Types
@type callback_source() :: Minga.Extension.ContributionCleanup.contribution_source() | nil
Contribution source semantically authorized to provide picker candidates.
@type fetch_revision() :: reference() | nil
Latest-wins guard for async candidate fetches. Each open_async mints a fresh
reference; a result whose revision doesn't match the live picker's is stale and
dropped. A newer search, project switch, or reopen supersedes older in-flight
fetches.
@type load_status() :: :ready | :loading | {:error, String.t()}
Async loading status for sources that fetch candidates in the background.
@type query_edit_seq() :: non_neg_integer()
Latest native query edit accepted by the BEAM.
@type query_generation() :: non_neg_integer()
Correlation generation for native full-query editing.
Source-switch state for the picker currently shown.
@type source_target() :: {module(), callback_source(), MingaEditor.UI.Picker.Source.layout()}
Source metadata installed by a picker source transition.
@type source_transition() :: {:switch, String.t()} | :restore
@type t() :: %MingaEditor.State.Picker{ acknowledged_query_edit_seq: query_edit_seq(), action_menu: action_menu(), callback_source: callback_source(), context: map() | nil, fetch_revision: fetch_revision(), layout: MingaEditor.UI.Picker.Source.layout(), load_status: load_status(), picker: MingaEditor.UI.Picker.t() | nil, query_generation: query_generation(), restore: non_neg_integer() | nil, restore_theme: MingaEditor.UI.Theme.t() | nil, source: module() | nil, source_switch: source_switch() }
Functions
@spec accept_query_edit(t(), MingaEditor.UI.Picker.t(), query_edit_seq()) :: t()
Installs an accepted native query and advances its acknowledgement.
Mints a fresh fetch revision and marks the picker as loading.
Call this when starting an async candidate fetch. The returned {ps, revision}
tuple lets the caller tag the off-path fetch with revision so a stale result
(one whose revision no longer matches the live picker) can be dropped.
Starts a fresh native query-editing generation.
@spec complete_fetch(t(), MingaEditor.UI.Picker.t()) :: t()
Accepts normalized candidates for the current asynchronous fetch.
@spec current_fetch?(t(), fetch_revision()) :: boolean()
Returns whether revision is the picker's current (live) fetch revision.
@spec current_query_edit?(t(), query_generation(), query_edit_seq()) :: boolean()
Returns whether a native query edit belongs to this picker and is newer than its acknowledgement.
Records a user-visible failure for the current asynchronous fetch.
@spec loading( MingaEditor.UI.Picker.t(), module(), callback_source(), non_neg_integer() | nil, MingaEditor.UI.Theme.t() | nil, map() | nil, MingaEditor.UI.Picker.Source.layout() ) :: t()
Builds the semantic state for an asynchronous picker before fetching starts.
Returns the visible prefix for a switched source.
Returns true if a picker is currently open.
@spec owned_by?(t(), callback_source()) :: boolean()
Returns whether this picker is semantically owned by a contribution source.
Returns a picker state with updated source context.
@spec retarget(t(), MingaEditor.UI.Picker.t(), source_target(), source_transition()) :: t()
Retargets an open picker while retaining its session-owned fields.
@spec update_picker(t(), MingaEditor.UI.Picker.t()) :: t()
Updates the inner MingaEditor.UI.Picker instance.