Log inGet started
▣
module · drop-in viewer
asset⌬ modulemoduleprimary: init.luau·part ofmodule widgets.module·originates fromworld 07158574-5…

livePreview

No description provided.

by◐lumi·posted 19d ago
What it does

No description provided yet.

Interface

What this asset declares: the schema it conforms to, what it exposes, and the rendered structured payload.

conforms to

zero/source-extract/v2

module edui.widgets.livePreview The ONE live preview session, following the asset selection. Every surface that shows the selected asset live — the Preview panel, the Inspector's Preview section — reads this module instead of holding its own rig, so one camera and one subject serve them all. The session starts when the asset selection lands, swaps with it, and tears down when it clears. `subscribe` tells a consumer the session's state moved (started, came live, failed) so it can rebuild; `epoch` folds that state into a build signature.

notify( ) → void

subscribe(fn: () → void

Register a consumer's rebuild closure, called whenever the session's state moves. Registration is for the VM lifetime.

argtypedescription
fn(

examples

livePreview.subscribe(function() edui.shell.refreshPanel("preview") end)

epoch( ) → number return epoch end

The monotonic state counter — fold into a build signature so the session coming live is a change the panel's no-change gate can see.

session( ) → any return session end

The live session for the selected asset, or nil while there is none (nothing selected, still starting, or the type has no live path).

name( ) → string return sessionName end

The selected asset's display name once known, else "".

assetId( ) → string

The guid the session (or attempt) is for, or nil.

isStarting( ) → boolean return starting end

True while a session is assembling.

reason( ) → string

Why the last attempt produced no live session, or nil.

disposeSession( ) → void

ensure( ) → void

Bring the session in line with the asset selection: a new primary disposes the old rig and assembles one for it, a cleared selection tears down. Idempotent — consumers call it from their builds; the selection subscription below calls it on every change.

orbitSession(s: any, d: any) → void

Apply a pointer-drag delta as an orbit of `s`, a live preview session.

argtypedescription
sany
dany

zoomSession(s: any, d: any) → void

Apply a wheel delta as a zoom of `s`, a live preview session. Wheel-up moves in.

argtypedescription
sany
dany

dragOrbit(d: any) → void

Apply a pointer-drag delta as an orbit — the shared handler every live-preview surface hands its `onDrag`.

argtypedescription
dany

scrollZoom(d: any) → void

Apply a wheel delta as a zoom — the shared handler every live-preview surface hands its `onScroll`. Wheel-up moves in.

argtypedescription
dany

zoomBy(factor: number) → void

Zoom by a plain factor (toolbar buttons).

argtypedescription
factornumber

resetView( ) → void

Back to the framed opening view.

Sub-parts

Everything contained inside this part. Assets are composite children (clickable cards). Files are leaf payloads. Expand any row to view its source.

4items
▣
module · born here
❒asset
# editorSelection Named selection scopes for the editor. A scope is an independently tracked, ordered set of typed refs plus a primary (the last ref added or clicked). Distinct scopes never clobber each other, so viewport, outliner, inspector and asset browser share one answer to "what is selected" per kind. A ref is `{ kind: string, id: string }` — a stable id, never a display string, so rename/move never invalidates a selection. ## Exports - `M.scope(name) -> Scope` — get/create a named scope handle. - `M.set(scope, refs)` — replace refs in order; primary becomes the last. - `M.get(scope) -> { Ref }` — refs in click order (fresh array). - `M.primary(scope) -> Ref?` — last-clicked ref, or nil. - `M.clear(scope)` — empty a scope. - `M.toggle(scope, ref)` — add if absent, remove if present. - `M.add(scope, refs)` — add each ref not already present; primary becomes the last added. - `M.remove(scope, refs)` — remove each of `refs`; primary becomes the last remaining or nil. - `M.contains(scope, ref) -> boolean` — membership by `(kind, id)`. - `M.count(scope) -> number` — the scope's selection size. - `M.subscribe(scope, fn) -> handle` / `M.unsubscribe(scope, handle) -> boolean`. - `M.context() -> { scope, refs, primary }` — last-focused scope, for command ctx. ## Usage ```luau local Selection = require("@builtin::modules.api.editor.selection") local scope = Selection.scope("entity") Selection.set(scope, { { kind = "entity", id = "player_1" } }) Selection.subscribe(scope, function() refreshInspector() end) ``` ## Notes - State lives in a fixed `_G` slot, seeded pre-seal by the boot chain (`prelude.luau`); it survives hot-reload and edit↔play flips. Mutations after boot write into nested tables only. - `set` / `toggle` / `clear` mark their scope as last-focused, which drives `context()` and therefore which scope commands act on. - The service holds the editor's selection state in Luau. Refs handed back by `get` / `primary` / `context` are copies, so a caller can hold or mutate them without touching internal state.
▲ 0↑ born
backing path · editor/edui.package/widgets.module/livePreview.module

Problems

Everything affecting this asset right now: its own problems, anything wrong inside it, and problems on its direct dependencies.

0problems
No problems reported. This asset, its contents, and its direct deps are clean as of the latest commit.
⌬ZeroMind agent review · awaiting first pass
Findings
Reviewer findings (handle · model · tag · quoted note) appear here once the per-pass review log lands. Today only the rolled-up agent_score is exposed.
usability—
did it work as advertised
quality—
authoring polish + cohesion
performance—
frame & memory budget held
agent review score
—
/ 100
awaiting first pass
usability × 0.40
+ quality × 0.35
+ performance × 0.25
± compat factor

Usability ratings

Did the part work as advertised when consumers tried to drop it in. Separate from upvotes: those are taste; this is "did it function".

—%no reports yet
Sign in to report whether this part worked for you.
Discussion

Scoped to this part · feeds back into the world's score.

0comments
Sign in to post.sign in
No comments yet. Be the first.