MingaEditor.State.Feedback (Minga v0.1.0)

Copy Markdown View Source

Cross-shell user feedback owned by the Editor.

Native notifications and long-running operation feedback share lifecycle at the editor boundary while shell-specific notices and overlays remain in the active shell state.

Summary

Functions

Commits operation feedback produced by its focused owner.

Dismisses a native notification by id.

Dismisses a notification only when its timer correlation still matches.

Finishes an active operation in the owned operation feedback.

Applies a scheduler-authored queued transition to the owned operation feedback.

Applies a running transition to the owned operation feedback.

Adds or replaces a native notification.

Types

t()

@type t() :: %MingaEditor.State.Feedback{
  notifications: MingaEditor.UI.NotificationCenter.t(),
  operation_feedback: MingaEditor.State.OperationFeedback.t()
}

Functions

accept_operation_feedback(feedback, operations)

@spec accept_operation_feedback(t(), MingaEditor.State.OperationFeedback.t()) :: t()

Commits operation feedback produced by its focused owner.

dismiss_notification(feedback, id)

@spec dismiss_notification(t(), String.t()) :: t()

Dismisses a native notification by id.

dismiss_notification(feedback, id, dismiss_ref)

@spec dismiss_notification(t(), String.t(), reference()) :: t()

Dismisses a notification only when its timer correlation still matches.

finish_operation(feedback, id, status, message)

Finishes an active operation in the owned operation feedback.

queue_operation(feedback, id, message, position, total)

@spec queue_operation(
  t(),
  MingaEditor.State.Operation.id(),
  String.t(),
  integer(),
  integer()
) ::
  {:ok, t()} | {:error, MingaEditor.State.OperationQueue.error()}

Applies a scheduler-authored queued transition to the owned operation feedback.

run_operation(feedback, id, message)

@spec run_operation(t(), MingaEditor.State.Operation.id(), String.t()) :: t()

Applies a running transition to the owned operation feedback.

upsert_notification(feedback, notification)

@spec upsert_notification(t(), MingaEditor.UI.Notification.t()) :: t()

Adds or replaces a native notification.