Skip to content

102b-flows: one flow, many objects — Object Selector by tag / group / name, Fired Object, give this flow to the selection - #593

Open
AlexZ005 wants to merge 8 commits into
mainfrom
feat/102b-flows
Open

AlexZ005 wants to merge 8 commits into
mainfrom
feat/102b-flows

Conversation

@AlexZ005

Copy link
Copy Markdown
Collaborator

Roadmap 102 batch 2, lane 102b-flows (scout row 3: one flow for many objects). No own release: rides the next integrator. One commit set per row, so a row can be dropped.

What people get

  • Tags (Inspector ▸ Tags). Chips on one or many selected objects; with several selected a chip shows how many carry it (2/5).
    • Saved with the scene, replicated, one undo per change. Agents: update_objects tags: [...].
  • Object Selector by tag, group or name (row 1). The card's first field picks One object (the default, every older scene) / By tag / By group / By name.
    • Name pattern: case-insensitive glob, * any run, ? one character, no wildcard = "contains" (Star*, *coin*, enemy ?).
    • The card shows a live count ("12 objects" / "matches no objects").
    • An effect wired into a set selector acts on every member (every effect family fans out). A trigger wired to one (On Click, Hover, Hit, Enter, Grab ...) fires when any member does.
    • Fired Object (new Scene node): wire a trigger in, get the object it fired for last. The selector's own object output gives the same for a set (else its first member).
    • Flow lint: "Matches no objects" on the first wire into an empty set selector (fix = Disconnect). Debugger focus panel: what the set resolves to and who fired last.
  • Give this flow to the selection (row 2; object menu ▸ Physics & effects, Shift+F10 / Menu key reaches it).
    • Plain copies. Inside each copy, a reference to the source object is re-pointed at the receiver ("click me, hide me" stays "click me, hide me"); other references are kept.
    • A receiver that already has a flow is asked first. One undo.
    • Update all copies from this one (N) pushes an edited flow back out to the family (userData.flowFrom). One undo.
  • Shipped scenes unchanged (row 3): 160 Object Selectors in 40 scenes, all single-target (label/selected/type); a selector without pick takes the old code path (unit test pins it).

Forks and the recommendations taken: Q1-Q7 in the lane's QUESTIONS file (plain copies; set output = last fired else first; group = Objects-panel group; glob syntax; one Fired Object node + additive obj; cost gate reading; self-reference re-pointing).

Proof (battery rule 21 Nov: lane suites, no lane battery)

  • New suite for the int union battery: flows-many-102b (two peers + reload, 360 s; in battery.json). Lane run on the final code (39bfc12, Deck local slot, load ~25): 38/38 PASS, rc=0, no page errors on either peer. One earlier run went red only at B's reload (the page took > 30 s to boot beside a running battery); the suite now gives that reload 120 s (39bfc12).
  • Screenshots (dark + light, no emoji in UI text): the flow graph with a By tag selector ("3 objects") and Fired Object, and the Inspector Tags section. In the lane evidence (shots2/).
  • Cost gate (200 objects ≤ 1 ms/tick) PASS: scripts/selector-cost-bench.cjs, prod build on the Deck with a monotonic synthetic clock.
    • No flow 0.082 ms/tick. 200 single selectors 0.964. ONE tag selector over the same 200: 0.907. Tag + On Click / Fired Object: 1.058.
    • The set adds 0.82 / 0.98 ms over the floor, no more than today's 200 single selectors. The set lookup is memoised per tick.
  • Save file: additive only.
    • A lane-saved scene opens in v1.72.0. userData.tags, userData.flowFrom and the selector's pick/match are kept verbatim and survive a v1.72.0 re-save.
    • A v1.72.0 scene opens on the lane with no key added, and a lane re-save adds no pick / flowFrom / tags.
  • Feature unused = zero change:
    • The suite's §4: a plain selector pulse carries no obj and acts on its one object as before.
    • Row 3 unit: the shipped selector shape resolves through the boot half without loading the resolver.
    • nodetrigger gets obj only when a set selector or a Fired Object listens.
  • Unit: new selectorCore (13), flowGive (3); extended flowLint, runtimeTools85, nodeRegistry. Full suite green (469 files, 5276 tests).
  • Gates: check-ratchet 274/37 = baseline; check:tokens, check:emoji, check:storage, check:zindex, check:loaders, check:render-seam clean; npm run build green.
  • Boot KB (boot-size.cjs --diff vs a v1.72.0 build): play +2.1 KB gz (2119.3 of 2120.0), editor +3.8 KB gz (3324.3 of 3325.0). Chunk count is the same as the base's.
    • Boot covers: the runtime fan-out + Fired Object in flowRuntime (+1.2 KB, the hot path), the selector's boot half (riding the flowStore chunk), the node def, two validators, two appliers, the object-menu rows, the lint rule.
    • The editor sits above the ~3 KB guideline. The extra is the editor-only Flow card (+0.7 KB: the pick field and the lint menu) and the object menu rows (+0.3 KB).
    • Lazy: the resolver (selectorCore), the Tags section, the card's set fields, flowGive.
    • Trap found on the way (b7c41a5): a small boot module that a LAZY chunk also imports becomes a chunk of its own. Its name then rides every lazy import's preload list, about 20 B in each of ~100 boot chunks (+1.3 KB in all here). Keep lazy chunks off boot leaves, or re-export the leaf from a store that is already in boot.

For the integrator

  • Sync: objectParameters gains parameter: 'tags' and 'flowFrom' (validated). nodetrigger gains optional obj (a uuid; the validator accepts it absent). Older peers ignore all three.
  • Scene format: additive only: userData.tags, userData.flowFrom, objectselector data pick / match.
  • Merge note: 102b-arrange (102b-arrange: arrays, hold-B corner snap, layers and tidy tools #587) touches the same hunks in commandsHandler (objectParameters branches), wireValidate (objectParameters) and Inspector (sections). Keep both sides.
  • Boot budget: play is at 2119.3 / 2120.0 on its own. With the other 102b lanes the int will likely need to raise the line, with a reason.
  • Observation (not this lane's bug): a nodesync snapshot MERGE never deletes. A snapshot pulled from a peer that has not yet applied a graphdelete brings the deleted object graph back on the puller. This affects every graphdelete; worth a ticket.
  • Docs: fragment with the Tags / Object Selector / Fired Object / lint + debugger / Give this flow sections is in the lane evidence (docs-fragment.md). Changelog line: "One flow, many objects: tag objects in the Inspector, point one Object Selector at every object with a tag, in a group or matching a name, and a new Fired Object node says which one was clicked or touched. Give an object's flow to the rest of the selection, and update all the copies from any one of them."

🤖 Generated with Claude Code

AlexZ005 and others added 8 commits November 21, 2026 19:16
…ector resolver core (102b-flows row 1a)

userData.tags (the field behaviours already read) gets a write path: an Inspector Tags
section (chips, add on Enter, union over a multi-select as one undo step), its own
'tags' history kind, and objectParameters parameter 'tags' (validated, cleaned again on
apply). selectorCore.js is the pure half of the many-target Object Selector: tag / group
/ name-pattern resolution, outermost match wins, scene order.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…t membership, Fired Object (102b-flows row 1b)

An Object Selector with pick tag / group / name resolves to a set (memoised per tick per
question). Every effect pair collection fans out over the set, with ONE resolveInputs
per edge and a per-member key on the rising-edge maps (Play Animation, Set Expression,
physics actions; sound and particle voices get a member id), so every member acts on
the same pulse. Triggers fire for any member (reachesObjectSelector, hover, watched
objects). A new Fired Object node says which member fired; the stamp carries an
additive optional 'obj' field on nodetrigger only when something listens (older peers
ignore it, the validator accepts absent). Physics props, jiggle and patrol read the
set too. A selector without pick takes the old code path.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…r and agent tools see the set (102b-flows row 1c)

The Object Selector card gets a pick menu (One object / By tag / By group / By name),
a match field (tag suggestions from the scene, a group list, a name glob) and a live
count of what it resolves to. pick / match are declared params (legacy 'object'), so
create_flow_nodes and describe_node_types take them. Flow lint flags a set that
matches nothing (dashed wire + chip, Disconnect); the debugger shows the resolved set
for a selector and 'acts on N objects' for a node wired into one. The agent scene
check reaches a set's members (no false source-no-object), warns on an empty set, and
update_objects takes tags.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…this one; boot half of the selector split out (102b-flows row 2)

Object menu (Physics & effects): with several objects selected, 'Give this flow to the
selection' copies the clicked object's flow onto the others as plain copies (fresh node
ids; references to the source re-pointed at each receiver; an existing flow replaced in
place after one confirm, so a Scene-graph embed of it survives). Receivers get
userData.flowFrom (the family root, objectParameters 'flowFrom', additive), and any
member's menu offers 'Update all copies from this one'. One undo step (flowreplace
kind); no new wire type. flowGive.js is a lazy chunk.

Boot: selectorPick.js is the boot half (pick tests, tag cleaning, a sync resolveTargets
that loads selectorCore.js on first use and when a graph holds a many-target selector);
the Inspector Tags section and the card's set fields are lazy chunks.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… handler cleans tags inline (102b-flows)

play +2.5 KB gz, editor +4.4 KB gz vs v1.72.0 (boot-size.cjs, both ok).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ct cost bench, row 3 zero-change unit (102b-flows)

flows-many-102b: tags replicate + survive a reload; a tag selector fans one click out to every
member on both peers and the pulse names the member (obj); Fired Object agrees on both; a
plain one-object selector sends no obj and acts as before; Give this flow / Update all copies
reach the other peer, two undos and a redo replicate. 38/38 green.

selector-cost-bench: 200 boxes, prod build, monotonic synthetic clock. One tag selector
spinning all 200 = 0.907 ms/tick, 200 single selectors = 0.964, no flow = 0.082: the set
adds 0.82 ms over the floor (gate 1 ms) and is no dearer than today's 200 selectors.

flowGive: the whole-document 'nodes' message carries the empty scene arrays the validator wants.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…he flowStore chunk, tag helpers lazy (102b-flows)

selectorPick.js was a chunk of its own (its lazy importers selectorCore and the
debug flowLint import gave it a reach no other module had), so its name joined
every lazy import's preload list: ~20 B in a hundred boot chunks plus the
chunk's own 0.5 KB. selectorCore now keeps its own copies of the four tiny
helpers (a unit test keeps them equal), flowLint tests the pick inline, and
flowStore re-exports resolveTargets so the boot half lands in its chunk.
normalizeTag(s)/MAX_TAGS/MAX_TAG_LEN moved to selectorCore (lazy); the card's
pick tooltips moved to the lazy set-fields component.

Boot vs v1.72.0: play +2.1 KB (2119.3/2120.0), editor +3.8 KB (3324.3/3325.0);
chunk count back to the base's.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ed machine (102b-flows)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant