feat(studio B1): persist input edits to content elements (render-binding foundation)
Build backend images / build content-svc (push) Failing after 1m3s
Build backend images / build file-svc (push) Failing after 1m5s
Build backend images / build gateway (push) Failing after 1m0s
Build backend images / build identity-svc (push) Failing after 1m8s
Build backend images / build notification-svc (push) Failing after 57s
Build backend images / build render-svc (push) Failing after 1m6s
Build backend images / build studio-svc (push) Failing after 1m3s

Studio edits previously went only to edit_state; the render binds saved_scene_contents,
so edits never reached the MP4. Add studio-svc PATCH /v1/saved-projects/{id}/contents
(update saved_scene_contents.value/value_file_id by content key, ExecuteSqlInterpolated
for null-safe params) + Next /api/projects/[id]/contents route + persistence hook pushes
edited values (from bridged c-<key> layers) alongside the scene_data save. Verified
text persists incl. UTF-8 Persian (9 chars/17 bytes).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
soroush.asadi
2026-06-07 00:53:17 +03:30
parent d4b1fbd9e6
commit a69bc62724
6 changed files with 140 additions and 0 deletions
+8
View File
@@ -9,8 +9,10 @@ import {
saveLocalProject,
} from "@/lib/dev-project-storage";
import {
contentValuesFromSceneData,
fetchProject,
isProjectNotFoundError,
patchProjectContents,
patchProjectSceneData,
} from "@/lib/project-api";
import { isDevProjectId } from "@/lib/project-ids";
@@ -151,6 +153,12 @@ export function useStudioProjectPersistence(
try {
const scene_data = JSON.parse(payloadJson) as Record<string, unknown>;
await patchProjectSceneData(projectId, scene_data);
// Persist the per-input values to content elements so the render binder uses
// them (best-effort — never block the main save on it).
void patchProjectContents(
projectId,
contentValuesFromSceneData(scene_data)
).catch(() => {});
setUsingLocalStorage(false);
markSaved(payloadJson, false);
} catch (error) {