refactor(studio): keep the last two files this branch touched under the cap

domEditingLayers and timelineTimingSync were both a handful of lines over from
this branch's additions. Same tightening as the rest: the prose says the same
thing shorter and two single-return objects fit on one line.
This commit is contained in:
Miguel Angel Simon Sierra
2026-08-07 22:14:37 -07:00
parent c25f29c6b9
commit dfd3a20fd5
2 changed files with 6 additions and 22 deletions
@@ -519,28 +519,13 @@ export function buildDomEditTextPatchOperation(
value: string,
childLocator?: DomEditChildLocator,
): PatchOperation {
return {
type: "text-content",
property: "text",
value,
...childLocator,
};
return { type: "text-content", property: "text", value, ...childLocator };
}
/**
* Replace an element's whole contents with markup, for a change no per-child
* operation can express — a text layer added, removed or reordered.
*
* The same operation an inline style edit uses, because it is the same thing:
* this element's children are now these. Both ends run the markup through the
* one sanitizer before it reaches a file.
*/
/** Replace an element's contents with markup, for a change no per-child operation
* can express (a text layer added, removed or reordered). Sanitized at both ends. */
export function buildDomEditRichTextPatchOperation(value: string): PatchOperation {
return {
type: "rich-text",
property: "",
value,
};
return { type: "rich-text", property: "", value };
}
// ─── Non-editable reason ─────────────────────────────────────────────────────
@@ -59,9 +59,8 @@ async function rollbackOwnedMutation(
`/api/projects/${encodeURIComponent(projectId)}/gsap-mutation-rollback/${encodeURIComponent(targetPath)}`,
{
method: "POST",
// Deliberately unclaimed. A rollback runs because a mutation did not
// converge, so the preview is on bytes nobody can vouch for; let the
// restored file reload it rather than suppressing that as our own write.
// Deliberately unclaimed: a rollback runs because a mutation did not
// converge, so let the restored file reload the preview.
headers: { "Content-Type": "application/json" },
body: JSON.stringify({ expected, restore }),
},