fix(studio): wire onTrySdkPersist to sdkCutoverPersist (cutover was unwired)#1463
Conversation
…nwired) Stage 7 s7.5 removed the feature flag and declared cutover 'always-on', but onTrySdkPersist was never actually passed to useDomEditCommits — the sdkCutoverPersist function was dead code in production. Thread sdkSession through useDomEditSession params, build the onTrySdkPersist closure there (all CutoverDeps are already in scope), and pass sdkSession from App.tsx. Style/text/attribute/html-attribute commits now route through SDK dispatch instead of the server patch path. Co-authored-by: Miguel Ángel <miguel07alm@protonmail.com>
Collaborator
Author
|
Warning This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stack on Graphite.
This stack of pull requests is managed by Graphite. Learn more about stacking. |
This was referenced Jun 15, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

What
Stage 7 s7.5 declared the SDK cutover "always-on" by removing the feature flag, but
onTrySdkPersistwas never actually passed touseDomEditCommits—sdkCutoverPersistwasdead code in production. Every DOM edit still went through the server patch path.
This PR wires the cutover for the op types already supported by
sdkCutover.ts:inline-style→setStyle,text-content→setText,attribute/html-attribute→setAttribute.Why
Without this wiring, Stages 3.1–3.5 (delete, timing, GSAP panel) have no foundation to build on.
Also fixes a correctness gap: s7.5 said cutover was active but it wasn't.
How
sdkSession?: Composition | nulltoUseDomEditSessionParamsuseDomEditSession, importedsdkCutoverPersistand built anonTrySdkPersistclosureusing deps already in scope (
editHistory,writeProjectFile,reloadPreview,domEditSaveTimestampRef)sdkSessionfromApp.tsxintouseDomEditSession(all other CutoverDeps were already threaded)onTrySdkPersistisundefinedwhensdkSessionis null/absent — no behavior change without a sessionApp.tsxis exactly 600 lines (at the Studio file-size gate limit).Test plan
bun run build— passes (all packages)bun run testinpackages/sdk— 226/226 passbun run testinpackages/studio— 3 pre-existing failures inuseDomEditSession.test.ts(stale test calling
shouldUseSdkCutoverwith a now-removed flag param); all other tests passbunx oxlint+bunx oxfmt --check— no warnings or errors on changed filessdk_cutover_successtelemetry fires (not_fallback)