Skip to main content

GetViewHealth

Since: IVPrismaUI8

virtual ViewHealth GetViewHealth(PrismaView view) noexcept = 0;

Returns the framework-published health state for a view. Use it with IsValid() and logging when diagnosing lifecycle failures.

Public values

ValueMeaning
kUnknownNo known public health state for the supplied handle/backend state.
kCreatingView admitted/created but not yet DOM-ready/live.
kDomReadyMain document reached DOM-ready.
kLiveNormal live state.
kLoadFailedView/document loading failed or trusted-navigation policy rejected the document.
kDomReadyTimeoutABI health state for failing to reach DOM-ready in the allowed lifecycle window.
kUnresponsiveABI health state for an unresponsive view condition.
kJsErrorJavaScript/script error condition, for example a failed evaluated script.

PrismaUI_F4 2.1.0 notes

The production backend is in-process Ultralight. Do not interpret kUnresponsive as proof that a legacy-runtime renderer subprocess crashed.

The current backend publishes kCreating, kDomReady, kLive, kLoadFailed, and script-error state as the Ultralight view moves through creation/loading/evaluation. The public enum retains the full compatibility state set.

Focus is accepted only when the view is in kDomReady or kLive.

Example

if (!g_api || !g_api->IsValid(g_view)) {
return;
}

using VH = PRISMA_UI_API::ViewHealth;
const auto health = g_api->GetViewHealth(g_view);

if (health == VH::kLoadFailed || health == VH::kDomReadyTimeout) {
logger::error("Prisma view failed to become live");
}

Use RegisterConsoleCallback, Invoke error results, and PrismaUI_F4.log to determine the actual cause.

See also

IsValid, RegisterConsoleCallback, View Health & Watchdog.