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

args

Shared argument resolver for zui container builders (`panel`, `vbox`, `hbox`, `grid`, …). Container builders historically took `(children, opts)` with children first, but the intuitive call is a single options table `Z.panel({ style = …, children = {…} })`. Passed to a `(children…

byzero-proxy @ DESKTOP-DB3UJOJ·posted 2mo ago
What it does

args

Shared argument resolver for zui container builders (panel, vbox, hbox, grid, …). Container builders historically took (children, opts) with children first, but the intuitive call is a single options table Z.panel({ style = …, children = {…} }). Passed to a (children, opts) builder, that table landed in the children slot and its children key was silently dropped. resolve removes that pit: it accepts every unambiguous shape and routes it correctly, and raises a precise error when a call is genuinely ambiguous instead of silently dropping content.

Exports

  • resolve(builderName: string, a: any, b: any) -> ({ any }, { [string]: any }) — returns (children, opts) — an array of child widget tables (possibly empty) and an options table (possibly empty).

Accepted shapes

resolve("panel", { childA, childB }, opts?)        -- canonical array + opts
resolve("panel", singleChildNode, opts?)           -- a lone widget (auto-wrapped)
resolve("panel", { style = …, children = {…} })    -- single options table
resolve("panel", { style = … })                    -- options only (no children)
resolve("panel", nil, opts?)                        -- no children

Errors (never silent)

  • a children array that ALSO carries a children key
  • an options-shaped first argument passed alongside a 2nd options argument
  • opts.children that isn't an array

Usage

local resolve = require("@builtin::modules.zui.widget.args")
local children, opts = resolve("panel", a, b)

Interface

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

conforms to

zero/source-extract/v2

ZuiArgs Module Shared argument resolver for container builders (panel, vbox, hbox, grid, …). Container builders historically took `(children, opts)` with children FIRST — but the intuitive call an author reaches for is the single options table `Z.panel({ style = …, children = {…} })` (the shape `card` already uses). Passed to a `(children, opts)` builder, that table landed in the children slot and its `children` key was silently dropped — the panel rendered nothing, with no error. `resolve` removes that pit. It accepts every unambiguous shape and routes it correctly; when a call is genuinely ambiguous it raises a precise error instead of silently dropping content. Nothing is ever ignored: every input either builds what you meant or tells you why it can't. local resolve = require("modules.deprecated.zui.widget.args") local children, opts = resolve("panel", a, b) Accepted shapes: resolve("panel", { childA, childB }, opts?) -- canonical array + opts resolve("panel", singleChildNode, opts?) -- a lone widget (auto-wrapped) resolve("panel", { style = …, children = {…} }) -- single options table resolve("panel", { style = … }) -- options only (no children) resolve("panel", nil, opts?) -- no children Errors (never silent) on: * a children array that ALSO carries a `children` key * an options-shaped first argument passed alongside a 2nd options arg * `opts.children` that isn't an array * a first argument that is neither a table, a widget, nor nil

isWidgetNode(t: any) → boolean

ZuiArgs Module Shared argument resolver for container builders (panel, vbox, hbox, grid, …). Container builders historically took `(children, opts)` with children FIRST — but the intuitive call an author reaches for is the single options table `Z.panel({ style = …, children = {…} })` (the shape `card` already uses). Passed to a `(children, opts)` builder, that table landed in the children slot and its `children` key was silently dropped — the panel rendered nothing, with no error. `resolve` removes that pit. It accepts every unambiguous shape and routes it correctly; when a call is genuinely ambiguous it raises a precise error instead of silently dropping content. Nothing is ever ignored: every input either builds what you meant or tells you why it can't. local resolve = require("modules.deprecated.zui.widget.args") local children, opts = resolve("panel", a, b) Accepted shapes: resolve("panel", { childA, childB }, opts?) -- canonical array + opts resolve("panel", singleChildNode, opts?) -- a lone widget (auto-wrapped) resolve("panel", { style = …, children = {…} }) -- single options table resolve("panel", { style = … }) -- options only (no children) resolve("panel", nil, opts?) -- no children Errors (never silent) on: * a children array that ALSO carries a `children` key * an options-shaped first argument passed alongside a 2nd options arg * `opts.children` that isn't an array * a first argument that is neither a table, a widget, nor nil

argtypedescription
tany

resolve(builderName: string, a: any, b: any) →

Resolve a container builder's flexible `(children, opts)` arguments into a definite `(children, opts)` pair, accepting the single options-table form and erroring loudly on ambiguous input rather than silently dropping children. table (carrying `children`), or nil.

argtypedescription
builderNamestringBuilder name used in error messages (e.g. `"panel"`).
aanyFirst argument: a children array, a single widget, an options
banyOptional second argument: the options table when `a` is children.

examples

local kids, opts = resolve("panel", a, b)

Sub-parts

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

2items
This part has no composite children. See the Files segment for its leaf payloads.
backing path · modules/deprecated/zui.module/widget.module/args.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.