|
Portals0.7.0 · dev (544a5c68c72e · 2026-11-28 UTC)
|
portals_editor_history is a compact interactive example of the installed public API (source). It owns a lazy ui::Scene with three editors and read-only views of their published models. The models start at base; draft and model rows are deliberately separate so deferred confirmation is visible.
Build and run from a normal configured source build:
With a multi-configuration generator, pass --config Debug and use its Debug executable subdirectory. On Unix run the executable without the .exe suffix. The example needs approximately 80 columns and 24 rows; smaller terminals clip the ordinary layout.
| Mode | Select | Visible draft | Published model |
|---|---|---|---|
| IMMEDIATE, real default | F5 | Changes as you type or Undo/Redo | Changes immediately |
| ON_COMPLETION | F6 | Changes immediately | Changes on blur or Enter |
| EXPLICIT, explicit option | F7 | Changes immediately and survives blur | Changes on Enter |
Each model row is another bound LineEdit with readOnly=true and history disabled. You can select its text, but typing and Undo/Redo cannot change it. Read-only permits Copy at the binding boundary; this example supplies no system clipboard service. The main editable fields keep the ordinary history budgets and shortcuts.
The last-result row describes draft changes, publication and cancellation in plain language. No numeric status codes are required to use the example. The example has no system clipboard adapter; it demonstrates the existing read-only selection policy without adding a clipboard service.
Developer testing and headless replay.
Checked errors and ownership
Factory and configure callbacks return typed results to the scene collector. The native entry point uses demo.scene() | ui::reportOnError() | ui::runApp(argc, argv, ui::lyra::cli(...)). Lyra preflight completes before mounting or terminal acquisition. The standard runner restores the terminal and reports failures; typed setup, input and cleanup failures return a nonzero status. Recoverable errors retained by the collector do not by themselves change a successful run to a failure exit status.
Undo/Redo callbacks return EditorCommandResult intact, preserving collector provenance. Append uses field.text() += "!"; the text proxy records failures in the same collector. The last-result display explains editor and notification outcomes without retrying a committed mutation. A failure updating that display returns its original typed error.
The stationary Demo outlives callbacks borrowing it. Its scene() accessor supports additional application bindings; rows() exposes observing editor and model handles after preparation. Controls and model storage belong to the scene. The finite test harness wraps this actual demo and checks diagnostics separately; it does not duplicate the interface or alter the native entry point. See editor history, LineEdit, text properties and diagnostics.