Portals0.7.0 · dev (544a5c68c72e · 2026-11-28 UTC)
Loading...
Searching...
No Matches
portals::ManagedScene Class Referencefinal

Additive lifecycle owner over one existing Application subtree. UI affine and nonmovable. Application/tree/router/scheduler must outlive this owner. Destroy outside callbacks and tree frames; self/ancestor node removal in callbacks is supported. Standard controls retain their existing binding and LineEdit semantics. Use run() to preserve detailed managed failures alongside runner and restoration errors. No raw owning Property or individual binding token escapes this owner. More...

#include <managed.hpp>

Inheritance diagram for portals::ManagedScene:
portals::ManagedSceneportals::ManagedScene portals::ApplicationScene

Public Member Functions

 ~ManagedScene ()
 Retire bindings and the owned subtree on UI; wrong-thread/frame destruction terminates.
 ManagedScene (const ManagedScene &)=delete
ManagedScene & operator= (const ManagedScene &)=delete
Node< Widget > root () const noexcept
WidthPolicy widthPolicy () const noexcept
std::expected< ManagedSource< GraphemeText >, ManagedError > liveText (const ui::TextSource &source, PropertyOptions options={}, std::source_location origin=std::source_location::current())
 Attach a readonly node-scoped source to a published caption, draft or accepted editor value.
std::expected< void, ManagedError > remove (Node< Widget > node)
 Retire one managed subtree and immediately reclaim its managed entry budget.
template<class T, class... Args>
requires std::derived_from<T, Widget>
std::expected< Node< T >, ManagedError > emplace (Node< Widget > parent, Args &&...args)
 Checked mount with automatic standard presentation and style registration. Failure retires only the attempted child; earlier children remain owned. Destroying the scene on a failed form construction cleans the entire partial form.
std::expected< Node< LogView >, ManagedError > logView (Node< Widget > parent, std::string_view initial={}, LogViewConfig config={}, ControlStyle style={}, SizePolicy policy=DEFAULT_LOG_VIEW_POLICY, std::optional< FrameOptions > frame={})
std::expected< LogAppendReceipt, ManagedError > appendLogBatch (Node< LogView > node, std::string_view bytes)
std::expected< void, ManagedError > setLogModel (Node< LogView > node, ui::LogSource source)
std::expected< void, ManagedError > followLogTail (Node< LogView > node)
std::expected< void, ManagedError > clearLog (Node< LogView > node)
std::expected< LogStatus, ManagedError > logStatus (Node< LogView > node)
std::expected< Node< ScrollBar >, ManagedError > scrollBar (Node< Widget > parent, std::shared_ptr< ScrollController > controller={}, ScrollAxis axis=ScrollAxis::VERTICAL, ScrollBarOptions options={}, ControlStyle style={}, bool geometryWriter=true)
std::expected< void, ManagedError > setScrollOffset (Node< Widget > node, ScrollAxis axis, ScrollOffset offset)
std::expected< void, ManagedError > setScrollMetrics (Node< ScrollBar > node, ScrollAxisMetrics metrics)
std::expected< void, ManagedError > ensureVisible (Node< Widget > node, Node< Widget > root={})
template<std::equality_comparable T>
std::expected< ManagedState< T >, ManagedError > state (T initial, Invalidation kind=Invalidation::PAINT, PropertyOptions options={})
 Create UI-owned state with guaranteed dirty-frame recovery of missed notifications.
std::expected< NumericState, ManagedError > numericState (double initial=0, NumericRange range={})
template<class W, std::equality_comparable T, class Callback>
requires std::copy_constructible<std::decay_t<Callback>> && (std::same_as<std::invoke_result_t<Callback &, const T &>, void> ||
std::same_as<std::invoke_result_t<Callback &, const T &>, std::expected<void, TreeError>>)
std::expected< void, ManagedError > observe (Node< W > receiver, ManagedState< T > model, Callback &&callback)
 Own a one-way presentation observer until its receiver or scene retires. Initial delivery reads the latest value at dirty preparation after complete declarative mount. Later queued revisions may coalesce. Callbacks borrow an immutable value only for their invocation; captures must not destroy this scene. Equal updates do not deliver again. Registration never invokes user code.
template<std::equality_comparable T, class Callback>
requires std::copy_constructible<std::decay_t<Callback>> && (std::same_as<std::invoke_result_t<Callback &, const T &>, void> ||
std::same_as<std::invoke_result_t<Callback &, const T &>, std::expected<void, TreeError>>)
std::expected< void, ManagedError > observe (ManagedState< T > model, Callback &&callback)
template<class W, std::equality_comparable T, class Callback>
requires std::copy_constructible<std::decay_t<Callback>> && (std::same_as<std::invoke_result_t<Callback &, const T &>, void> ||
std::same_as<std::invoke_result_t<Callback &, const T &>, std::expected<void, TreeError>>)
std::expected< void, ManagedError > observe (Node< W > receiver, ManagedSource< T > source, Callback &&callback)
template<std::equality_comparable T, class Callback>
requires std::copy_constructible<std::decay_t<Callback>> && (std::same_as<std::invoke_result_t<Callback &, const T &>, void> ||
std::same_as<std::invoke_result_t<Callback &, const T &>, std::expected<void, TreeError>>)
std::expected< void, ManagedError > observe (ManagedSource< T > source, Callback &&callback)
template<std::equality_comparable In, class Transform>
requires detail::ManagedDerivation<Transform, In>
std::expected< ManagedSource< detail::DerivedOutput< Transform, In > >, ManagedError > derive (ManagedState< In > input, Transform &&transform, Invalidation kind=Invalidation::PAINT, PropertyOptions options={}, std::source_location origin=std::source_location::current())
 Create an owning read-only computation using the existing observer runtime.
template<std::equality_comparable In, class Transform>
requires detail::ManagedDerivation<Transform, In>
std::expected< ManagedSource< detail::DerivedOutput< Transform, In > >, ManagedError > derive (ManagedSource< In > input, Transform &&transform, Invalidation kind=Invalidation::PAINT, PropertyOptions options={}, std::source_location origin=std::source_location::current())
std::expected< void, ManagedError > onClick (Node< Button > node, std::function< std::expected< void, TreeError >()> action)
template<class Callback>
requires detail::ManagedAction<Callback, ClickEvent>
std::expected< void, ManagedError > onClick (Node< Button > node, Callback action)
template<class Callback>
requires detail::ManagedAction<Callback, KeyEvent>
std::expected< void, ManagedError > onKey (KeyEvent chord, Callback action)
template<class Callback>
requires detail::ManagedAction<Callback, KeyEvent>
std::expected< KeyBinding, ManagedError > onKey (const KeySelection &selection, KeyInfo info, Callback action, std::source_location origin=std::source_location::current())
std::expected< KeyBindingsSnapshot, ManagedError > keyBindings ()
std::expected< void, ManagedError > setKeyCapabilities (KeyCapabilities capabilities)
template<class Value, class Callback>
requires std::same_as<std::remove_cvref_t<Value>, Shortcut> && detail::ManagedAction<Callback, KeyEvent>
std::expected< void, ManagedError > onKey (Value &&shortcut, Callback action, ShortcutBehavior behavior={}, ShortcutOptions options={}, std::source_location origin=std::source_location::current())
template<class Callback>
requires detail::ManagedAction<Callback, KeyEvent>
std::expected< void, ManagedError > onKey (const KeySelection &selection, Callback action, std::source_location origin=std::source_location::current())
std::expected< bool, ManagedError > checkedValue (Node< CheckBox > node)
std::expected< PropertyUpdate< bool >, ManagedError > setChecked (Node< CheckBox > node, bool value)
std::expected< void, ManagedError > bind (Node< CheckBox > node, ManagedState< bool > model, std::function< std::expected< void, TreeError >(CheckBoxResult)> changed={})
std::expected< ManagedState< RadioGroupValue >, ManagedError > radioState (std::span< const TextValue > captions, KeyTextResolver resolver={}, CollectionLimits limits={})
std::expected< ManagedState< RadioGroupValue >, ManagedError > radioState (std::span< const RadioOption > options, KeyTextResolver resolver={}, CollectionLimits limits={})
std::expected< ManagedState< RadioGroupValue >, ManagedError > radioState (std::initializer_list< std::string_view > captions)
std::expected< void, ManagedError > bind (Node< RadioGroup > node, ManagedState< RadioGroupValue > model, std::function< std::expected< void, TreeError >(RadioGroupResult)> changed={})
std::expected< RadioGroupValue, ManagedError > radioValue (Node< RadioGroup > node)
std::expected< PropertyUpdate< RadioGroupValue >, ManagedError > selectRadio (Node< RadioGroup > node, std::optional< RowId > id)
template<class Callback, class T>
requires (std::derived_from<T, RadioGroup> && std::copy_constructible<Callback> && detail::ChangeAction<Callback, RadioGroupValue>)
std::expected< void, ManagedError > onChange (Node< T > node, Callback callback, std::source_location origin=std::source_location::current())
std::expected< void, ManagedError > bind (Node< CheckBox > node, ManagedState< CheckState > model, std::function< std::expected< void, TreeError >(CheckStateResult)> changed={}, CheckBoxOptions options={})
template<class Callback, class T>
requires (std::derived_from<T, CheckBox> && std::copy_constructible<Callback> && (detail::ChangeAction<Callback, bool> ||
detail::ChangeAction<Callback, CheckState>))
std::expected< void, ManagedError > onChange (Node< T > node, Callback callback, std::source_location origin=std::source_location::current())
std::expected< void, ManagedError > bind (Node< Slider > node, NumericState model, std::function< std::expected< void, TreeError >(SliderResult)> changed={})
std::expected< void, ManagedError > bind (Node< SpinBox > node, NumericState model, LineEditOptions options={}, std::uint64_t pageSteps=10)
template<class Callback, class T>
requires ((std::derived_from<T, Slider> || std::same_as<T, SpinBox>) && std::copy_constructible<std::decay_t<Callback>> &&
(detail::ChangeValueAction<std::decay_t<Callback>, double> || requires(std::decay_t<Callback> &action, const
PropertyUpdate<NumericValue> &receipt) { { action(receipt) } -> detail::ManagedActionResult; }))
std::expected< void, ManagedError > onChange (Node< T > node, const Callback &callback, std::source_location origin=std::source_location::current())
template<class Callback, class T>
requires (std::derived_from<T, Slider> && std::copy_constructible<std::decay_t<Callback>> && detail::ManagedAction<std::decay_t
<Callback>, SliderOperationEvent>)
std::expected< void, ManagedError > onEditingFinished (Node< T > node, const Callback &callback, std::source_location origin=std::source_location::current())
std::expected< void, ManagedError > bind (Node< LineEdit > node, ManagedState< std::string > model, std::function< std::expected< void, TreeError >(LineEditResult)> result={}, std::shared_ptr< Clipboard > clipboard={}, std::function< bool(std::string_view)> validate={})
std::expected< void, ManagedError > bind (Node< Password > node, ManagedState< PasswordValue > model, std::function< std::expected< void, TreeError >(PasswordResult)> result={}, std::shared_ptr< Clipboard > clipboard={}, std::function< bool(SecretView)> validate={})
std::expected< PasswordValue, ManagedError > passwordValue (Node< Password > node) const
std::expected< void, ManagedError > setPasswordValue (Node< Password > node, PasswordValue value)
template<class Callback>
requires detail::ManagedAction<Callback, TextEditedEvent>
std::expected< void, ManagedError > onTextEdited (Node< LineEdit > node, Callback callback, std::source_location origin=std::source_location::current())
template<class Callback, class T>
requires (std::derived_from<T, LineEdit> && detail::ManagedAction<Callback, EditingFinishedEvent>)
std::expected< void, ManagedError > onEditingFinished (Node< T > node, Callback callback, std::source_location origin=std::source_location::current())
std::expected< void, ManagedError > bindText (Node< Control > node, ManagedState< std::string > model)
 Observe accepted text as a one-way caption, independently of the control's action.
std::expected< void, ManagedError > bindText (Node< Control > node, ManagedSource< std::string > source)
std::expected< void, ManagedError > focusScope (Node< Widget > node)
 Declare a nested focus scope; this scene owns its disconnect token.
std::expected< void, ManagedError > overlayHost (Node< OverlayHost > host, Node< Widget > body)
 Bind the scene's sole retained host to its exact ordinary body.
std::expected< void, ManagedError > dialog (Node< Dialog > node, Node< Widget > panel, Node< Widget > body)
 Register an initially hidden layer under the declared host.
std::expected< void, ManagedError > openDialog (Node< Widget > node)
 Open a ready registered layer; an already open layer is unchanged.
std::expected< void, ManagedError > dismissDialog (Node< Widget > node)
 Dismiss a layer; a closed layer is unchanged and callbacks never replay.
std::expected< bool, ManagedError > dialogOpened (Node< Widget > node)
std::expected< void, ManagedError > dialogAnchor (Node< Widget > node, Node< Widget > anchor, DialogPlacement placement)
 Set the body-only anchor before the first activation.
template<class Callback>
requires std::copy_constructible<Callback> && (std::same_as<std::invoke_result_t<Callback &, DialogDismissReason>, void> ||
std::same_as<std::invoke_result_t<Callback &, DialogDismissReason>, std::expected<void, TreeError>>)
std::expected< void, ManagedError > onDismiss (Node< Dialog > node, Callback callback)
std::expected< void, ManagedError > focusDefault (Node< Widget > node)
 Set a live managed node as its nearest scope's default.
std::expected< void, ManagedError > focus (Node< Widget > node)
 Enter a scope or focus an ordinary registered control through the same blur path.
std::expected< void, ManagedError > enterFocusScope (Node< Widget > node)
 Enter a declared scope while saving exact previous focus in the existing router. This focus-only operation does not restrict input or global Tab traversal.
std::expected< void, ManagedError > leaveFocusScope (Node< Widget > node)
 Leave the top focus-return scope; callback errors retain the published return.
template<class T>
std::expected< void, ManagedError > onEvent (Node< T > node, std::type_identity_t< ManagedEventHandler< T > > callback)
 Own one custom event callback, without subclassing or an additional router.
template<class T>
std::expected< void, ManagedError > onPrepare (Node< T > node, std::type_identity_t< ManagedPrepareHandler< T > > callback)
 Register custom presentation work at the existing dirty-frame boundary.
std::expected< void, ManagedError > style (Node< Widget > node, StyleTarget target)
std::expected< void, ManagedError > id (Node< Widget > node, std::string_view value)
std::expected< void, ManagedError > classes (Node< Widget > node, std::vector< std::string > values)
std::expected< void, ManagedError > theme (StyleSheet sheet)
std::expected< void, ManagedError > enableStyleLayers (StyleLayerOptions options={})
 Opt into owning style tiers; failure preserves pending registrations and legacy controllers.
std::expected< StyleLayerHandle, ManagedError > styleDocument (StyleTier tier, std::string_view name, const PssDocument &document, std::optional< StyleLayerOptions > options=std::nullopt)
 Atomically install owning declarations and provenance in an APPLICATION or USER layer.
std::expected< std::vector< StyleLayerSource >, ManagedError > styleSources () const
 Copy every actual layer row in installation order on the UI thread.
std::expected< void, ManagedError > validateStyleLayer (StyleLayerHandle handle) const
 Validate an observing layer identity without resolving styles or invoking callbacks.
std::expected< StyleLayerHandle, ManagedError > addLayer (StyleTier tier, std::string_view name, const StyleSheet &sheet)
std::expected< Invalidation, ManagedError > replaceLayer (StyleLayerHandle handle, const StyleSheet &sheet)
std::expected< Invalidation, ManagedError > removeLayer (StyleLayerHandle handle)
std::expected< Invalidation, ManagedError > updateLayers (std::span< const StyleLayerUpdate > updates)
std::expected< StyleLayerHandle, ManagedError > baseLayer (StyleTier tier) const
std::expected< Invalidation, ManagedError > styleDefaults (const StyleSheet &sheet)
std::expected< void, ManagedError > onInput (std::function< std::expected< bool, ManagedError >(const InputEvent &)> callback)
std::expected< void, TreeError > reportError (ManagedError failure, std::span< const ManagedDiagnosticContext > contexts={}, std::source_location origin=std::source_location::current()) noexcept
 Record an explicit error without changing runtime stop/recovery policy.
std::expected< void, ManagedError > onError (ManagedErrorHandler callback)
 Retain or clear the UI error observer; empty clears it.
std::expected< ManagedDiagnosticBatch, TreeError > diagnostics () const
 Copy the bounded error history on UI, including after close.
std::expected< void, TreeError > clearErrors () noexcept
 Clear history and counters while preserving capacity and runtime first failure.
std::expected< ManagedDiagnosticBatch, TreeError > drainErrors ()
 Copy then clear history and counters; allocation failure leaves them unchanged.
template<class T>
std::expected< ManagedModel< T >, ManagedError > model (std::shared_ptr< const ModelSnapshot< T > > initial, ModelOptions options={}, ManagedViewHandler< T > prepared={})
 Create a scene-owned model and a weak typed UI handle.
template<class Source>
requires detail::ManagedCollectionSource<Source>
std::expected< ManagedModel< typename detail::CollectionSource< std::remove_cvref_t< Source > >::Row >, ManagedError > model (Source &&source, CollectionModelOptions options={})
 Bind owning immutable rows to a fresh sink-only model using the existing UI transaction.
std::expected< ManagedNavigation, ManagedError > navigation (ModelResource resource, SourceStamp session, NavigationOptions options={})
std::expected< LogNavigation, ManagedError > logNavigation (LogCheckpointOptions options={})
template<class T>
std::expected< ManagedNavigation, ManagedError > navigation (ManagedModel< T > model, NavigationOptions options={})
template<class T>
std::expected< ManagedNavigation, ManagedError > navigation (ManagedModel< T > model, ModelResource resource, SourceStamp session, NavigationOptions options={})
template<class T>
std::expected< void, ManagedError > bindNavigation (Node< VirtualList< T > > node, ManagedNavigation navigation, NavigationBindingOptions options={})
template<class T>
std::expected< void, ManagedError > bindNavigation (Node< VirtualTable< T > > node, ManagedNavigation navigation, NavigationBindingOptions options={})
template<class T>
std::expected< Node< VirtualTable< T > >, ManagedError > virtualTable (Node< Widget > parent, ManagedModel< T > model, std::type_identity_t< std::span< const TableColumn< T > > > columns, VirtualTableOptions options={}, SizePolicy policy=DEFAULT_VIEWPORT_POLICY, std::type_identity_t< ManagedViewHandler< T > > prepared={})
 Mount a table with owned range, input binding, style and automatic preparation.
template<class T>
std::expected< Node< VirtualList< T > >, ManagedError > virtualList (Node< Widget > parent, ManagedModel< T > model, std::type_identity_t< ManagedListFormatter< T > > delegate, VirtualListOptions options={}, SizePolicy policy=DEFAULT_VIEWPORT_POLICY, std::type_identity_t< ManagedViewHandler< T > > prepared={})
 Mount a list with owned range, input binding, style and automatic preparation.
template<class T>
std::expected< void, ManagedError > setModel (Node< VirtualList< T > > node, ManagedModel< T > model, std::type_identity_t< std::optional< ManagedViewHandler< T > > > prepared=std::nullopt, ModelRebindOptions options={})
 Atomically replace a managed list's model without replacing its node or presentation.
template<class T>
std::expected< void, ManagedError > setModel (Node< VirtualTable< T > > node, ManagedModel< T > model, std::type_identity_t< std::optional< ManagedViewHandler< T > > > prepared=std::nullopt, ModelRebindOptions options={})
 Atomically replace a managed table's model, preserving columns, options and node identity.
template<class T>
std::expected< std::optional< PositionResolution >, ManagedError > restoreStatus (Node< VirtualList< T > > node) const
template<class T>
std::expected< std::optional< PositionResolution >, ManagedError > restoreStatus (Node< VirtualTable< T > > node) const
template<class T>
std::expected< Node< Chart< T > >, ManagedError > chart (Node< Widget > parent, ManagedModel< T > model, std::type_identity_t< ManagedChartAccessor< T > > accessor, ChartOptions options={}, ManagedChartOrigin first={}, std::type_identity_t< ManagedViewHandler< T > > prepared={}, SizePolicy policy=DEFAULT_VIEWPORT_POLICY)
 Mount a chart with owned range, style and automatic preparation.
std::expected< Node< Spinner >, ManagedError > spinner (Node< Widget > parent, SpinnerOptions options={}, ControlStyle style={}, SizePolicy policy=DEFAULT_CONTENT_POLICY, SpinnerLabelResolver resolver={})
bool usesPreparedLayout () const noexcept override
 Opt into bounded layout-driven view preparation; default is false.
bool usesGeometrySnapshot () const noexcept override
bool requiresPointerMotion () const noexcept override
std::expected< NodeGeometry, ManagedError > geometry (Node< Widget > node) const
 Read an owning final arranged value without performing layout or reporting errors.
template<class T>
std::expected< VisibleModelSnapshot< T >, VisibleModelError > visibleModelSnapshot (Node< VirtualTable< T > > node) const
 Read ready physical rows after successful final layout publication.
template<class Callback>
requires detail::ManagedAction<Callback, NodeGeometry>
std::expected< void, ManagedError > onLayout (Node< Widget > node, Callback callback, std::source_location origin=std::source_location::current())
std::expected< void, TreeError > completedLayout (Application &app) override
std::expected< void, TreeError > afterDispatch (Application &app) override
bool hasPendingLayout () const noexcept override
std::expected< void, TreeError > prepareViews (Application &app, const LayoutSnapshot &snapshot) override
 Prepare registered views from the pins captured by prepare(), in registration order.
bool requiresBackgroundExecutor () const noexcept override
std::expected< ApplicationStats, ManagedError > run (std::stop_token stop={})
std::expected< ApplicationStats, ManagedError > run (ApplicationTerminal &terminal, std::stop_token stop={})
std::expected< void, ManagedError > start (ApplicationReadyTerminal &terminal, std::stop_token stop={})
std::expected< ApplicationStep, ManagedError > step ()
std::expected< void, ManagedError > close ()
 Idempotently retire callbacks and subtree; properties survive until scene destruction. A facade-installed shutdown action runs once before root/model retirement. Its failure does not skip subtree cleanup; an independent tree cleanup failure is retained in the shutdown error's cleanup field.
std::expected< void, TreeError > prepare (Application &app, CellSize size) override
std::expected< bool, TreeError > input (Application &app, const InputEvent &event) override
void stop (Application &app) override
Public Member Functions inherited from portals::ApplicationScene
virtual ~ApplicationScene ()=default

Static Public Member Functions

static std::expected< std::unique_ptr< ManagedScene >, ManagedError > create (Application &app, ManagedOptions options={})

Friends

class KeyBinding
struct style::ct::detail::Access
struct ui::detail::Access
struct ui::detail::RowAccess
struct ui::detail::RefAccess
struct ui::detail::SceneAccess
struct ui::detail::ClickAccess
struct ui::detail::EditorEventAccess
struct ui::detail::ChangeAccess
struct ui::detail::NamedAccess
struct ui::detail::LayoutAccess
struct ui::detail::MessageAccess
struct ui::detail::NotificationAccess
class ui::NotificationCenter
struct ui::detail::KeyHelpAccess
struct ui::detail::ThemeSelectionAccess
struct ui::detail::ThemeSelectorAccess
struct ui::detail::ActionAccess
struct ui::detail::AsyncAccess
struct detail::ManagedScrollTestAccess
class ManagedNavigation

Detailed Description

Additive lifecycle owner over one existing Application subtree. UI affine and nonmovable. Application/tree/router/scheduler must outlive this owner. Destroy outside callbacks and tree frames; self/ancestor node removal in callbacks is supported. Standard controls retain their existing binding and LineEdit semantics. Use run() to preserve detailed managed failures alongside runner and restoration errors. No raw owning Property or individual binding token escapes this owner.

Member Function Documentation

◆ addLayer()

std::expected< StyleLayerHandle, ManagedError > portals::ManagedScene::addLayer ( StyleTier tier,
std::string_view name,
const StyleSheet & sheet )
Parameters
tierAPPLICATION or USER priority.
nameNonempty tier-unique name, copied after budget admission.
sheetBorrowed declarations, normalized into engine ownership on success.
Returns
Weak observer or atomic STYLE failure.

◆ afterDispatch()

std::expected< void, TreeError > portals::ManagedScene::afterDispatch ( Application & app)
overridevirtual
Parameters
appSame borrowed application used at creation.
Returns
Success after bounded pending-publication recovery or original typed failure.

Reimplemented from portals::ApplicationScene.

◆ appendLogBatch()

std::expected< LogAppendReceipt, ManagedError > portals::ManagedScene::appendLogBatch ( Node< LogView > node,
std::string_view bytes )
Parameters
nodeLive log.
bytesComplete borrowed batch.
Returns
Atomic receipt or exact typed error; never automatically reports a checked failure.

◆ baseLayer()

std::expected< StyleLayerHandle, ManagedError > portals::ManagedScene::baseLayer ( StyleTier tier) const
Parameters
tierDEFAULTS or THEME slot.
Returns
Weak observer or STYLE boundary/argument error.

◆ bind() [1/7]

std::expected< void, ManagedError > portals::ManagedScene::bind ( Node< CheckBox > node,
ManagedState< bool > model,
std::function< std::expected< void, TreeError >(CheckBoxResult)> changed = {} )
Parameters
nodeManaged checkbox without a prior event binding.
modelState created by this scene; shared internally on UI only.
changedOptional callback after the standard toggle, receiving its exact commit receipt.
Returns
Success or typed registration error. Returning an error cannot undo a committed toggle.

◆ bind() [2/7]

std::expected< void, ManagedError > portals::ManagedScene::bind ( Node< CheckBox > node,
ManagedState< CheckState > model,
std::function< std::expected< void, TreeError >(CheckStateResult)> changed = {},
CheckBoxOptions options = {} )
Parameters
nodeManaged checkbox without a prior event binding.
modelState created by this scene; shared internally on UI only.
changedOptional callback after the standard toggle, receiving its exact commit receipt.
optionsTyped activation cycle; invalid values return INVALID_ARGUMENT.
Returns
Success or typed registration error. Returning an error cannot undo a committed toggle.

◆ bind() [3/7]

std::expected< void, ManagedError > portals::ManagedScene::bind ( Node< LineEdit > node,
ManagedState< std::string > model,
std::function< std::expected< void, TreeError >(LineEditResult)> result = {},
std::shared_ptr< Clipboard > clipboard = {},
std::function< bool(std::string_view)> validate = {} )
Parameters
nodeManaged editor without a prior event binding.
modelState created by this scene.
resultOptional callback after standard editing/commit/conflict handling; cannot undo a commit.
clipboardExisting clipboard adapter retained by the binding, or null.
validateExisting commit validator; false rejects Enter without changing the model.
Returns
Success or typed registration error; draft, revision conflict, Escape and blur rules are unchanged.

◆ bind() [4/7]

std::expected< void, ManagedError > portals::ManagedScene::bind ( Node< Password > node,
ManagedState< PasswordValue > model,
std::function< std::expected< void, TreeError >(PasswordResult)> result = {},
std::shared_ptr< Clipboard > clipboard = {},
std::function< bool(SecretView)> validate = {} )
Parameters
nodeManaged protected editor without an existing action binding.
modelProtected state created by this scene; no plaintext snapshots are retained.
resultOptional owning result handler after native editing semantics.
clipboardOptional service used only by an explicitly enabled paste policy.
validateScoped plaintext predicate; false retains the protected draft.
Returns
Checked registration or complete typed protected failure.

◆ bind() [5/7]

std::expected< void, ManagedError > portals::ManagedScene::bind ( Node< RadioGroup > node,
ManagedState< RadioGroupValue > model,
std::function< std::expected< void, TreeError >(RadioGroupResult)> changed = {} )
Parameters
nodeManaged group without a prior binding.
modelAuthoritative state from this scene.
changedOptional exact user-operation receipt callback.
Returns
Checked binding admission.

◆ bind() [6/7]

std::expected< void, ManagedError > portals::ManagedScene::bind ( Node< Slider > node,
NumericState model,
std::function< std::expected< void, TreeError >(SliderResult)> changed = {} )
Parameters
nodeManaged slider without a prior event binding.
modelNumeric source created by this scene; the existing Property remains authoritative.
changedOptional legacy exact receipt callback, before compact user-change handlers.
Returns
Checked admission or typed failure; a completed numeric commit is never rolled back.

◆ bind() [7/7]

std::expected< void, ManagedError > portals::ManagedScene::bind ( Node< SpinBox > node,
NumericState model,
LineEditOptions options = {},
std::uint64_t pageSteps = 10 )
Parameters
nodeEmpty numeric row.
modelScene-owned authoritative numeric source.
optionsExisting editor policy; no independent editing state is introduced.
pageStepsPositive increments per page action.
Returns
Checked mount/binding result.

◆ bindNavigation() [1/2]

template<class T>
std::expected< void, ManagedError > portals::ManagedScene::bindNavigation ( Node< VirtualList< T > > node,
ManagedNavigation navigation,
NavigationBindingOptions options = {} )
Template Parameters
TImmutable row type shared with the bound list.
Parameters
nodeExisting managed list in this scene.
navigationScope-owned navigation context.
optionsExplicit projection and independent current/reading synchronization policy.
Returns
Checked binding admission; removing the view detaches only this adapter.

◆ bindNavigation() [2/2]

template<class T>
std::expected< void, ManagedError > portals::ManagedScene::bindNavigation ( Node< VirtualTable< T > > node,
ManagedNavigation navigation,
NavigationBindingOptions options = {} )
Template Parameters
TImmutable row type shared with the bound table.
Parameters
nodeExisting managed table in this scene.
navigationScope-owned navigation context.
optionsExplicit projection and independent current/reading synchronization policy.
Returns
Checked binding admission; keyboard focus remains local to the table.

◆ bindText() [1/2]

std::expected< void, ManagedError > portals::ManagedScene::bindText ( Node< Control > node,
ManagedSource< std::string > source )
inline
Parameters
nodeLive managed caption receiver.
sourceRead-only owning string source from this scene.
Returns
Existing caption binding result; updates are synchronized at dirty preparation.

◆ bindText() [2/2]

std::expected< void, ManagedError > portals::ManagedScene::bindText ( Node< Control > node,
ManagedState< std::string > model )

Observe accepted text as a one-way caption, independently of the control's action.

Parameters
nodeLive managed control without an existing caption binding.
modelText state created by this scene; ownership stays with the scene.
Returns
Success after initial synchronization, or typed validation/allocation error without attachment. Duplicate attachment returns INVALID_ARGUMENT. Changed revisions synchronize before dirty frames; failed synchronization preserves the caption and retries at the next dirty or explicit preparation. A manual caption change remains visible until the next changed model revision. No reverse write occurs.

◆ chart()

template<class T>
std::expected< Node< Chart< T > >, ManagedError > portals::ManagedScene::chart ( Node< Widget > parent,
ManagedModel< T > model,
std::type_identity_t< ManagedChartAccessor< T > > accessor,
ChartOptions options = {},
ManagedChartOrigin first = {},
std::type_identity_t< ManagedViewHandler< T > > prepared = {},
SizePolicy policy = DEFAULT_VIEWPORT_POLICY )

Mount a chart with owned range, style and automatic preparation.

Template Parameters
TImmutable row projected into an optional OHLC value.
Parameters
parentManaged parent; failure removes only the attempted child.
modelModel belonging to this scene.
accessorOwning OHLC projection; nullopt introduces a gap.
optionsExisting chart mode, width and glyph configuration.
firstOptional source of the first row; empty means zero. Runs in registration order.
preparedOptional view override after preparation; empty uses model-owned preparation. Pending work without either callback is rejected with INVALID_ARGUMENT.
policyOwning viewport constraints; explicit policies remain authoritative.
Returns
Observing node or typed mount/bind error; chart adds no input binding.

◆ checkedValue()

std::expected< bool, ManagedError > portals::ManagedScene::checkedValue ( Node< CheckBox > node)
Parameters
nodeManaged bool-bound checkbox or subtype.
Returns
Authoritative bool model value or checked owner/node/model-type failure; no reporting.

◆ classes()

std::expected< void, ManagedError > portals::ManagedScene::classes ( Node< Widget > node,
std::vector< std::string > values )
Parameters
nodeLive scene-owned node whose style classes are changed.
valuesOwning ordered class names; duplicates are preserved and empty clears classes.
Returns
Atomic STYLE metadata update or typed boundary/liveness/allocation error. Existing type, id, control identity and base types are preserved; no new subscription is retained. Argument construction or transfer may throw before entry, as with style().

◆ clearErrors()

std::expected< void, TreeError > portals::ManagedScene::clearErrors ( )
noexcept

Clear history and counters while preserving capacity and runtime first failure.

Returns
Success, WRONG_THREAD, or WOULD_BLOCK during onError; allowed after close.

◆ clearLog()

std::expected< void, ManagedError > portals::ManagedScene::clearLog ( Node< LogView > node)
Parameters
nodeLive log.
Returns
Clear result preserving ID history, without automatic reporting.

◆ close()

std::expected< void, ManagedError > portals::ManagedScene::close ( )

Idempotently retire callbacks and subtree; properties survive until scene destruction. A facade-installed shutdown action runs once before root/model retirement. Its failure does not skip subtree cleanup; an independent tree cleanup failure is retained in the shutdown error's cleanup field.

Returns
Success, WRONG_THREAD, WOULD_BLOCK during an active session, managed preparation/frame or close reentry, an exact facade shutdown failure, or tree cleanup error.

◆ completedLayout()

std::expected< void, TreeError > portals::ManagedScene::completedLayout ( Application & app)
overridevirtual
Parameters
appSame borrowed application used at creation.
Returns
Success after final observation publication or original typed failure.

Reimplemented from portals::ApplicationScene.

◆ create()

std::expected< std::unique_ptr< ManagedScene >, ManagedError > portals::ManagedScene::create ( Application & app,
ManagedOptions options = {} )
static
Parameters
appBorrowed existing runtime, used exclusively by this scene during run.
optionsPositive limits on managed entries and state ownership.
Returns
Owner of a newly mounted plain subtree, or typed allocation/mount error.

◆ derive() [1/2]

template<std::equality_comparable In, class Transform>
requires detail::ManagedDerivation<Transform, In>
std::expected< ManagedSource< detail::DerivedOutput< Transform, In > >, ManagedError > portals::ManagedScene::derive ( ManagedSource< In > input,
Transform && transform,
Invalidation kind = Invalidation::PAINT,
PropertyOptions options = {},
std::source_location origin = std::source_location::current() )
inline
Template Parameters
InOwning equality-comparable input value.
TransformCopyable pure owning computation with the writable input overload's contract.
Parameters
inputPreviously created read-only source; fresh outputs make declared dependency cycles unexpressible.
transformOwned synchronous computation.
kindOutput invalidation, PAINT or LAYOUT.
optionsPositive output Property observer capacity.
originDerivation registration retained in diagnostics.
Returns
Immediately readable source or unchanged typed creation failure.

◆ derive() [2/2]

template<std::equality_comparable In, class Transform>
requires detail::ManagedDerivation<Transform, In>
std::expected< ManagedSource< detail::DerivedOutput< Transform, In > >, ManagedError > portals::ManagedScene::derive ( ManagedState< In > input,
Transform && transform,
Invalidation kind = Invalidation::PAINT,
PropertyOptions options = {},
std::source_location origin = std::source_location::current() )

Create an owning read-only computation using the existing observer runtime.

Template Parameters
InOwning equality-comparable input value.
TransformCopyable pure function returning an owning Out or expected<Out, TreeError>.
Parameters
inputExisting source owned by this scene; its immutable value is borrowed during computation.
transformOwned synchronous computation; must not mutate UI or depend on Ref publication.
kindPAINT or LAYOUT invalidation for changed output; NONE is rejected.
optionsPositive existing output Property observer capacity.
originDerivation registration retained in failure diagnostics.
Returns
Immediately readable source, or checked initial error with no retained output/attachment. Runtime failures preserve the last good output and follow the existing managed stop policy.

◆ diagnostics()

std::expected< ManagedDiagnosticBatch, TreeError > portals::ManagedScene::diagnostics ( ) const

Copy the bounded error history on UI, including after close.

Returns
Owning snapshot, WRONG_THREAD, or NO_MEMORY with the history unchanged. Inspection is allowed during onError; its current observerFailed flag is not final yet.

◆ dialog()

std::expected< void, ManagedError > portals::ManagedScene::dialog ( Node< Dialog > node,
Node< Widget > panel,
Node< Widget > body )

Register an initially hidden layer under the declared host.

Parameters
nodeExact full-host dialog root.
panelIts sole opaque panel child.
bodyApplication content inside the panel.
Returns
Checked identity, budget, allocation or binding error.

◆ dialogAnchor()

std::expected< void, ManagedError > portals::ManagedScene::dialogAnchor ( Node< Widget > node,
Node< Widget > anchor,
DialogPlacement placement )

Set the body-only anchor before the first activation.

Parameters
nodeRegistered dialog root.
anchorOrdinary body descendant of the same host.
placementBELOW_START or ABOVE_START; CENTER ignores the anchor.
Returns
Checked identity/domain error; failure preserves the prior anchor.

◆ dialogOpened()

std::expected< bool, ManagedError > portals::ManagedScene::dialogOpened ( Node< Widget > node)
Parameters
nodeExact registered dialog root.
Returns
Effective activation, or exact affinity/lifetime/identity error without reporting.

◆ dismissDialog()

std::expected< void, ManagedError > portals::ManagedScene::dismissDialog ( Node< Widget > node)

Dismiss a layer; a closed layer is unchanged and callbacks never replay.

Parameters
nodeExact dialog root; only the top modal can be dismissed.
Returns
Checked admission or first postpublication callback error.

◆ drainErrors()

std::expected< ManagedDiagnosticBatch, TreeError > portals::ManagedScene::drainErrors ( )

Copy then clear history and counters; allocation failure leaves them unchanged.

Returns
Owning batch, WRONG_THREAD, WOULD_BLOCK during onError, or NO_MEMORY. Allowed after close. Does not reset a runtime first failure or change stop policy.

◆ emplace()

template<class T, class... Args>
requires std::derived_from<T, Widget>
std::expected< Node< T >, ManagedError > portals::ManagedScene::emplace ( Node< Widget > parent,
Args &&... args )
inline

Checked mount with automatic standard presentation and style registration. Failure retires only the attempted child; earlier children remain owned. Destroying the scene on a failed form construction cleans the entire partial form.

Template Parameters
TPublic Widget subtype constructible from Args; final classes are supported.
ArgsPerfect-forwarded constructor argument types.
Parameters
parentRoot or node created by this scene; low-level external children are not adopted.
argsConstructor arguments, borrowed only during construction.
Returns
Typed observer or mount/setup error; no child escapes a failed operation.

◆ enableStyleLayers()

std::expected< void, ManagedError > portals::ManagedScene::enableStyleLayers ( StyleLayerOptions options = {})

Opt into owning style tiers; failure preserves pending registrations and legacy controllers.

Parameters
optionsAggregate owning layer limits, fixed after successful opt-in.
Returns
Success or the original STYLE boundary, budget or staging error.

◆ ensureVisible()

std::expected< void, ManagedError > portals::ManagedScene::ensureVisible ( Node< Widget > node,
Node< Widget > root = {} )
Parameters
nodeLive managed descendant to reveal once.
rootOptional managed ancestor limiting the request; empty uses this scene root.
Returns
Checked identity/admission/allocation error, or a queued one-shot request. New explicit requests replace pending requests. Consumption requires successful final rendering.

◆ enterFocusScope()

std::expected< void, ManagedError > portals::ManagedScene::enterFocusScope ( Node< Widget > node)

Enter a declared scope while saving exact previous focus in the existing router. This focus-only operation does not restrict input or global Tab traversal.

Parameters
nodeLive eligible managed scope root, absent from the return stack.
Returns
Success or typed validation/allocation/callback error. Published entry errors retain the return record; leaveFocusScope can still restore focus after such an error.

◆ focus()

std::expected< void, ManagedError > portals::ManagedScene::focus ( Node< Widget > node)

Enter a scope or focus an ordinary registered control through the same blur path.

Parameters
nodeLive managed target; scope selection uses last/default/preorder fallback.
Returns
Success or typed validation/callback error. Published focus is not rolled back.

◆ focusDefault()

std::expected< void, ManagedError > portals::ManagedScene::focusDefault ( Node< Widget > node)

Set a live managed node as its nearest scope's default.

Parameters
nodeDefault descendant; hidden/disabled defaults are skipped on entry.
Returns
Success, INVALID_ARGUMENT without an enclosing scope, or typed validation error.

◆ focusScope()

std::expected< void, ManagedError > portals::ManagedScene::focusScope ( Node< Widget > node)

Declare a nested focus scope; this scene owns its disconnect token.

Parameters
nodeLive managed scope root, possibly also an ordinary bound control.
Returns
Success or the existing typed router/binding error; no token escapes.

◆ followLogTail()

std::expected< void, ManagedError > portals::ManagedScene::followLogTail ( Node< LogView > node)
Parameters
nodeLive log.
Returns
Resume-following result without automatic reporting.

◆ geometry()

std::expected< NodeGeometry, ManagedError > portals::ManagedScene::geometry ( Node< Widget > node) const

Read an owning final arranged value without performing layout or reporting errors.

Parameters
nodeFull identity of a managed widget in this scene.
Returns
Final geometry, or typed affinity/liveness/reentry/INVALID_GEOMETRY failure. Invalidation or any rearrangement revokes it until the next successful final frame.

◆ hasPendingLayout()

bool portals::ManagedScene::hasPendingLayout ( ) const
overridevirtualnoexcept
Returns
Whether this scene owns undelivered layout work; unrelated DATA does not extend EOF.

Reimplemented from portals::ApplicationScene.

◆ id()

std::expected< void, ManagedError > portals::ManagedScene::id ( Node< Widget > node,
std::string_view value )
Parameters
nodeLive scene-owned node whose style identity is changed.
valueCase-sensitive id copied during this call; existing type/classes are preserved.
Returns
Atomic metadata update or typed style/liveness/allocation error.

◆ input()

std::expected< bool, TreeError > portals::ManagedScene::input ( Application & app,
const InputEvent & event )
overridevirtual
Parameters
appThe same borrowed Application used at creation.
eventOwning input borrowed for this call only.
Returns
Whether interception consumed the event, or compatibility bridge error.

Reimplemented from portals::ApplicationScene.

◆ keyBindings()

std::expected< KeyBindingsSnapshot, ManagedError > portals::ManagedScene::keyBindings ( )
Returns
Independent owning DTO after existing focus recovery; may deliver existing focus callbacks. No action/resolver is invoked while constructing rows; never returns a stale projection.

◆ leaveFocusScope()

std::expected< void, ManagedError > portals::ManagedScene::leaveFocusScope ( Node< Widget > node)

Leave the top focus-return scope; callback errors retain the published return.

Parameters
nodeLive managed root matching the top stack record.
Returns
Success, INVALID_ARGUMENT for another root, or typed boundary/router error. Removed roots recover lazily through the router rather than through a stale managed reference.

◆ liveText()

std::expected< ManagedSource< GraphemeText >, ManagedError > portals::ManagedScene::liveText ( const ui::TextSource & source,
PropertyOptions options = {},
std::source_location origin = std::source_location::current() )

Attach a readonly node-scoped source to a published caption, draft or accepted editor value.

Parameters
sourceWeak text identity belonging to this scene; unpublished references return CLOSED.
optionsPositive Property observer capacity; sharing requires identical admitted options.
originRegistration site retained on capture failures.
Returns
Immediately readable owning source, or exact typed availability/text/allocation error. Origin removal quietly retires existing direct edges; explicit later access returns STALE_NODE.

◆ logNavigation()

std::expected< LogNavigation, ManagedError > portals::ManagedScene::logNavigation ( LogCheckpointOptions options = {})
Parameters
optionsPositive metadata bounds; no source-count limit or LRU eviction.
Returns
Independent scene-owned log checkpoint session or typed admission failure. No Property slots, provider work, file access or mounted view are required.

◆ logStatus()

std::expected< LogStatus, ManagedError > portals::ManagedScene::logStatus ( Node< LogView > node)
Parameters
nodeLive log.
Returns
Owning counters or exact admission failure, without reporting.

◆ logView()

std::expected< Node< LogView >, ManagedError > portals::ManagedScene::logView ( Node< Widget > parent,
std::string_view initial = {},
LogViewConfig config = {},
ControlStyle style = {},
SizePolicy policy = DEFAULT_LOG_VIEW_POLICY,
std::optional< FrameOptions > frame = {} )
Parameters
parentLive managed parent.
initialComplete UTF-8 batch, copied before return.
configPositive bounded storage and navigation settings.
styleManual appearances.
policyExisting layout constraints.
frameOptional owning native frame customization.
Returns
Initialized native log or exact typed failure; partial initial admission rolls back the child.

◆ model() [1/2]

template<class Source>
requires detail::ManagedCollectionSource<Source>
std::expected< ManagedModel< typename detail::CollectionSource< std::remove_cvref_t< Source > >::Row >, ManagedError > portals::ManagedScene::model ( Source && source,
CollectionModelOptions options = {} )

Bind owning immutable rows to a fresh sink-only model using the existing UI transaction.

Template Parameters
SourceExact ManagedSource<RowCollection<T>>, with copyable equality-comparable immutable T.
Parameters
sourceRead-only collection owned by this scene; explicit IDs survive updates and reordering.
optionsPositive whole-collection and existing Model budgets.
Returns
Immediately initialized model or the original typed admission/allocation failure. Changed source and model application are separate commits; failure preserves the last good model. Its publisher returns WOULD_BLOCK. New bound lists clear missing selection using the complete ID index.

◆ model() [2/2]

template<class T>
std::expected< ManagedModel< T >, ManagedError > portals::ManagedScene::model ( std::shared_ptr< const ModelSnapshot< T > > initial,
ModelOptions options = {},
ManagedViewHandler< T > prepared = {} )

Create a scene-owned model and a weak typed UI handle.

Template Parameters
TImmutable domain row satisfying Model<T>'s provider contract.
Parameters
initialNon-null immutable initial snapshot, retained by the model.
optionsPositive existing model range, consumer and work limits.
preparedModel-owned preparation callback used by views without an explicit override.
Returns
Handle or original allocation/validation error in STATE phase.

◆ navigation() [1/3]

template<class T>
std::expected< ManagedNavigation, ManagedError > portals::ManagedScene::navigation ( ManagedModel< T > model,
ModelResource resource,
SourceStamp session,
NavigationOptions options = {} )
Template Parameters
TImmutable finite model row type.
Parameters
modelOriginal source model in this scene.
resourceExplicit provider domain for reopen/integration.
sessionExisting provider delivery session.
optionsPositive bounded metadata limits.
Returns
Independent finite context or typed failure.

◆ navigation() [2/3]

template<class T>
std::expected< ManagedNavigation, ManagedError > portals::ManagedScene::navigation ( ManagedModel< T > model,
NavigationOptions options = {} )
Template Parameters
TImmutable finite model row type.
Parameters
modelOriginal source model in this scene; projections bind explicitly later.
optionsPositive bounded metadata limits.
Returns
Independent context sharing the model's logical identity, or typed failure.

◆ navigation() [3/3]

std::expected< ManagedNavigation, ManagedError > portals::ManagedScene::navigation ( ModelResource resource,
SourceStamp session,
NavigationOptions options = {} )
Parameters
resourceExplicit logical provider domain; independent of the mounted views.
sessionCurrent provider delivery session.
optionsPositive bounded metadata limits.
Returns
Scene-owned generic context or typed admission/allocation failure.

◆ numericState()

std::expected< NumericState, ManagedError > portals::ManagedScene::numericState ( double initial = 0,
NumericRange range = {} )
Parameters
initialExplicit finite value, retained without user-step snapping.
rangeOrdered finite bounds and positive representable user increment.
Returns
Weak numeric source using this scene's existing Property storage, or an exact typed failure.

◆ observe() [1/4]

template<std::equality_comparable T, class Callback>
requires std::copy_constructible<std::decay_t<Callback>> && (std::same_as<std::invoke_result_t<Callback &, const T &>, void> ||
std::same_as<std::invoke_result_t<Callback &, const T &>, std::expected<void, TreeError>>)
std::expected< void, ManagedError > portals::ManagedScene::observe ( ManagedSource< T > source,
Callback && callback )
inline
Template Parameters
TOwning derived value.
CallbackCopyable presentation callback with the receiving overload's result contract.
Parameters
sourceRead-only source owned by this scene.
callbackAction scoped to the scene root.
Returns
The receiving overload's checked observation admission result.

◆ observe() [2/4]

template<std::equality_comparable T, class Callback>
requires std::copy_constructible<std::decay_t<Callback>> && (std::same_as<std::invoke_result_t<Callback &, const T &>, void> ||
std::same_as<std::invoke_result_t<Callback &, const T &>, std::expected<void, TreeError>>)
std::expected< void, ManagedError > portals::ManagedScene::observe ( ManagedState< T > model,
Callback && callback )
inline
Template Parameters
TOwning equality-comparable state value.
CallbackCopyable callback with the receiving observe overload's result contract.
Parameters
modelState created by this scene.
callbackPresentation action retained until scene retirement.
Returns
The receiving overload's typed registration result, scoped to root().

◆ observe() [3/4]

template<class W, std::equality_comparable T, class Callback>
requires std::copy_constructible<std::decay_t<Callback>> && (std::same_as<std::invoke_result_t<Callback &, const T &>, void> ||
std::same_as<std::invoke_result_t<Callback &, const T &>, std::expected<void, TreeError>>)
std::expected< void, ManagedError > portals::ManagedScene::observe ( Node< W > receiver,
ManagedSource< T > source,
Callback && callback )
inline
Template Parameters
WReceiving managed widget type.
TOwning derived value.
CallbackCopyable presentation callback with the writable source overload's result contract.
Parameters
receiverLive node that scopes the observation.
sourceRead-only source owned by this scene.
callbackOwned callback, first invoked after complete mount.
Returns
Existing typed observation admission result; no writable handle escapes.

◆ observe() [4/4]

template<class W, std::equality_comparable T, class Callback>
requires std::copy_constructible<std::decay_t<Callback>> && (std::same_as<std::invoke_result_t<Callback &, const T &>, void> ||
std::same_as<std::invoke_result_t<Callback &, const T &>, std::expected<void, TreeError>>)
std::expected< void, ManagedError > portals::ManagedScene::observe ( Node< W > receiver,
ManagedState< T > model,
Callback && callback )
inline

Own a one-way presentation observer until its receiver or scene retires. Initial delivery reads the latest value at dirty preparation after complete declarative mount. Later queued revisions may coalesce. Callbacks borrow an immutable value only for their invocation; captures must not destroy this scene. Equal updates do not deliver again. Registration never invokes user code.

Template Parameters
WManaged receiving widget type.
TOwning equality-comparable state value.
CallbackCopyable callable taking const T&, returning void or expected<void, TreeError>.
Parameters
receiverLive managed identity, or this scene's root.
modelState created by this scene.
callbackOwned presentation action; node removal during invocation is allowed.
Returns
Success or BIND validation, capacity, allocation or callback-construction error.

◆ onChange() [1/3]

template<class Callback, class T>
requires (std::derived_from<T, CheckBox> && std::copy_constructible<Callback> && (detail::ChangeAction<Callback, bool> ||
detail::ChangeAction<Callback, CheckState>))
std::expected< void, ManagedError > portals::ManagedScene::onChange ( Node< T > node,
Callback callback,
std::source_location origin = std::source_location::current() )
inline
Template Parameters
CallbackCopyable action taking the actual bool/CheckState value or const PropertyUpdate<T>&.
TCheckBox view type, admitted before callback constraints are instantiated.
Parameters
nodeLive checkbox with its existing managed binding.
callbackFIFO notification of successful changed activation receipts, never a veto.
originRegistration site used by checked callback diagnostics.
Returns
Checked admission; a callback incompatible with the actual model returns INVALID_ARGUMENT. Generic value bodies must compile for both bool and CheckState; use a concrete parameter for one model. External writes, failed commits and no-op receipts do not notify. Rejected notifications still commit.

◆ onChange() [2/3]

template<class Callback, class T>
requires (std::derived_from<T, RadioGroup> && std::copy_constructible<Callback> && detail::ChangeAction<Callback, RadioGroupValue>)
std::expected< void, ManagedError > portals::ManagedScene::onChange ( Node< T > node,
Callback callback,
std::source_location origin = std::source_location::current() )
inline
Template Parameters
CallbackCopyable value/receipt action.
TRadioGroup or a public derived control.
Parameters
nodeBound group.
callbackFIFO post-commit user notification.
originRegistration provenance.
Returns
Checked bounded admission. External writes, failures and no-ops do not notify.

◆ onChange() [3/3]

template<class Callback, class T>
requires ((std::derived_from<T, Slider> || std::same_as<T, SpinBox>) && std::copy_constructible<std::decay_t<Callback>> &&
(detail::ChangeValueAction<std::decay_t<Callback>, double> || requires(std::decay_t<Callback> &action, const
PropertyUpdate<NumericValue> &receipt) { { action(receipt) } -> detail::ManagedActionResult; }))
std::expected< void, ManagedError > portals::ManagedScene::onChange ( Node< T > node,
const Callback & callback,
std::source_location origin = std::source_location::current() )
inline
Template Parameters
CallbackOwning action taking double or the exact numeric Property receipt.
TSlider view type, checked before instantiating callback constraints.
Parameters
nodeLive bound numeric slider.
callbackFIFO changed-user-commit observation.
originRegistration site retained for diagnostics.
Returns
Checked registration; model synchronization and equal commits do not invoke the callback.

◆ onClick() [1/2]

template<class Callback>
requires detail::ManagedAction<Callback, ClickEvent>
std::expected< void, ManagedError > portals::ManagedScene::onClick ( Node< Button > node,
Callback action )
inline
Template Parameters
CallbackOwning void, expected<Value, TreeError> or EditorCommandResult action, optionally taking ClickEvent.
Parameters
nodeLive managed button without another action binding.
actionOwning checked editor command callback; return Ref.undo/redo directly to preserve provenance.
Returns
Scoped registration success or typed binding failure. Parameterized callbacks admit modifiers; no-argument callbacks retain legacy unmodified admission. An already reported exact returned failure is not recorded again in the same live collector; independent failures and throws are still reported. Successful expected payloads are ignored within the entered callback scope.

◆ onClick() [2/2]

std::expected< void, ManagedError > portals::ManagedScene::onClick ( Node< Button > node,
std::function< std::expected< void, TreeError >()> action )
Parameters
nodeManaged button without a prior event binding.
actionTyped business callback, run after standard activation admission; may remove its node.
Returns
Success with scene-owned token or typed registration error.

◆ onDismiss()

template<class Callback>
requires std::copy_constructible<Callback> && (std::same_as<std::invoke_result_t<Callback &, DialogDismissReason>, void> ||
std::same_as<std::invoke_result_t<Callback &, DialogDismissReason>, std::expected<void, TreeError>>)
std::expected< void, ManagedError > portals::ManagedScene::onDismiss ( Node< Dialog > node,
Callback callback )
inline
Template Parameters
CallbackCopyable callback taking DialogDismissReason, returning void or expected<void,TreeError>.
Parameters
nodeRegistered layer receiving this owning callback.
callbackAdmitted once after dismissal publication; self-removal is supported.
Returns
Checked registration failure; teardown never invokes the callback.

◆ onEditingFinished() [1/2]

template<class Callback, class T>
requires (std::derived_from<T, LineEdit> && detail::ManagedAction<Callback, EditingFinishedEvent>)
std::expected< void, ManagedError > portals::ManagedScene::onEditingFinished ( Node< T > node,
Callback callback,
std::source_location origin = std::source_location::current() )
inline
Template Parameters
CallbackOwning managed action accepting EditingFinishedEvent or no arguments.
TLineEdit view type, admitted before callback constraints are instantiated.
Parameters
nodeEditor whose existing binding supplies Enter and focus-loss boundaries.
callbackFIFO action; return checked failures through the existing diagnostics.
originRegistration site retained for diagnostics.
Returns
Checked registration or affinity, identity, finite budget or allocation error.

◆ onEditingFinished() [2/2]

template<class Callback, class T>
requires (std::derived_from<T, Slider> && std::copy_constructible<std::decay_t<Callback>> && detail::ManagedAction<std::decay_t
<Callback>, SliderOperationEvent>)
std::expected< void, ManagedError > portals::ManagedScene::onEditingFinished ( Node< T > node,
const Callback & callback,
std::source_location origin = std::source_location::current() )
inline
Template Parameters
CallbackOwning action taking the local operation event or no arguments.
TSlider view type, checked before callback constraints.
Parameters
nodeBound slider.
callbackCompletion/interruption observation; teardown can suppress delivery.
originRegistration site retained for diagnostics.
Returns
Checked registration or typed affinity, identity, capacity or allocation failure.

◆ onError()

std::expected< void, ManagedError > portals::ManagedScene::onError ( ManagedErrorHandler callback)

Retain or clear the UI error observer; empty clears it.

Parameters
callbackBorrowing observer called after recording, including history overflow. It must not retain the diagnostic reference. Exceptions only increment diagnostic counters.
Returns
Success or typed registration error; WOULD_BLOCK while an observer is active. Notifications precede terminal restoration; no output or continuation policy is imposed.

◆ onEvent()

template<class T>
std::expected< void, ManagedError > portals::ManagedScene::onEvent ( Node< T > node,
std::type_identity_t< ManagedEventHandler< T > > callback )
inline

Own one custom event callback, without subclassing or an additional router.

Template Parameters
TCustom Widget type; callable signature is checked through std::function.
Parameters
nodeManaged node without another binding; standard bound controls reject replacement.
callbackTyped handler borrowing T and event for this invocation only. Errors stop run.
Returns
Success or typed registration error. An admitted handler survives self-removal.

◆ onInput()

std::expected< void, ManagedError > portals::ManagedScene::onInput ( std::function< std::expected< bool, ManagedError >(const InputEvent &)> callback)
Parameters
callbackScene-level interceptor before routing; true suppresses routing, false continues. Mutable captures persist between events. Empty clears the interceptor; replacement retains an active call.
Returns
Success or boundary/allocation error. Callback errors retain their complete ManagedError.

◆ onKey() [1/4]

template<class Callback>
requires detail::ManagedAction<Callback, KeyEvent>
std::expected< void, ManagedError > portals::ManagedScene::onKey ( const KeySelection & selection,
Callback action,
std::source_location origin = std::source_location::current() )
inline
Template Parameters
CallbackOwning compact action, optionally receiving const KeyEvent&.
Parameters
selectionImmutable owning alternatives or a deferred helper error.
actionChecked callback invoked once for an admitted native phase.
originRegistration site preserved for configuration and action failures.
Returns
Atomic registration or typed failure, preserving previous handlers and pending input on failure. The explicit phase set applies to every sequence stroke; no backend phases are synthesized.

◆ onKey() [2/4]

template<class Callback>
requires detail::ManagedAction<Callback, KeyEvent>
std::expected< KeyBinding, ManagedError > portals::ManagedScene::onKey ( const KeySelection & selection,
KeyInfo info,
Callback action,
std::source_location origin = std::source_location::current() )
inline
Template Parameters
CallbackExact compact managed action, optionally borrowing the admitted key.
Parameters
selectionOwning normalized alternatives and native phases.
infoOwning annotated metadata, resolved before publication.
actionAction owned only by the canonical registration.
originRegistration site used only when the error has no more precise provenance.
Returns
Atomic registration and weak handle, or the exact typed failure.

◆ onKey() [3/4]

template<class Callback>
requires detail::ManagedAction<Callback, KeyEvent>
std::expected< void, ManagedError > portals::ManagedScene::onKey ( KeyEvent chord,
Callback action )
inline
Template Parameters
CallbackOwning compact action, optionally borrowing the admitted KeyEvent.
Parameters
chordExact key/scalar/modifiers; PRESS and REPEAT are admitted, RELEASE is ignored.
actionVoid, expected<Value, TreeError> or EditorCommandResult callback; success payloads are ignored.
Returns
Registration result with typed allocation/affinity errors; empty callbacks are rejected. Composes owning registrations in the single existing onInput slot. Newest matching chord wins; nonmatches delegate to the previous interceptor, then standard routing. Matching success consumes input; errors follow existing input failure handling. Direct onInput replaces the whole chain. Command errors already reported to this scene are not reported twice.

◆ onKey() [4/4]

template<class Value, class Callback>
requires std::same_as<std::remove_cvref_t<Value>, Shortcut> && detail::ManagedAction<Callback, KeyEvent>
std::expected< void, ManagedError > portals::ManagedScene::onKey ( Value && shortcut,
Callback action,
ShortcutBehavior behavior = {},
ShortcutOptions options = {},
std::source_location origin = std::source_location::current() )
inline
Template Parameters
ValueOwning Shortcut value, borrowed until copied/moved inside the checked boundary.
CallbackOwning compact action, optionally receiving the admitted semantic KeyEvent.
Parameters
shortcutNormalized alternatives, validated before owning transfer and publication.
actionChecked callback invoked once, preserving the existing command-error receipt.
behaviorPRESS-only default; REPEAT is explicit.
optionsPositive finite alternative budgets.
originRegistration site retained for errors from this admitted action, including throws.
Returns
Atomic registration or typed failure; newest matching registration wins in the existing input slot. Modified text produces a CHARACTER PRESS value with the original scalar and semantic modifiers. Callback storage stays pinned through dispatch, replacement and scene cleanup. Each sequence stroke uses this admission policy. A prefix consumes without invoking; completion resets pending state before calling the action with the final stroke. Timeout and mismatch never invoke a suppressed terminal command or replay old events.

◆ onLayout()

template<class Callback>
requires detail::ManagedAction<Callback, NodeGeometry>
std::expected< void, ManagedError > portals::ManagedScene::onLayout ( Node< Widget > node,
Callback callback,
std::source_location origin = std::source_location::current() )
inline
Template Parameters
CallbackOwning compact action accepting const NodeGeometry& or no arguments.
Parameters
nodeLive managed widget whose local, surface and clip bounds are observed.
callbackVoid, checked TreeError or EditorCommandResult callback owned by this scene.
originRegistration site retained in diagnostics.
Returns
Success or typed admission/budget/allocation failure, without partial registration. Initial valid and changed values arrive on a subsequent UI scheduler dispatch outside frames. Hidden/removal/close cancel pending values. Copy the callback argument to retain its owning value.

◆ onPrepare()

template<class T>
std::expected< void, ManagedError > portals::ManagedScene::onPrepare ( Node< T > node,
std::type_identity_t< ManagedPrepareHandler< T > > callback )
inline

Register custom presentation work at the existing dirty-frame boundary.

Template Parameters
TConcrete custom Widget type, including final types.
Parameters
nodeManaged target, borrowed through tree.edit while the callback runs.
callbackCalled with widget and recovered focus. Read latest state, change only unequal presentation values, and invalidate PAINT/LAYOUT if needed. Do not retain widget references.
Returns
Success or typed registration error; no idle polling is introduced.

◆ onTextEdited()

template<class Callback>
requires detail::ManagedAction<Callback, TextEditedEvent>
std::expected< void, ManagedError > portals::ManagedScene::onTextEdited ( Node< LineEdit > node,
Callback callback,
std::source_location origin = std::source_location::current() )
inline
Template Parameters
CallbackOwning managed action accepting TextEditedEvent or no arguments.
Parameters
nodeEditor whose existing binding supplies accepted user text changes.
callbackFIFO action; retained by the scene, including during self-removal.
originRegistration site retained for diagnostics.
Returns
Checked registration or affinity, identity, finite budget or allocation error.

◆ openDialog()

std::expected< void, ManagedError > portals::ManagedScene::openDialog ( Node< Widget > node)

Open a ready registered layer; an already open layer is unchanged.

Parameters
nodeExact dialog root; anchored initial admission requires arranged body geometry.
Returns
Checked error; focus callback failures preserve the published activation.

◆ overlayHost()

std::expected< void, ManagedError > portals::ManagedScene::overlayHost ( Node< OverlayHost > host,
Node< Widget > body )

Bind the scene's sole retained host to its exact ordinary body.

Parameters
hostManaged host with body as its first child.
bodyLive ordinary body subtree, retained across activations.
Returns
Checked registration errors; failure publishes no host.

◆ passwordValue()

std::expected< PasswordValue, ManagedError > portals::ManagedScene::passwordValue ( Node< Password > node) const
Parameters
nodeLive protected editor.
Returns
Owning protected draft identity or checked scene/tree error; no plaintext is borrowed.

◆ prepare()

std::expected< void, TreeError > portals::ManagedScene::prepare ( Application & app,
CellSize size )
overridevirtual
Parameters
appThe same borrowed Application used at creation.
sizeCurrent viewport; custom layout remains the existing tree layout's responsibility.
Returns
Compatibility bridge error; run() retains complete managed details.

Reimplemented from portals::ApplicationScene.

◆ prepareViews()

std::expected< void, TreeError > portals::ManagedScene::prepareViews ( Application & app,
const LayoutSnapshot & snapshot )
overridevirtual

Prepare registered views from the pins captured by prepare(), in registration order.

Parameters
appSame application used at creation.
snapshotOwning layout for this pass; hidden views retain cancellation semantics.
Returns
Original TreeError; run() also preserves the managed phase and failing node.

Reimplemented from portals::ApplicationScene.

◆ radioState() [1/3]

std::expected< ManagedState< RadioGroupValue >, ManagedError > portals::ManagedScene::radioState ( std::initializer_list< std::string_view > captions)
Parameters
captionsOrdinary string initializer copied into scene-owned immutable rows.
Returns
State with automatically generated identities, or the original checked text/allocation failure.

◆ radioState() [2/3]

std::expected< ManagedState< RadioGroupValue >, ManagedError > portals::ManagedScene::radioState ( std::span< const RadioOption > options,
KeyTextResolver resolver = {},
CollectionLimits limits = {} )
Parameters
optionsCold owning captions with eligibility.
resolverSynchronous localization adapter.
limitsExisting collection cap.
Returns
Coherent state with private source-local generated IDs.

◆ radioState() [3/3]

std::expected< ManagedState< RadioGroupValue >, ManagedError > portals::ManagedScene::radioState ( std::span< const TextValue > captions,
KeyTextResolver resolver = {},
CollectionLimits limits = {} )
Parameters
captionsOwning literal/resource expressions, resolved with this scene's width policy.
resolverOptional synchronous localization adapter.
limitsExisting resident collection cap.
Returns
Scene-owned coherent radio state, initially selecting the first eligible caption.

◆ radioValue()

std::expected< RadioGroupValue, ManagedError > portals::ManagedScene::radioValue ( Node< RadioGroup > node)
Parameters
nodeBound managed group.
Returns
Current authoritative immutable value or original admission error.

◆ remove()

std::expected< void, ManagedError > portals::ManagedScene::remove ( Node< Widget > node)

Retire one managed subtree and immediately reclaim its managed entry budget.

Parameters
nodeManaged node other than root(); an already retired managed identity is accepted.
Returns
Success or typed boundary/removal error. State owners remain scene-owned. Managed mutations reentering this remove call return WOULD_BLOCK. An outer tree borrow can defer unmount beyond this call; those hooks follow the existing tree contract and may remove other nodes. External callback effects are not rolled back. Existing style metadata is pruned on the next style transaction, before budget admission.

◆ removeLayer()

std::expected< Invalidation, ManagedError > portals::ManagedScene::removeLayer ( StyleLayerHandle handle)
Parameters
handleLive layer observer; base removal clears declarations but retains the slot.
Returns
Effective invalidation or atomic STYLE failure.

◆ replaceLayer()

std::expected< Invalidation, ManagedError > portals::ManagedScene::replaceLayer ( StyleLayerHandle handle,
const StyleSheet & sheet )
Parameters
handleLive non-base layer observer.
sheetBorrowed replacement preserving identity and installation order.
Returns
Effective invalidation or atomic STYLE failure.

◆ reportError()

std::expected< void, TreeError > portals::ManagedScene::reportError ( ManagedError failure,
std::span< const ManagedDiagnosticContext > contexts = {},
std::source_location origin = std::source_location::current() )
noexcept

Record an explicit error without changing runtime stop/recovery policy.

Parameters
failureOriginal typed error; argument construction precedes this call.
contextsBorrowed breadcrumbs copied under the configured count and byte budgets.
originReport call site; supply the earlier origin for deferred operations.
Returns
Success, WRONG_THREAD before any state access, or CLOSED. Overflow/context OOM retain the original cause through bounded history/counters and the observer fallback. Nested reports are collected but do not recursively invoke onError. No frame is requested. Checked setup operations remain explicit expected results and are not automatically recorded.

◆ requiresBackgroundExecutor()

bool portals::ManagedScene::requiresBackgroundExecutor ( ) const
inlineoverridevirtualnoexcept
Returns
True when a fluent asynchronous binding requires the existing background service.

Reimplemented from portals::ApplicationScene.

◆ requiresPointerMotion()

bool portals::ManagedScene::requiresPointerMotion ( ) const
overridevirtualnoexcept
Returns
True while any mounted scroll registration requires the session input profile, including hidden, disabled or read-only controls; ordinary scenes return false without a walk.

Reimplemented from portals::ApplicationScene.

◆ restoreStatus() [1/2]

template<class T>
std::expected< std::optional< PositionResolution >, ManagedError > portals::ManagedScene::restoreStatus ( Node< VirtualList< T > > node) const
Template Parameters
TImmutable row type of the existing managed view.
Parameters
nodeLive list in this scene.
Returns
No value before a restore attempt, or its current/reading/selection aggregate outcome. The first unresolved channel determines a terminal/pending outcome; successful channels aggregate to NEAREST if any required a proven neighbor, otherwise EXACT or known EMPTY.

◆ restoreStatus() [2/2]

template<class T>
std::expected< std::optional< PositionResolution >, ManagedError > portals::ManagedScene::restoreStatus ( Node< VirtualTable< T > > node) const
Template Parameters
TImmutable row type of the existing managed view.
Parameters
nodeLive table.
Returns
Same checked metadata-only outcome as the list overload.

◆ root()

Node< Widget > portals::ManagedScene::root ( ) const
inlinenoexcept
Returns
Observing subtree root; put a Row/Column/custom layout below it.

◆ run() [1/2]

std::expected< ApplicationStats, ManagedError > portals::ManagedScene::run ( ApplicationTerminal & terminal,
std::stop_token stop = {} )
Parameters
terminalBorrowed existing replay/custom transport, required to outlive run.
stopOptional cooperative cancellation.
Returns
Runner statistics or complete managed, runner/restoration and cleanup error.

◆ run() [2/2]

std::expected< ApplicationStats, ManagedError > portals::ManagedScene::run ( std::stop_token stop = {})
Parameters
stopOptional cooperative cancellation.
Returns
Runner statistics or complete managed, runner/restoration and cleanup error.

◆ scrollBar()

std::expected< Node< ScrollBar >, ManagedError > portals::ManagedScene::scrollBar ( Node< Widget > parent,
std::shared_ptr< ScrollController > controller = {},
ScrollAxis axis = ScrollAxis::VERTICAL,
ScrollBarOptions options = {},
ControlStyle style = {},
bool geometryWriter = true )
Parameters
parentLive managed parent.
controllerOwning shared values; empty creates standalone values.
axisProjected axis.
optionsOwning input and paint settings.
styleManual appearance defaults.
geometryWriterTrue for standalone metrics ownership, false for an area projection.
Returns
Mounted automatically initialized/bound bar or checked mount/lease error.

◆ selectRadio()

std::expected< PropertyUpdate< RadioGroupValue >, ManagedError > portals::ManagedScene::selectRadio ( Node< RadioGroup > node,
std::optional< RowId > id )
Parameters
nodeBound managed group.
idExisting full ID or no selection.
Returns
Exact programmatic receipt, without user onChange delivery.

◆ setChecked()

std::expected< PropertyUpdate< bool >, ManagedError > portals::ManagedScene::setChecked ( Node< CheckBox > node,
bool value )
Parameters
nodeManaged bool-bound checkbox or subtype.
valueReplacement bool.
Returns
Exact programmatic bool receipt, without user onChange or automatic reporting.

◆ setKeyCapabilities()

std::expected< void, ManagedError > portals::ManagedScene::setKeyCapabilities ( KeyCapabilities capabilities)
Parameters
capabilitiesExplicit native phase knowledge.
Returns
Checked admission change; equal values are a no-op.

◆ setLogModel()

std::expected< void, ManagedError > portals::ManagedScene::setLogModel ( Node< LogView > node,
ui::LogSource source )
Parameters
nodeLive managed log, including rolling mode.
sourceOwning deferred binding.
Returns
Atomic model admission; checked failures preserve the previous binding and never auto-report.

◆ setModel() [1/2]

template<class T>
std::expected< void, ManagedError > portals::ManagedScene::setModel ( Node< VirtualList< T > > node,
ManagedModel< T > model,
std::type_identity_t< std::optional< ManagedViewHandler< T > > > prepared = std::nullopt,
ModelRebindOptions options = {} )

Atomically replace a managed list's model without replacing its node or presentation.

Template Parameters
TExisting immutable row type shared by both models.
Parameters
nodeLive list created by this scene's virtualList factory.
modelLive replacement owned by this scene; admission performs no provider I/O.
preparedOmitted keeps a same-model override; a new model uses its own preparation callback. An explicitly empty handler clears the override.
optionsRemember/reset and bounded metadata policy.
Returns
Success or the original admission error with the old binding intact. Different models remember independent current, selection and reading metadata; returning resolves stable IDs without a full scan. The same model preserves its consumer and state; an explicit handler affects future preparations. UI only; preparation, styling and diagnostic callbacks reject reentry with WOULD_BLOCK. Argument construction may throw.

◆ setModel() [2/2]

template<class T>
std::expected< void, ManagedError > portals::ManagedScene::setModel ( Node< VirtualTable< T > > node,
ManagedModel< T > model,
std::type_identity_t< std::optional< ManagedViewHandler< T > > > prepared = std::nullopt,
ModelRebindOptions options = {} )

Atomically replace a managed table's model, preserving columns, options and node identity.

Template Parameters
TExisting immutable row type shared by both models.
Parameters
nodeLive table created by this scene's virtualTable factory.
modelLive replacement owned by this scene.
preparedOptional override with the same keep/replace/clear policy as the list overload.
optionsRemember/reset and bounded metadata policy.
Returns
Same admission, restoration, same-model and UI/reentry guarantees as the list overload.

◆ setPasswordValue()

std::expected< void, ManagedError > portals::ManagedScene::setPasswordValue ( Node< Password > node,
PasswordValue value )
Parameters
nodeLive protected editor with a native binding.
valueProtected candidate subject to the editor's ordinary publication/validation mode.
Returns
Checked operation, retaining collector provenance if its callback already reported a failure.

◆ setScrollMetrics()

std::expected< void, ManagedError > portals::ManagedScene::setScrollMetrics ( Node< ScrollBar > node,
ScrollAxisMetrics metrics )
Parameters
nodeLive managed standalone metrics writer.
metricsExact extent and viewport.
Returns
Checked writer/configuration error or success; metric clamping is not a new scroll intent.

◆ setScrollOffset()

std::expected< void, ManagedError > portals::ManagedScene::setScrollOffset ( Node< Widget > node,
ScrollAxis axis,
ScrollOffset offset )
Parameters
nodeLive managed area or bar.
axisRequested axis.
offsetExact integral and fractional position; programmatic commands allow readOnly.
Returns
Checked command result; logical movement suppresses older intersecting reveal requests.

◆ spinner()

std::expected< Node< Spinner >, ManagedError > portals::ManagedScene::spinner ( Node< Widget > parent,
SpinnerOptions options = {},
ControlStyle style = {},
SizePolicy policy = DEFAULT_CONTENT_POLICY,
SpinnerLabelResolver resolver = {} )
Returns
True while a managed virtual view requires layout-driven preparation.
Parameters
parentChecked receiving parent in this scene.
optionsOwning finite indicator configuration, validated before publication.
styleManual active/dim defaults beneath existing theme rules.
policyExisting size constraints.
resolverOptional synchronous label localization adapter, never retained after mounting.
Returns
Live indicator with node-scoped animation, or original typed setup/ownership failure.

◆ start()

std::expected< void, ManagedError > portals::ManagedScene::start ( ApplicationReadyTerminal & terminal,
std::stop_token stop = {} )
Parameters
terminalReady-only transport borrowed until terminal step or destruction.
stopCooperative cancellation sampled by each ready operation.
Returns
Success or complete managed start failure. UI-only and single-use.

◆ state()

template<std::equality_comparable T>
std::expected< ManagedState< T >, ManagedError > portals::ManagedScene::state ( T initial,
Invalidation kind = Invalidation::PAINT,
PropertyOptions options = {} )
inline

Create UI-owned state with guaranteed dirty-frame recovery of missed notifications.

Template Parameters
TEquality-comparable, owning value satisfying Property<T>'s contract.
Parameters
initialInitial value moved into revision zero, except string copied inside the checked boundary; argument construction precedes this call.
kindPAINT or LAYOUT; NONE is rejected because it cannot guarantee recovery.
optionsPositive existing Property observer capacity.
Returns
Weak typed state handle, or validation/allocation/construction error.

◆ step()

std::expected< ApplicationStep, ManagedError > portals::ManagedScene::step ( )
Returns
One bounded ready step or terminal managed failure; terminal results are retained. UI-only; reentry is rejected without changing the active session.

◆ stop()

void portals::ManagedScene::stop ( Application & app)
overridevirtual
Parameters
appThe same runtime, already stopped by Application; cleanup failure is retained by run().

Reimplemented from portals::ApplicationScene.

◆ style()

std::expected< void, ManagedError > portals::ManagedScene::style ( Node< Widget > node,
StyleTarget target )
Parameters
nodeManaged node whose style metadata will be staged.
targetOwning custom identity; standard controls already have type Control.
Returns
Success staging the metadata for the next dirty frame, or validation error.

◆ styleDefaults()

std::expected< Invalidation, ManagedError > portals::ManagedScene::styleDefaults ( const StyleSheet & sheet)
Parameters
sheetBorrowed DEFAULTS declarations below THEME and application/user overrides.
Returns
Effective invalidation or atomic STYLE failure.

◆ styleDocument()

std::expected< StyleLayerHandle, ManagedError > portals::ManagedScene::styleDocument ( StyleTier tier,
std::string_view name,
const PssDocument & document,
std::optional< StyleLayerOptions > options = std::nullopt )

Atomically install owning declarations and provenance in an APPLICATION or USER layer.

Legacy mode becomes layered in the same commit, retaining the old sheet in THEME. Failure preserves mode, authority, pending registrations, computed values, and provenance. Equal declarations with changed metadata alone do not call defaults, advance revision, or request redraw.

Parameters
tierAPPLICATION or USER priority; base tiers are rejected.
nameNonempty tier identity; replacement preserves its handle and installation order.
documentBorrowed mutable document, validated and deep-copied into immutable ownership before publication.
optionsOmitted limits adopt established budgets, or defaults at first enable; incompatible values reject.
Returns
Weak identity or typed STYLE/PSS boundary, validation, budget, identity, or allocation failure.

Metadata has a separate MAX_PSS_DOCUMENT_BYTES logical budget per document. Checked maxLayers times that limit bounds resident logical metadata; records also incur the layer payload charge. Document copies and candidate sheets may coexist while staging. These limits do not cap RSS. Coordinates are checked structurally; original bytes are unavailable for proving their exact positions. Non-allocation errors retain a best-effort owning source label. NO_MEMORY never allocates a fallback label. A facade may attach its already-owned immutable identity without allocating or changing the original cause.

◆ styleSources()

std::expected< std::vector< StyleLayerSource >, ManagedError > portals::ManagedScene::styleSources ( ) const

Copy every actual layer row in installation order on the UI thread.

Returns
Owning names and shared immutable documents, or typed boundary/allocation failure.

Unknown sources have null metadata. Legacy mode returns an empty snapshot. Retained documents may outlive cleanup; observing handles never keep the scene alive. Allocator reentry cannot mutate or retire the scene while the snapshot is copied.

◆ theme()

std::expected< void, ManagedError > portals::ManagedScene::theme ( StyleSheet sheet)
Parameters
sheetOwning stylesheet installed with the existing atomic style engine.
Returns
Success or original StyleError. Layered mode updates reserved THEME with pending metadata atomically and revokes its prior controller; legacy mode flushes registrations before whole replacement.

◆ updateLayers()

std::expected< Invalidation, ManagedError > portals::ManagedScene::updateLayers ( std::span< const StyleLayerUpdate > updates)
Parameters
updatesBorrowed unique existing-handle updates, committed together with pending metadata.
Returns
Effective invalidation or atomic STYLE failure; empty input without pending metadata is a no-op.

◆ usesGeometrySnapshot()

bool portals::ManagedScene::usesGeometrySnapshot ( ) const
overridevirtualnoexcept
Returns
True only while this scene owns ordinary scroll areas needing copied geometry.

Reimplemented from portals::ApplicationScene.

◆ usesPreparedLayout()

bool portals::ManagedScene::usesPreparedLayout ( ) const
overridevirtualnoexcept

Opt into bounded layout-driven view preparation; default is false.

Returns
True to run preliminary layout and prepareViews before the final frame. False preserves the original single layout/paint/render path.

Reimplemented from portals::ApplicationScene.

◆ validateStyleLayer()

std::expected< void, ManagedError > portals::ManagedScene::validateStyleLayer ( StyleLayerHandle handle) const

Validate an observing layer identity without resolving styles or invoking callbacks.

Parameters
handleUI-affine weak identity issued by this scene.
Returns
Success or typed STYLE boundary, wrong-thread, foreign, removed, or stale identity failure.

◆ virtualList()

template<class T>
std::expected< Node< VirtualList< T > >, ManagedError > portals::ManagedScene::virtualList ( Node< Widget > parent,
ManagedModel< T > model,
std::type_identity_t< ManagedListFormatter< T > > delegate,
VirtualListOptions options = {},
SizePolicy policy = DEFAULT_VIEWPORT_POLICY,
std::type_identity_t< ManagedViewHandler< T > > prepared = {} )

Mount a list with owned range, input binding, style and automatic preparation.

Template Parameters
TImmutable row accepted by the owning text delegate.
Parameters
parentManaged parent; failure removes only the attempted child.
modelModel belonging to this scene.
delegateOwning row formatter, invoked only for visible rows.
optionsExisting list configuration, validated by preparation.
policyExisting layout policy for the list.
preparedOptional view override after preparation; empty uses model-owned preparation. Pending work without either callback is rejected with INVALID_ARGUMENT.
Returns
Observing node or typed mount/bind error.

◆ virtualTable()

template<class T>
std::expected< Node< VirtualTable< T > >, ManagedError > portals::ManagedScene::virtualTable ( Node< Widget > parent,
ManagedModel< T > model,
std::type_identity_t< std::span< const TableColumn< T > > > columns,
VirtualTableOptions options = {},
SizePolicy policy = DEFAULT_VIEWPORT_POLICY,
std::type_identity_t< ManagedViewHandler< T > > prepared = {} )

Mount a table with owned range, input binding, style and automatic preparation.

Template Parameters
TImmutable model row accepted by the owning column delegates.
Parameters
parentManaged parent; failure removes only the attempted child.
modelModel belonging to this scene; no owner or pin escapes.
columnsColumn descriptions copied by the table.
optionsExisting table configuration, validated by preparation.
policyExisting layout policy for the table.
preparedOptional view override after preparation; empty uses the model's preparation callback. Pending work without either callback is rejected with INVALID_ARGUMENT.
Returns
Observing node or typed error; standard input semantics are preserved.

◆ visibleModelSnapshot()

template<class T>
std::expected< VisibleModelSnapshot< T >, VisibleModelError > portals::ManagedScene::visibleModelSnapshot ( Node< VirtualTable< T > > node) const

Read ready physical rows after successful final layout publication.

Template Parameters
TImmutable domain row type retained by the resulting pin.
Parameters
nodeOriginal managed table identity; removal never retargets another node.
Returns
Owning stable ready range, or exact access/preparation/provider failure; never reports errors.
Note
UI-affine, outside preparation and tree frames. Hidden tables successfully yield no rows.

◆ widthPolicy()

WidthPolicy portals::ManagedScene::widthPolicy ( ) const
inlinenoexcept
Returns
Immutable text width policy shared with the borrowed Application.

The documentation for this class was generated from the following files: