MailglassAdmin.Preview.AssignsForm (MailglassAdmin v1.0.0)

Copy Markdown View Source

Type-inferred assigns form per 05-UI-SPEC ยง"Assigns form โ€” type-inferred fields" (lines 354-368) + 05-RESEARCH.md lines 1470-1571.

Walks the scenario defaults map and renders an input per key dispatched by the Elixir type of the default value:

TypeInput
binary (String)<input type="text">
integer<input type="number" step="1">
float<input type="number" step="any">
boolean<input type="checkbox">
atomdisabled text input (v0.1 โ€” URL edit only)
DateTime<input type="datetime-local">
Date<input type="date">
struct<textarea> JSON (struct label)
map<textarea> JSON (plain map)
fallbackdisabled <input> "(unsupported type)"

Form fires phx-change="assigns_changed" on every field edit; the LiveView re-calls the mailable function with updated assigns and pipes through Mailglass.Renderer.render/1.

Action buttons use the verb+noun copy locked in 05-UI-SPEC Copywriting Contract lines 453-458: "Render preview" + "Reset assigns". The voice test greps the rendered HTML for these exact strings.

Boundary classification: submodule auto-classifies into the MailglassAdmin root boundary.

Summary

Functions

Renders the assigns form for the current scenario.

Functions

assigns_form(assigns)

(since 0.1.0)

Renders the assigns form for the current scenario.

Attributes

  • scenario_assigns (:map) (required)

field(assigns)

Attributes

  • key (:atom) (required)
  • value (:any) (required)