Skip to content

102b-arrange: arrays, hold-B corner snap, layers and tidy tools - #587

Open
AlexZ005 wants to merge 4 commits into
mainfrom
feat/102b-arrange
Open

AlexZ005 wants to merge 4 commits into
mainfrom
feat/102b-arrange

Conversation

@AlexZ005

Copy link
Copy Markdown
Collaborator

Roadmap 102 batch 2, lane 102b-arrange (scout rows 2, 9, 21). No own release: rides the next integrator. One commit per row (row 1, row 3, row 2), plus one fix commit, so a row can be dropped.

What people get

  • Array (row 1, Inspector ▸ Array). Repeat the selected object in a line, a grid, a circle or along a Path.
    • Settings: count; step; per-axis grid; radius + arc + face out; path + spacing + follow; a turn and a growth per copy. At most 500 copies.
    • The copies change live as you drag a field. Make real objects turns them into ordinary objects; Remove array takes them away.
    • Which linkage, and why: a live array. One record sits on the object (userData.array, about 200 bytes), and every peer draws the copies itself as ONE InstancedMesh per source mesh beside it.
      • Edits are one message and one undo (DragRow gestures fold), and the copies follow every change to the source.
      • Copies render in Play and exports (Scene.svelte is shared).
      • Prefab instances were the alternative: N objects plus a library record, and N messages per count change. Scatter is terrain-bound.
      • Limits (in the docs): copies have no physics or logic until made real, are not clickable, are not in a glTF export of the object, and skip skinned meshes.
    • Make real objects = the existing duplicate + move messages in ONE wire batch envelope and ONE history batch. No new message type.
  • Tidy (row 9):
    • Layers (Configure Scene ▸ Layers; Inspector ▸ Tidy ▸ Layer): name, colour, hide, lock.
      • Hide is this screen only (a park hook keeps saves and syncs whole; Play shows everything).
      • Lock is shared: viewport clicks and box select pass through, and the object list can still pick the objects.
      • Object-list rows get a colour dot.
    • Select similar: shape / material / prefab / tag / layer.
    • Rename many: {n} counter, {name}, start, digits, live preview.
    • Randomise: turn / size / move within ranges, seeded.
    • Each action is one undo and one wire envelope.
  • Corner snap (row 21): hold B while moving. The nearest corner of the selection snaps onto a corner or edge middle of the object under the pointer.
    • Works with the grid snap, and the stored snap settings are untouched.
    • V was taken (push-to-talk), so the key is B. It is listed in Settings ▸ Shortcuts.
    • Desktop gizmo plus the multi-select pivot. The VR move path is separate (not shared), so it is not wired there.
  • Agents: update_objects gains array, makeReal and layer (by name; it makes the layer when new). list_scene reports array and layer.

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

  • New suites for the int union battery (in battery.json suites):
    • array-tool (300 s; two peers + reload)
    • corner-snap (180 s)
    • tidy-layers (300 s; two peers + reload)
  • arrange-compat is in exclude: a two-tree proof, run with ARRANGE_COMPAT=base on the older release's tree, then on the lane.
  • Lane run (PC remote slot, final code 09e0072): all four green, 93 PASS / 0 FAIL.
  • A lane-saved file opens in v1.71.0 (its own build): no page error. userData.array, userData.layer and the layers table are kept and saved back; 1.71 just does not draw them.
  • Old scenes load unchanged: a scene made in v1.71.0 loads here with the SAME content signature v1.71.0 computes (aaacd5ab66b14529 both), and nothing new is written for it.
  • Feature unused = zero change:
    • No layers key in the scene snapshot (asserted) and no array key on objects.
    • The new appliers act only on their own parameters.
    • The marquee and pick changes act only on objects that have a layer.
  • Unit: arrayCore (14), tidyCore (10, incl. the lock pick stack). Full unit suite green (468 files, 5264 tests).
  • Gates: check-ratchet 274/37 = baseline; check:tokens, check:emoji, check:storage, check:zindex, check:loaders and check:render-seam clean; npm run build green.
  • Boot KB: editor +2.3 KB gz, play +1.7 KB gz vs a v1.71.0 build (boot-size.cjs --diff), within the ~3 KB rule.
    • That covers the boot leaves arrayTick and layersCore, the hold-B listener, two validators, two appliers, two undo rows, the shortcut row and the Inspector/Objects wiring.
    • Everything else is lazy: arrayRuntime, arrayActions, tidyActions, layersRuntime and the three Inspector sections.
    • Play is now at 2115.5 of its 2116.0 KB budget.

For the integrator

  • Sync: objectParameters gains parameter: 'array' and 'layer' (validated). An older peer ignores them: it neither draws the copies nor knows the layer, and a lock does not apply on its screen.
  • The layer table rides the existing scenephysics singleton as an optional field, and an older peer keeps it verbatim.
  • Found, not fixed (pre-existing): a joiner's full sync and its reload rejoin go through glTF, whose loader sanitizes node names, so "Wall 2" arrives as "Wall_2". A .tpscene open keeps the space.
  • Docs fragment and summary: ~/.code/lanes-30/after-102/102-102b-arrange/ (docs-fragment.md, summary.md).

🤖 Generated with Claude Code

AlexZ005 and others added 4 commits November 21, 2026 18:25
…or along a path (102b row 1)

A live ARRAY on the object (userData.array, one objectParameters 'array' message and one props
undo per edit): every peer draws the copies itself as one InstancedMesh per source mesh beside
the object (arrayRuntime, lazy; scene-root visual, never saved or sent, raycast off). Count,
step / grid / radius + arc + face out / path + spacing + follow, a turn and growth per copy,
at most 500. Make real objects = the existing duplicate + move messages in ONE wire batch and
ONE history batch. Agents: update_objects {array, makeReal}; list_scene reports the array.

Pure pose maths in arrayCore.js (vitest); boot cost is the arrayTick leaf + appliers only.
Suite: array-tool (two peers + reload).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ner or edge middle (102b row 3)

A momentary mode on top of 19-B element snap: while B is held during a translate drag, the
search offers only exact points (the hovered triangle's corners, edge midpoints and the hovered
object's box corners + box edge midpoints) and the anchor is the dragged object's NEAREST corner
(its own vertices up to 4000, else its box corners; a multi-select pivot uses the primary's box).
Works with grid snap; the stored snap targets are untouched; a text field types a B. V is voice
push-to-talk, so the key is B, listed as a fixed row in Settings > Shortcuts. LOCAL, never sent.
Suite: corner-snap.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Layers: the table {id, name, color, locked?} rides the scenePhysics singleton as an optional
`layers` field (absent unless authored, so a scene without layers is byte-identical; no new
message); an object names its layer in userData.layer (objectParameters 'layer', props undo).
HIDE is this screen's only (layersRuntime, lazy; a park hook shows the objects for every
serializer, Play shows everything). LOCK is shared scene data: the editor pick pass makes locked
objects click-through (selectThrough via editorPass, never a game's rays) and the box selection
skips them; the object list can still pick them and shows a colour dot per layer.

Tidy (Inspector > Tidy, lazy): Layer picker, Select similar (shape / material / prefab / tag /
layer), Rename many ({n} counter, {name}, start, digits, preview) and Randomise (turn / size /
move within ranges, seeded) — each ONE history batch and ONE wire envelope. Configure Scene >
Layers lists, hides, locks, selects and removes layers. Agents: update_objects {layer: name},
list_scene reports the layer by name.

Pure halves in tidyCore.js + layersCore.js (vitest). Suites: tidy-layers (two peers + reload),
arrange-compat (a lane file opens in v1.71.0; an old scene loads unchanged — a lane proof across
two trees, excluded from the battery).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…through the renderer canvas

A locked object marked see-through was still the FALLBACK pick of primaryIndex when nothing
else was under the click, so a lone locked box selected. pickStack now drops entries on a
locked layer (editor pass only), so desktop clicks, Alt-cycling and the VR laser agree.
Suites: pixels from globalRenderer.domElement (querySelector('canvas') is another canvas),
the gizmo hook is three's 'change', a reloaded joiner rejoins by itself (wait, dial only if
not), rename across a rejoin uses hyphens (glTF sync sanitizes spaces — pre-existing), and
arrange-compat resets the scene physics block before building the old scene.

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