@@ -7,6 +7,7 @@ import { applySoftReload, extractGsapScriptText } from "../utils/gsapSoftReload"
77import type { SoftReloadResult } from "../utils/gsapSoftReload" ;
88import { trackStudioEvent } from "../utils/studioTelemetry" ;
99import { serializeStudioFileMutation } from "../utils/studioFileMutationCoordinator" ;
10+ import { trackedStudioEdit } from "../utils/studioPendingEdits" ;
1011import {
1112 getStudioSaveErrorMessage ,
1213 isStudioSaveErrorAlreadyToasted ,
@@ -416,20 +417,20 @@ export function useGsapScriptCommits({ projectIdRef, activeCompPath, previewIfra
416417 }
417418 return run ( ) ;
418419 } ;
419- const commit : CommitMutation = ( selection , mutation , options ) => {
420+ const commit : CommitMutation = trackedStudioEdit ( ( selection , mutation , options ) => {
420421 if ( ! activeProjectId ) return Promise . resolve ( ) ;
421422 const file = selection . sourceFile || activeCompPath || "index.html" ;
422423 return serializeCommit ( file , options . serializeKey , ( ) =>
423424 runCommit ( activeProjectId , activeCompPath , file , selection , mutation , options ) ,
424425 ) ;
425- } ;
426- commit . batch = ( calls , options ) => {
426+ } ) as CommitMutation ;
427+ commit . batch = trackedStudioEdit ( ( calls : CommitMutationCall [ ] , options : CommitMutationOptions ) => {
427428 if ( ! activeProjectId ) return Promise . resolve ( ) ;
428429 const file = calls [ 0 ] ?. selection . sourceFile || activeCompPath || "index.html" ;
429430 return serializeCommit ( file , options . serializeKey , ( ) =>
430431 runBatchCommit ( activeProjectId , activeCompPath , file , calls , options ) ,
431432 ) ;
432- } ;
433+ } ) ;
433434 return commit ;
434435 } , [ runCommit , runBatchCommit , activeCompPath , activeProjectId , writeProjectFile ] ) ;
435436 const trackGsapSaveFailure = useGsapSaveFailureTelemetry ( activeCompPath ) ;
0 commit comments