MingaEditor.State.ModalOverlay.Conflict (Minga v0.1.0)

Copy Markdown View Source

Modal-overlay payload for the conflict prompt.

The conflict prompt asks the user to resolve a buffer/disk conflict. It is bound to a specific buffer process; owner carries that buffer pid so the modal can be auto-dismissed when its buffer dies or the user switches away.

Before #1425 the conflict prompt lived as state.workspace.pending_conflict = {buffer_pid, prompt_text}. This payload preserves that pair while making the metadata explicit.

Summary

Functions

Builds a conflict payload from the legacy {buffer_pid, message} tuple.

Returns the legacy {buffer, message} tuple shape.

Types

owner()

@type owner() :: pid()

t()

@type t() :: %MingaEditor.State.ModalOverlay.Conflict{
  buffer: pid(),
  message: String.t(),
  opened_at: integer(),
  owner: owner()
}

Functions

new(buffer, message, opts \\ [])

@spec new(pid(), String.t(), keyword()) :: t()

Builds a conflict payload from the legacy {buffer_pid, message} tuple.

The owner is set to the buffer pid; callers can override via opts.

to_legacy(conflict)

@spec to_legacy(t()) :: {pid(), String.t()}

Returns the legacy {buffer, message} tuple shape.