MingaEditor.Shell.Traditional.Notice (Minga v0.1.0)

Copy Markdown View Source

Pure lifecycle owner for the traditional shell's ordinary status notice.

The monotonic identity survives dismissal so a stale timeout can never dismiss a later notice. The timer handle is bookkeeping only and is not the notice identity.

Summary

Functions

Acknowledges the current notice before keyboard command dispatch.

Dismisses the current notice explicitly.

Returns whether an ordinary notice is currently present.

Publishes a latest-wins notice and advances its semantic identity.

Records the timer handle only when it belongs to the current identity.

Expires the notice only when the delivered semantic identity matches.

Types

id()

@type id() :: non_neg_integer()

t()

@type t() :: %MingaEditor.Shell.Traditional.Notice{
  id: id(),
  message: String.t() | nil,
  timer: reference() | nil
}

Functions

acknowledge(notice)

@spec acknowledge(t()) :: t()

Acknowledges the current notice before keyboard command dispatch.

dismiss(notice)

@spec dismiss(t()) :: t()

Dismisses the current notice explicitly.

present?(notice)

@spec present?(t()) :: boolean()

Returns whether an ordinary notice is currently present.

publish(notice, message)

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

Publishes a latest-wins notice and advances its semantic identity.

record_timer(notice, id, timer)

@spec record_timer(t(), id(), reference()) :: t()

Records the timer handle only when it belongs to the current identity.

timeout(notice, id)

@spec timeout(t(), id()) :: t()

Expires the notice only when the delivered semantic identity matches.