facett-console (§8 TYPE-3, interactive) — a themed terminal/shell
component: a fixed monospace cell grid, a block/beam cursor, optional
ANSI colour mapped to the palette, scrollback on the CygnusEd
smooth-scroll engine (§11), plus the real terminal gestures — command
entry, history recall, scrolling, and per-line selection. A [Facet]:
themeable · resizable · scalable · copyable · pasteable · searchable ·
selectable.
FC contract (the canonical Elm split, FC-2 / FC-9)
- [
ConsoleModel] — the complete observable, serializable, round-trippable state: the scrollback (each line carrying a stable id, FC-5), the prompt + in-progress input, the smooth-scroll offset, the command history, and the selected line. [Console::state] hands back a&ConsoleModel. - [
Msg] + [Console::update] — the single mutation path (FC-2): every gesture (type / backspace / submit / history / scroll / select / filter) and every host push flow through it, so a headless driver ([facett_core::harness]) reaches the identical transitions the canvas does. - [
Console::view] — a pure paint (FC-9): it reads&self, paints the scrollback + prompt, and returns the [Msg]s the interactions produced; theimpl_facet_via_elm!bridge applies them. - [
Effect::RunCommand] — side work as data (FC-8): submitting a line echoes it and asks the host to run the command. The console performs no I/O itself; it hands the command back and the host feeds output via [Msg::PushLine]. - Rich
state_json— the observablelinesis published as a count (not the raw span array) and the scroll offset/extent as flat keys, so the macro is invoked in form 3 (custom_state_json) to preserve those exact keys.