Core Commands

CmdUiApplyOps

Applies a batch of declarative operations to a UiDocument.

Arguments

Field Type Description
documentId u32 Logical UI document ID
version u64 Monotonic batch version
ops UiOp[] Operations (add/remove/clear/set/move)

UiOp

  • add { parent?, node, index? }
  • remove { nodeId }
  • clear { parent? }
  • set { nodeId, props }
  • move { nodeId, newParent?, index? }

UiNode

Field Type Description
id u32 Node ID
kind UiNodeKind Node type
props UiNodeProps Type payload
tooltip Option Tooltip
contextMenu Option<Vec> Declarative context menu
anim Option Animations (opacity, translateY)
display Option Removes from layout/hit-test when false
visible Option Invisible and non-interactive when false
opacity Option Opacity multiplier
zIndex Option Z-order in the document

UiNodeKind

container, window, panel, split-pane, area, frame, scroll-area, grid, popup, tooltip, modal, resize, scene, canvas, text, rich-text, link, hyperlink, button, checkbox, radio, selectable-label, toggle, slider, drag-value, progress-bar, combo-box, menu-button, collapsing-header, image-button, spinner, text-edit, input, image, widget-realm-viewport, separator, spacer.

See UiNodeProps details in docs/ui/WIDGETS.md and src/core/ui/types.rs.

Response

Returns CmdResultUiApplyOps:

Field Type Description
success bool Batch applied successfully
message String Status or error
version Option Stored version (or current version on version error)

Validation

  • documentId must exist.
  • version must be greater than the current document version.
  • If any operation fails:
    • the core rolls back the entire document batch;
    • the response returns success = false.
Documentation Vulfram Core