Prompt editing and chat display state.
Holds the data for the agent prompt (buffer, history, cursor, paste blocks)
and chat display (scroll, spinner, model config, display offset). This is
the "panel" half of the agent UI, separated from layout/search/preview
concerns in UIState.View.
Most callers interact through UIState functions rather than accessing
this struct directly.
Summary
Types
A collapsed paste block. Stores the original text and whether the block is currently expanded for editing.
Prompt editing and chat display state.
Functions
Increments the message version counter. Used to invalidate the GUI fingerprint cache when message content changes (collapse toggles, new messages, etc.).
Replaces cached styled transcript runs without changing the display window.
Replaces cached transcript projection data after a transcript sync.
Clears the active file mention completion.
Clears any pending provenance jump (e.g. when the user sends a new prompt).
Clears cached transcript projection data when there is no displayable transcript.
Refreshes stale unqualified model names to the current credential-aware default.
Refreshes stale unqualified model names from a specific options server.
Creates a new panel state with truthful model defaults.
Sets whether any provider credential is configured (drives the model indicator).
Sets the active model name.
Arms a pending provenance jump (Enter from a code-provenance popup).
Sets the displayed provider name.
Stores semantic scroll state for the agent transcript panel.
Types
A collapsed paste block. Stores the original text and whether the block is currently expanded for editing.
@type rendered_message() :: %{ styled_lines: MingaEditor.Agent.MarkdownHighlight.styled_lines() | nil, markdown_blocks: [Minga.RenderModel.UI.AgentChat.MarkdownBlock.t()] | nil }
@type styled_cache() :: [rendered_message() | nil] | nil
@type t() :: %MingaEditor.Agent.UIState.Panel{ cached_display_message_pairs: [{pos_integer(), term()}], cached_display_messages: [term()], cached_line_index: [ {non_neg_integer(), MingaEditor.Agent.Transcript.line_type()} ], cached_styled_fingerprint: non_neg_integer() | nil, cached_styled_messages: styled_cache(), credentials_configured: boolean(), display_start_index: non_neg_integer(), history_index: integer(), input_focused: boolean(), mention_completion: MingaAgent.FileMention.completion() | nil, message_version: non_neg_integer(), model_name: String.t(), pasted_blocks: [paste_block()], prompt_buffer: pid() | nil, prompt_history: [String.t()], provenance_jump: MingaEditor.Agent.ProvenanceJump.t() | nil, provider_name: String.t(), scroll: Minga.Editing.Scroll.t(), spinner_frame: non_neg_integer(), thinking_level: String.t(), visible: boolean() }
Prompt editing and chat display state.
Functions
Increments the message version counter. Used to invalidate the GUI fingerprint cache when message content changes (collapse toggles, new messages, etc.).
@spec cache_styled_messages(t(), styled_cache(), non_neg_integer() | nil) :: t()
Replaces cached styled transcript runs without changing the display window.
@spec cache_transcript_display( t(), MingaEditor.Agent.Transcript.display_result(), styled_cache(), keyword() ) :: t()
Replaces cached transcript projection data after a transcript sync.
Clears the active file mention completion.
Clears any pending provenance jump (e.g. when the user sends a new prompt).
Clears cached transcript projection data when there is no displayable transcript.
Refreshes stale unqualified model names to the current credential-aware default.
@spec ensure_configured_model(t(), Minga.Config.Options.server()) :: t()
Refreshes stale unqualified model names from a specific options server.
@spec new() :: t()
Creates a new panel state with truthful model defaults.
Sets whether any provider credential is configured (drives the model indicator).
Sets the active model name.
@spec set_provenance_jump(t(), MingaEditor.Agent.ProvenanceJump.t() | nil) :: t()
Arms a pending provenance jump (Enter from a code-provenance popup).
Sets the displayed provider name.
@spec set_scroll(t(), Minga.Editing.Scroll.t()) :: t()
Stores semantic scroll state for the agent transcript panel.
@spec styled_cache_fingerprint(map() | nil) :: non_neg_integer()