v0.1.0-next

v0.1.0 — prerelease

Unreleased

This version is a draft tracked on main and not yet tagged. The API is expected to change before the release.

The first draft of the widget library: a model-update-view loop, a renderable node tree and two widgets.

Added

Flow

  • Cmd — the attribute describing a side effect, with NoCmd for no work and BatchCmd for running several commands in sequence.
  • Widget — the attribute pairing an update and a view function.
  • Step — the result of an update: the next widget plus the command to run.
  • View — the union of a nested widget and a node.

See Flow for the full reference.

Nodes

  • Node — the attribute describing an element in the rendered tree.
  • Text, Foreground and Background — the initial node types, with colors accepted as ColorLike from colors.

See Nodes for the full reference.

Widgets

  • label — displays a fixed string and ignores every message.
  • textinput — collects typed text, handling KeyPressMsg and SetValueMsg.

See Label and Text Input for the full reference.

Known issues

  • label.new declares a Label return type but returns a Model; Label does not exist.
  • textinput.view renders m.value in its empty branch, so placeholder is never drawn.
  • textinput.view calls node.Foreground("grey", [node.Text(m.value)]) with two arguments and a String color, while Foreground takes a single ColorLike field. A source comment marks the color as pending a theme.
  • Text, Foreground and Background carry @Tag rather than @Node, and Tag is not defined in this repository.
  • label imports flow, textinput imports ui.flow, and both flow.Step and bare Step are used within a single function.
  • Neither label nor textinput imports the node module they reference by prefix.