mirror of
https://github.com/webstudio-is/webstudio.git
synced 2026-12-03 05:45:55 +09:00
Editors can be blocked from saving unrelated text when a Content Block contains pre-existing shared Slot references. This PR keeps existing shared content intact while rejecting new duplicate references introduced by a Content-mode edit. Ref #6637 ## Tasks - [x] Reproduce an unrelated Content-mode text save being rejected by a pre-existing shared reference; the regression failed before the fix and passes afterward. - [x] Compare reference counts before and after a Content-mode edit. Builder and MCP already call this shared validator; no separate policy was added. - [x] Cover a newly duplicated reference, existing shared references, repeated text edits, and a link-prop edit in both Content scopes. The new-duplicate assertion failed when the guard was disabled and passed after restoration. A review regression also showed that moving a reference into a self-cycle passed before the follow-up fix; it is now rejected. - [x] Review `docs/university/core-components/content-block.md`; no docs change is needed because it already promises editable content inside Content Blocks and this restores that behavior. - [x] Finish local verification and final diff review. Focused tests, 2,729 Project Build tests, 12 Builder authorization integration tests, Project Build and Builder typechecks, lint, formatting, and package boundaries pass. The production change adds 20 net lines and reuses one validator. - [x] Check the other unlabeled reports: #6615, #6626, #6629, and #6636 were closed with exact missing replay evidence; #6635 and #6648 remain open with concrete next steps. - [x] Run the approved full Luna/low agent evaluation suite. Five of nine fixtures passed; failures are recorded below, and baselines were not updated. - [x] Monitor CI and resolve review comments before marking ready. All required workflows passed; there were no review threads. ## Verification The new Content-mode regression failed before the change and passes afterward (both `content` and `text-and-props`). It also covers a link-prop save and prevents a new third shared reference. Project Build: 97 files / 2,729 tests passed after the cycle guard. Builder patch authorization: 12 tests passed. Project Build and Builder typechecks, lint, and package boundaries passed. No fixture inputs or outputs changed. No live project data was modified. Full Luna/low agent evaluations completed at 5/9: managed-Form authoring missed `contactPage`; two Markdown fixtures missed `blogRouteEvidence` after `ENOENT` screenshot failures; MDX editing and saved-state checks passed, but its guidance check failed because `meta.guide` was called twice. Baseline comparisons are incompatible or missing for the Luna/low override; no baselines were updated. The suite is not claimed green. ## Known limits This does not yet claim to make every shared-reference layout editable. The regression target is an unrelated permitted save in a project that already contains shared references.