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

tags

Luau-owned screen-tag registry for zui. Tags are pure derived metadata over the `ui.hideScreen` / `ui.showScreen` / `ui.listScreens` capabilities; the source of truth lives here, not in the engine. Typical use is the editor F1 toggle — every editor-owned UI screen is tagged `"edi…

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

tags

Luau-owned screen-tag registry for zui. Tags are pure derived metadata over the ui.hideScreen / ui.showScreen / ui.listScreens capabilities; the source of truth lives here, not in the engine. Typical use is the editor F1 toggle — every editor-owned UI screen is tagged "editor" at register time and the editor's default scene flips them all in one call via hideByTag / showByTag.

Exports

  • M.set(name: string, tags: { string }?) — replace name's tag set with the array. Nil/empty clears.
  • M.add(name: string, tag: string) — add a single tag, creating the entry if absent.
  • M.remove(name: string, tag: string) — drop a tag; drops the registry entry when the set becomes empty.
  • M.clear(name: string) — drop every tag for name (idempotent).
  • M.get(name: string) -> { string } — sorted array of tags for name (empty when no entry).
  • M.findByTag(tag: string) -> { string } — sorted screens currently registered AND visible-via-ui.listScreens carrying tag.
  • M.hideByTag(tag: string) — hide every currently-visible screen tagged with tag.
  • M.showByTag(tag: string) — show every currently-hidden screen tagged with tag.
  • M._registry: Registry — internal { [name] = { [tag] = true } } map. Inspectable but treat as private.

Types:

  • TagSet = { [string]: boolean }
  • Registry = { [string]: TagSet }
  • ScreenInfo = { name: string, visible: boolean }
  • LiveScreens = { [string]: ScreenInfo }

Usage

local Tags = require("@builtin::modules.zui.tags")

Tags.set("inspector", { "editor" })
Tags.add("console",   "editor")

Tags.hideByTag("editor")   -- hides every visible "editor"-tagged screen
Tags.showByTag("editor")   -- shows every hidden "editor"-tagged screen

local screens = Tags.findByTag("editor")   -- sorted live matches

Notes

  • Registry is not auto-pruned. ui.listScreens() is one frame behind, so same-frame register-then-tag flows must keep their entries intact; bulk ops filter via the live screen snapshot.
  • Memory is bounded by total session screen count.
  • set with nil / {} is the only way to clear an entry through set; use clear(name) for the explicit variant.
  • All bulk ops are silent on missing FFI bindings (ui.hideScreen, ui.showScreen, ui.listScreens) — safe to call before the UI layer is wired.

Interface

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

conforms to

zero/source-extract/v2

ZuiTags Module Luau-owned screen-tag registry. Tags are pure derived metadata over the `ui.hideScreen` / `ui.showScreen` / `ui.listScreens` capabilities; the source of truth lives here, not in the engine. Typical use is the editor F1 toggle: every editor-owned UI screen is tagged "editor" at register time (transparently via Z.app's `{ build = fn, tags = {...} }` sugar), and the editor's default scene flips them all in one call via `Z.tags.hideByTag("editor")` / `Z.tags.showByTag("editor")`. Lifecycle: - `Z.tags.set(name, tags)` replaces a screen's tag set. - `Z.tags.clear(name)` drops every tag for the screen. - findByTag / hideByTag / showByTag filter against `ui.listScreens()` so a registry entry for a not-yet-registered or already-unregistered screen is silently skipped (no error, no false hit). The registry itself isn't auto-pruned — `ui.listScreens()` is one frame behind so same-frame register-then-tag flows must keep their entries intact. Memory is bounded by total session screen count. Consumers: local Tags = require("modules.deprecated.zui.tags") Tags.set("inspector", { "editor" }) Tags.hideByTag("editor")

ensure(name: string) → TagSet

Internal: get or create the tag-set for `name`.

argtypedescription
namestring

liveScreens( ) → LiveScreens

Internal: snapshot the Rust-side `ui.listScreens()` registry into a map keyed by screen name. One FFI call per bulk op — caller-side iteration is cheap.

maskFor(hasEditor: boolean) → number

argtypedescription
hasEditorboolean

syncRenderLayer(name: string) → void

Push the screen's current render-layer membership to the engine, derived from whether it still carries the `editor` tag. Safe to call before the screen is registered (the engine command no-ops until the screen exists) and idempotent.

argtypedescription
namestring

set(name: string, tags: { any }?) → void

Replace `name`'s tag set with the array `tags`. Passing `nil` or an empty list clears the entry. Non-string / empty tags are filtered out; if the resulting set is empty the entry is dropped entirely. filtered out, so the element type is `any`. Empty or nil drops the entry.

argtypedescription
namestringThe screen name to associate the tags with.
tags{ any }?Array of tag entries (1-based); non-string / empty values are

examples

Tags.set("inspector", { "editor", "tool" })
Tags.set("inspector", nil)  -- clears

add(name: string, tag: string) → void

Add a single tag to `name`. Creates the registry entry if absent. No-op when `name` or `tag` is empty / not a string.

argtypedescription
namestringThe screen name to tag.
tagstringThe tag to add.

examples

Tags.add("inspector", "editor")

remove(name: string, tag: string) → void

Remove a single tag from `name`. If the resulting set is empty, the registry entry is dropped so the screen no longer counts as tagged at all. No-op when there is no entry for `name`.

argtypedescription
namestringThe screen name to untag.
tagstringThe tag to remove.

examples

Tags.remove("inspector", "editor")

clear(name: string) → void

Drop every tag for `name`. Idempotent — safe to call when no entry exists.

argtypedescription
namestringThe screen name whose tags should be cleared.

examples

Tags.clear("inspector")

get(name: string) →

Return `name`'s tags as a sorted `{ string }` array (deterministic order for tests and debug output). Returns an empty array when there is no registry entry.

argtypedescription
namestringThe screen name to query.

examples

local tags = Tags.get("inspector")

findByTag(tag: string) →

Return `{ "screenName", ... }` of every registered screen carrying `tag`. Sorted. Entries whose screen isn't currently in `ui.listScreens()` are filtered out (but kept in the registry).

argtypedescription
tagstringThe tag to filter by.

examples

local screens = Tags.findByTag("editor")

hideByTag(tag: string) → void

Hide every currently-visible screen tagged with `tag`. Calls `ui.hideScreen` once per match. No-op if no match.

argtypedescription
tagstringThe tag whose screens should be hidden.

examples

Tags.hideByTag("editor")

showByTag(tag: string) → void

Show every currently-hidden screen tagged with `tag`. Calls `ui.showScreen` once per match. No-op if no match.

argtypedescription
tagstringThe tag whose screens should be shown.

examples

Tags.showByTag("editor")
⌬ Types
TagSet = { [string]: boolean }Registry = { [string]: TagSet }ScreenInfo = { name: string, visible: boolean }LiveScreens = { [string]: ScreenInfo }

Sub-parts

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

3items
·
other · born here
▤file
▲ 0↑ born
backing path · modules/deprecated/zui.module/tags.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.