Skip to content

[bus 9d] Scenes and project domain: store-owned, routed through run #461

Description

@HaD0Yun

Part of #434 (plan v3).

Scope

Move the scenes and project domain onto the store. Line refs are at 793b4a4; after #460 the code lives in src/domains/scenes.js and the scene/project panels.

Store-owned state: scenes, activeSceneId (:2274-2275), scenesRef (read-only projection), projectName :4308, projectDirty :4309. projectHandleRef stays a runtime handle, off the document. Persistence keeps persistScenes to localStorage (:4277) and the .cclayproject file (:4500). None of this has undo today; scene add, rename, duplicate and reorder get one entry each.

UI writers through run (38 sites, App.jsx:12888 and nearby): scene add/rename/duplicate/reorder/switch/delete, project new/open/save/rename, export.

Semantic commands in src/commands/scene.js, src/commands/project.js, src/commands/export.js: the 6 registered scene/project actions plus the unrouted ones. Exposure follows plan v3:

  • confirm: scene.delete, scene/project loads that replace the document (including the legacy load_scenes path, :5567), project.save when it overwrites a file (it needs user activation, :909), export.shotVideo, file pickers;
  • open: everything that produces one retained undo entry.

Generic fields: add the scene kind to <kind>.set (name, order) and the scene list plus project metadata 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 scene/project rows of the parity matrix, all origins x all checks: pending before -> green after, removed from parity-pending.json.
  2. scene.rename from the agent then edit.undo: no undo before -> name restored after.
  3. Non-UI scene.delete, a replacing project.open and an overwriting project.save: run or unreachable before -> CONFIRMATION_REQUIRED after; the UI path still runs.
  4. inspect_studio document lists the scenes and project name matching the saved .cclayproject projection: missing before -> equal after.
  5. A direct setScenes outside a run in dev: allowed before -> throws after.
  6. Metric: (b) about +38 sites.
  7. npm run build exits 0, the existing suites pass unchanged, and the browser smoke tests pass.

PR rules

One PR on feat/issue-461 with (#461) 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