From db2e499c07dfe0dab76ce3e2aafc1c8631551fc4 Mon Sep 17 00:00:00 2001 From: Carlos Alcaraz <193642530+calcarazgre646@users.noreply.github.com> Date: Sat, 13 Jun 2026 10:27:50 -0300 Subject: [PATCH] fix(studio): surface save failures when deleting all animations for an element `deleteAllForSelector` fired its mutation with `void commitMutation(...)`, so a failed "Delete all animations for element" was swallowed: no error toast and no `trackGsapSaveFailure` telemetry, leaving the user believing it worked. Every sibling mutation in the hook (`deleteGsapAnimation`, `removeGsapProperty`, `removeAllKeyframes`, etc.) routes through `commitMutationSafely`, which catches the rejection and surfaces it. Route this one through the same wrapper. It is a single user action (one context-menu invocation per element), so the failure toast fires at most once, with no spam. --- packages/studio/src/hooks/useGsapScriptCommits.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/studio/src/hooks/useGsapScriptCommits.ts b/packages/studio/src/hooks/useGsapScriptCommits.ts index 13136b31e..e86017a29 100644 --- a/packages/studio/src/hooks/useGsapScriptCommits.ts +++ b/packages/studio/src/hooks/useGsapScriptCommits.ts @@ -287,13 +287,13 @@ export function useGsapScriptCommits({ ); const deleteAllForSelector = useCallback( (selection: DomEditSelection, targetSelector: string) => { - void commitMutation( + commitMutationSafely( selection, { type: "delete-all-for-selector", targetSelector }, { label: "Delete all animations for element" }, ); }, - [commitMutation], + [commitMutationSafely], ); const addGsapAnimation = useCallback( // fallow-ignore-next-line complexity