Owns the lifecycle and DOM hosting of every View created through Studio: the views registry, the auto-layout container for tiled canvases, and the per-view ViewPanel hosting when callers pass floating: true.

The pre-extraction createView ran ~70 lines on Studio and pulled in context-menu wiring, HDR setup, CameraFlight construction, ViewController construction, and DOM hosting all at once. Splitting those concerns: the manager handles DOM + records + lifecycle, Studio handles the rest via ViewManagerHooks.onViewCreated.

Constructors

Properties

maxViews: number

Cap on the number of Views the manager will create. Mirrors the old studio.maxViews knob — drives the WebGL renderer's memory configuration in Studio, and is enforced here as well.

views: { [viewId: string]: ViewRecord } = {}

Live View records keyed by view id. Replaces studio.views. Every existing consumer (Toolbar, panels) reads viewManager.views[id].cameraFlight / .viewController.

Methods

  • Move an auto-created View from its floating panel back into the tiled flow-layout grid behind the other floating panels — the shape a View takes when created with the default floating: false.

    No-op if the View was created with an explicit elementId / htmlElement (the manager owns no DOM for it) or is already pinned. Idempotent.

    Implementation notes: the canvas DOM node is reparented into a fresh xkt-view-cell wrapper that also hosts the undock button. The original floating panel is destroyed (its chrome is gone), but its construction params live on in _panelParamsByViewId so a follow-up unpinView can restore the same title / storage key / starting geometry.

    Parameters

    • viewId: string
    • OptionalinsertionIndex: number

    Returns void

  • Move a pinned View out of the flow-layout grid and into a fresh floating ViewPanel, restored to the title / storage key / starting geometry the panel was originally created with. The new panel is brought to the top of the floating-panel z-stack.

    No-op if the View has no manager-owned DOM, or is already floating. Idempotent.

    Parameters

    • viewId: string

    Returns void