Skip to content

refactor(studio): delete the move writer no Studio path calls - #4837

Merged
miguel-heygen merged 1 commit into
mainfrom
refactor/studio-delete-var-offset-move-writer
Oct 1, 2026
Merged

miguel-heygen merged 1 commit into
mainfrom
refactor/studio-delete-var-offset-move-writer

Conversation

@miguel-heygen

@miguel-heygen miguel-heygen commented Oct 1, 2026 •

Copy link
Copy Markdown
Collaborator

What changes

Deletes handleDomPathOffsetCommit from useDomGeometryCommits. It is the old move writer that adds a move as --hf-studio-offset-x/y on top of the layer's translate, and no Studio path calls it.

Every move in Studio reaches handleGsapAwarePathOffsetCommit instead:

  • the canvas drag and nudge, through ConnectedDomEditOverlay;
  • the Properties panel's X/Y, through StudioRightPanels;
  • webmcp's moveTo;
  • host apps, which read the session's handleDomPathOffsetCommit.

useDomEditSession maps that name to the GSAP-aware handler. It never takes the useDomGeometryCommits one, which useDomEditCommits returned without anyone reading it.

How

  • Removes the handler from useDomGeometryCommits and from useDomEditCommits's return.
  • Deletes buildPathOffsetPatches. Since fix(studio): resize an element without GSAP by its own width, height and translate #4805 the resize writes its anchor as a plain translate, so the deleted handler was its last caller. applyStudioPathOffset stays: the seek re-apply and the drag still use it.
  • The box-size, rotation and reset writers in the same hook stay, and so do the snapshot helpers and buildClearPathOffsetPatches (Reset).
  • Removes the tests of what is gone:
    • the handler's three tests (one line of the rollback test and the two read-only-preview offset tests);
    • buildPathOffsetPatches's own tests and its combined-with-box-size tests (manualEditsDomPatches.test.ts);
    • the persist-seam case that saved its patches (persistSeam.integration.test.ts);
    • the anchored-resize "persist and reload" case that modelled the old offset-variable resize save (anchoredResizeReleaseShift.test.ts). The anchor-loop tests in that file stay.
  • Rewords the comment in manualEditsDom.ts that cited buildPathOffsetPatches.
  • Deletes the GSAP fallback guard (rejectGsapCssFallback), the hook's previewIframeRef parameter and gsapTargetCache.ts. Since fix(studio): a rotate without GSAP saves where you let go, nested too #4802 the rotate no longer uses the guard, so the deleted handler was its last caller and the cache's only consumer; their .fallowrc.jsonc entries go too.
  • Adds gsapTargetCache.ts to ALLOWED_DELETIONS in scripts/check-no-main-deletions.mjs, with the reason.

Proof it was dead

git grep -n buildPathOffsetPatches now finds nothing. git grep -n handleDomPathOffsetCommit in this repo finds the name only in:

  • the session alias;
  • the context;
  • the overlay and panel wiring;
  • webmcp;
  • this hook, its useDomEditCommits passthrough and its tests.

The session's useDomEditCommits destructure (useDomEditSession.ts) never took it.

Tests

useDomGeometryCommits.test.tsx, useDomEditCommits.test.tsx, manualEditsDomPatches.test.ts, manualEdits.test.ts, persistSeam.integration.test.ts and anchoredResizeReleaseShift.test.ts pass, and so does the whole studio suite (6289 tests). Studio tsc, oxlint and oxfmt are clean on the changed files.

Before

Main at this PR's merge base, a box with no GSAP and translate: 40px 30px. Typing X = 100 in the Layout row saves only style="translate: 100px 30px" on the box; dragging it +90/+60 then saves only style="translate: 190px 90px". Each panel shows the Studio after that step; below them is the saved file's diff for each step.

Before: X = 100 saves translate 100px 30px, the drag saves translate 190px 90px

After

Same fixture and steps on this PR's head: the same two saves, style="translate: 100px 30px" and then style="translate: 190px 90px", byte for byte the same files as on main.

After: the same two saves as on main

@miguel-heygen
miguel-heygen force-pushed the refactor/studio-delete-var-offset-move-writer branch from 65743a5 to c3d9bc9 Compare October 1, 2026 06:36
@github-actions

github-actions Bot commented Oct 1, 2026 •

Copy link
Copy Markdown

Edit accuracy: 557 passing here, 557 on the base branch

The gate passes.
Smoothness is reported in the artifact, not gated. A case fails only if it fails 2 of 3 runs.

@miguel-heygen
miguel-heygen force-pushed the refactor/studio-delete-var-offset-move-writer branch 3 times, most recently from 998b018 to 1785197 Compare October 1, 2026 11:12
@miguel-heygen
miguel-heygen force-pushed the refactor/studio-delete-var-offset-move-writer branch from 1785197 to 439257a Compare October 1, 2026 11:28
@miguel-heygen
miguel-heygen marked this pull request as ready for review October 1, 2026 12:44
@miguel-heygen
miguel-heygen merged commit 0b417cb into main Oct 1, 2026
157 of 158 checks passed
@miguel-heygen
miguel-heygen deleted the refactor/studio-delete-var-offset-move-writer branch October 1, 2026 12:46
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