Skip to content

[bus 9b] Objects domain: store-owned, routed through run #445

Description

@HaD0Yun

Part of #434 (plan v3).

Scope

Move the objects domain onto the store, following the pilot (#447). Line refs are at 793b4a4; after #460 the code lives in src/domains/objects.js and the hierarchy/Inspector panels.

Store-owned state: the scene-history storeRef (:2290) and its transactions (:2371-2395) become the objects slice of the document store. Persistence keeps scene.objects and the IndexedDB assets. The write guard turns on for objects.

UI writers through run (48 sites, App.jsx:15069 and nearby, src/hierarchy-panel.jsx, src/object-gizmo.jsx):

  • gesture sessions: gizmo drag, scrub, matte (drafts :2479-2487), each through run.begin / run.commit;
  • add/import/spawn (:2536-2800), including asset.import, which the UI doesn't route today;
  • delete, rename, group/ungroup.

Semantic commands in src/commands/objects.js: object.add, object.remove, object.rename, object.group, object.ungroup, asset.import, and objects.arrange, which takes the planner at src/studio-agent-commands.js:154 as-is. arrange_objects becomes a thin alias. Bulk delete is one atomic retained entry, so it stays open.

Generic fields: add the object kind to <kind>.set (normalized with normalizeSceneObject from src/scene-objects.js) and the objects slice to inspect_studio document.

Depends on

Files and concurrency

Acceptance

Each check is a red test(...) commit that fails, then a green commit that makes it pass.

  1. The object rows of the parity matrix, all origins x all checks: pending before -> green after, removed from parity-pending.json.
  2. A gizmo drag via run.begin: no receipt before -> one undo entry and one receipt after.
  3. object.set {scale: 500} from the agent: no command before -> lands the clamped value after. object.set and patch_elements give identical post-state for every patchable object path.
  4. inspect_studio document for objects deep-equals the scene.objects projection: missing before -> equal after.
  5. A bulk delete of 3 objects: several entries before -> one entry, undone deep-equal after.
  6. A direct store.* write outside a run in dev: allowed before -> throws after.
  7. Metrics: (a) about 20 fewer store.* refs, (b) about +48 sites.
  8. npm run build exits 0, the existing suites pass unchanged, and the browser smoke tests pass.

PR rules

One PR on feat/issue-445 with (#445) in the title, against main. Attach the red/green commit list and the test output. Do not merge.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions