Files
webstudio/apps
Oleg Isonen c4b26b4173 fix: Persist nested MDX heading edits after refresh (#6707)
Nested headings inside MDX templates should save and remain after
refresh. PR #6692 did not fix that persistence failure.

The staging repro showed the MDX serializer rejecting an unchanged Asset
record. The live record and saved record can have different JavaScript
prototypes while representing the same JSON data, so the raw deep
comparison rejected a valid edit. Reconciliation now compares normalized
JSON data.

Known authored Asset props and path-mapped template assets remain
supported. Unmapped, unreferenced template Asset records are still
rejected; the staging repro did not need a broader provenance-based
exception.

The save status remains pending until the MDX Asset write completes,
even if the last Content Block root unmounts. Failed or conflicting
writes remain visible as errors and keep the unload guard active.

## Checklist
- [x] Add a Builder E2E regression test for nested heading persistence
through the MDX Asset.
- [x] Track Asset saves independently of mounted Content Block roots.
- [x] Keep failed/conflicting Asset writes visible and guarded.
- [x] Preserve authored Asset props and path-mapped template assets
during MDX text edits.
- [x] Add regression tests for omitted asset records and continue
rejecting unknown or modified assets.
- [x] Confirm the asset comparison regression test fails with the
previous comparator and passes with the fix.
- [x] Review Content Block docs; no documentation changes are needed.
- [x] Run the focused MDX suite (62 passed), project-build typecheck,
oxlint, formatter, and diff checks.
- [x] Add the generated Builder E2E schema snapshot required by CI.
- [x] Remove temporary diagnostics and the unneeded broader provenance
exception.
- [x] Verify nested heading persistence on staging after the latest
deployment.
- [x] Verify required CI checks for this staging branch; all passed.

Replaces #6706
Ref #6306
2026-11-17 00:30:11 +01:00
..