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

Copy Markdown View Source

Modal-overlay payload for the dashboard home screen.

Wraps the existing MingaEditor.Dashboard.state() map (cursor + items) with the metadata every ModalOverlay variant carries. The dashboard is global UX, so owner defaults to :global.

Scoped to the Traditional shell. Shell.Board.State declares dashboard: nil in its typespec because Board does not surface the dashboard; opening this variant while the active shell is Board would violate that type. Callers that want a dashboard-style affordance on Board should add a Board-specific variant rather than reusing this one.

Summary

Functions

Builds a dashboard payload wrapping the given dashboard state map.

Replaces the inner dashboard state on the payload, preserving owner and opened_at. The only sanctioned way to update the inner state from outside this module (Rule 2: state ownership).

Types

owner()

@type owner() :: term()

t()

@type t() :: %MingaEditor.State.ModalOverlay.Dashboard{
  opened_at: integer(),
  owner: owner(),
  state: MingaEditor.Dashboard.state()
}

Functions

new(state, opts \\ [])

@spec new(
  MingaEditor.Dashboard.state(),
  keyword()
) :: t()

Builds a dashboard payload wrapping the given dashboard state map.

put_state(payload, state)

@spec put_state(t(), MingaEditor.Dashboard.state()) :: t()

Replaces the inner dashboard state on the payload, preserving owner and opened_at. The only sanctioned way to update the inner state from outside this module (Rule 2: state ownership).