File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -48,6 +48,12 @@ export interface OpenCompositionOptions {
4848 trackedOrigins ?: unknown [ ] ;
4949 /** Auto-coalesce window for history entries (ms). Default: 300. */
5050 coalesceMs ?: number ;
51+ /**
52+ * Pass `false` to skip attaching the history module (undo/redo).
53+ * Default: history is attached in standalone (non-embedded) mode.
54+ * Use when the host owns the undo stack and SDK undo is dead weight.
55+ */
56+ history ?: false ;
5157}
5258
5359// ─── Implementation ───────────────────────────────────────────────────────────
@@ -495,7 +501,7 @@ export async function openComposition(
495501
496502 const isEmbedded = opts ?. overrides !== undefined ;
497503
498- if ( ! isEmbedded ) {
504+ if ( ! isEmbedded && opts ?. history !== false ) {
499505 const history = createHistory ( session , {
500506 coalesceMs : opts ?. coalesceMs ?? 300 ,
501507 trackedOrigins : opts ?. trackedOrigins ,
Original file line number Diff line number Diff line change @@ -97,7 +97,9 @@ export function useSdkSession(
9797 // 'change' AND Studio writes explicitly) and race on disk; it would
9898 // also write the full active-composition serialization to the fixed
9999 // persistPath even when an edit targeted a sub-composition file.
100- const comp = await openComposition ( content ) ;
100+ // Studio's editHistory is the authoritative undo stack — SDK history
101+ // is unused dead weight here (forceReloadSdkSession discards it on undo).
102+ const comp = await openComposition ( content , { history : false } ) ;
101103 // Cleanup may have fired while openComposition was awaited; dispose immediately.
102104 if ( cancelled ) {
103105 comp . dispose ( ) ;
You can’t perform that action at this time.
0 commit comments