MingaEditor.UI.NotificationCenter (Minga v0.1.0)

Copy Markdown View Source

Ordered collection of active editor notifications.

The editor owns this model. Frontends receive full snapshots and report user actions back by notification id and action id.

Summary

Functions

Finds an inline action on a notification.

Dismisses one notification without affecting unrelated notifications.

Dismisses only when the notification's stored timer ref matches.

Finds a notification by id.

Returns notifications in display order, oldest first.

Creates an empty notification center.

Updates an existing notification or inserts a new one when the id is unknown.

Adds or replaces a notification by id while preserving its original position.

Types

t()

@type t() :: %MingaEditor.UI.NotificationCenter{
  items: [MingaEditor.UI.Notification.t()]
}

Functions

action(center, notification_id, action_id)

@spec action(t(), String.t(), String.t()) ::
  MingaEditor.UI.Notification.Action.t() | nil

Finds an inline action on a notification.

dismiss(center, id)

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

Dismisses one notification without affecting unrelated notifications.

dismiss(center, id, dismiss_ref)

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

Dismisses only when the notification's stored timer ref matches.

find(notification_center, id)

@spec find(t(), String.t()) :: MingaEditor.UI.Notification.t() | nil

Finds a notification by id.

list(notification_center)

@spec list(t()) :: [MingaEditor.UI.Notification.t()]

Returns notifications in display order, oldest first.

new()

@spec new() :: t()

Creates an empty notification center.

update(center, notification)

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

Updates an existing notification or inserts a new one when the id is unknown.

upsert(center, notification)

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

Adds or replaces a notification by id while preserving its original position.