Skip to content

Expose generic host integration primitives#514

Merged
Aymericr merged 1 commit into
mainfrom
feat/host-integration-primitives
Jul 19, 2026
Merged

Expose generic host integration primitives#514
Aymericr merged 1 commit into
mainfrom
feat/host-integration-primitives

Conversation

@Aymericr

@Aymericr Aymericr commented Jul 19, 2026

Copy link
Copy Markdown
Contributor

Summary

  • expose generic scene commit, snapshot, patch, and read-only boundaries for host integrations
  • support host-delegated undo/redo without changing standalone history behavior
  • expose generic camera pose events and bounded transient draft-preview stores
  • apply node and material patches atomically while preserving plugin-installation state

Why

Hosted consumers need stable integration points without coupling the open-source packages to any transport, backend, identity model, or product workflow.

Impact

Standalone behavior remains local by default. Hosts may subscribe to semantic scene commits, apply host-owned snapshots or patches outside local history, delegate history commands, and consume transient camera or drafting state.

Verification

  • bun check
  • 1,981 package tests passed; 1 skipped
  • forced type checks passed for @pascal-app/core, @pascal-app/editor, and dependencies

Note

Medium Risk
Touches core scene history, host patch atomicity, and camera control paths; regressions could affect undo boundaries or collaborative sync, though behavior is heavily tested and standalone defaults stay local.

Overview
Introduces host integration primitives on top of the existing Zundo scene store: subscribeSceneCommits emits coalesced before/current snapshots (skipping semantic no-ops), while applyScenePatch and applySceneSnapshot apply host-owned changes outside local undo history, with refcounted acquireSceneReadOnlyLease replacing ad hoc version-preview locking. runAsSingleSceneHistoryStep now drops no-op compound transactions from both commit notifications and past states.

Camera gains a shared CameraPose model and bus events (apply-pose, pose, cancel-pose, interaction-start); the editor applies poses with bounded interpolation and publishes live poses when the user navigates.

Editor hosting: optional viewerSceneSlot / floorplanSceneSlot, exportable FloorplanNodePreview, and installHistoryCommandDelegate so hosts can own undo/redo while standalone still uses Zundo. Transient draft state is expanded (usePathDraftPreview, richer floorplan/fence/stair stores) and wired from MEP and structure tools so external 2D previews stay in sync.

Schema / systems: LevelNode officially allows MEP child IDs (schema v2). Elevator auto-opening updates run with history paused so derived slab holes share one undo step with the elevator edit. Minor 2D fixes include fresh-placement commit on the registry move overlay and stair rotate keys gated to 2D view.

Reviewed by Cursor Bugbot for commit 8f1c834. Bugbot is set up for automated code reviews on this repo. Configure here.

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes using high effort and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 8f1c834. Configure here.

sfxEmitter.emit('sfx:item-place')
useViewer.getState().setSelection({ selectedIds: [committedId] })
}
return

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fresh 2D commit breaks pause

High Severity

The new 2D fresh-placement commit path calls commitFreshPlacementSubtree while pauseSceneHistory is still active. That helper always calls temporal.resume() after deleting the draft, which turns Zundo tracking back on even though the overlay’s pause depth is still greater than zero. The follow-up createNodes can then land in local undo history as extra or misaligned steps instead of one clean placement.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 8f1c834. Configure here.

@Aymericr
Aymericr merged commit c0a5db9 into main Jul 19, 2026
3 checks passed
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