Repository navigation
Preview data type and content type imports with the real property editors - #1166
Merged
Merged
Conversation
The details modal gets a Preview tab that shows the current data type and the incoming one from the uSync files side by side, rendered with the real backoffice property editor and with changed config highlighted. The incoming item is built by the serializer itself as a dry run: the DoNotSave flag is now honoured when finding folders (they are looked up, never created or re-keyed), and the preview runs inside a scope that is never completed, so nothing can be written. Both sides are mapped with Umbraco's own DataTypeResponseModel mapper. All changes are additive: new overloads for FindOrCreateAsync and FindFolderAsync, a default (null) ISyncHandler.GetPreviewAsync that only the DataTypeHandler opts into, a new ISyncPreviewService and a GET Preview endpoint. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The Preview tab now covers content types. Both sides are laid out the way the backoffice editor shows them (composition tabs and groups merged in by name), every property is rendered by its real property editor, and added, removed and changed tabs, groups and properties are highlighted, along with changes to the type's own fields and compositions. The content type serializers now honour DoNotSave for folders too: DeserializeBaseAsync and CleanFolderAsync gain options-aware overloads, FindOrCreateAsync uses the lookup-only folder path in a dry run, and the existing signatures behave as before. The content, media and member type handlers opt in to previews (with OnePass so compositions and structure are applied). The preview endpoint returns Umbraco's own response models for each side, for every composition either side uses, and for the data types their properties use. The diff is done client side by key, so the trackers and the Changes tab are untouched. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A dry run of a content type could only see data types already in the site, so a new property using a new data type was dropped from the incoming preview (or matched to another data type by name). SyncSerializerOptions gets an additive PendingItemResolver, set only when previewing. The content type serializer asks it for a property's data type after the database lookup by key fails, and links an unsaved data type by key. Normal imports are unchanged. The preview service supplies a resolver that dry-runs the item from the uSync files (cached per preview, guarded against loops) and returns what it built with the preview, so the response includes those data types and lists them in newDataTypes. The UI tags such properties as using a new data type. Adds a Playwright spec that writes a new data type and a document type using it into the test site's uSync folder, runs a report and checks both previews render their real editors. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The content type serializers' composition lookup now asks the preview's pending item resolver after the database lookup by key fails (and before the alias fallback), through an additive options-aware overload of DeserializeCompositionsAsync. A new type composed of a new composition now previews with the composition's tabs, groups and properties merged in. The preview response lists those compositions in newCompositions and the UI tags them as new. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Adds the new item preview labels to the Danish, German, Spanish, French and Dutch language files (they fell back to English before). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- the current and incoming sides share rows (subgrid), so tab bars, groups and config boxes line up; below 760px they stack full width - changed fields get a soft highlight instead of a heavy outline, and changed rows an inset bar and tint, so nothing shifts sideways - properties inside an added or removed group or tab aren't marked one by one - tighter property spacing (umb-property's workspace padding reduced in the preview), properties run edge to edge with dividers - the tab status dot sits on the label's line - the config table's alias column fits the longest alias, with matching font sizes - side captions, smaller type aliases, green "new data type" tags Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
KevinJump
marked this pull request as ready for review
October 28, 2026 22:33
- the content and media serializers stop before saving or publishing when run with DoNotSave, and a dry run doesn't clear document url caches on a key change - the content and media handlers build previews, and the preview keeps the uSync file it was built from - the preview API maps both sides with Umbraco's own document and media models, plus the item's type, compositions and data types, and the parent, sort order, template and published state (the incoming side read from the file) - a new usync-content-preview shows both sides laid out like the editor, every value in its real property editor, opening on the first tab with changes; changed, added and removed values are marked, with a language switch for variant content and an "only show changes" toggle Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Put the only-changes toggle on the incoming headline row, drop the "No value" note that pushed the sides out of line, and keep stacked mode full width with left-aligned headlines. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The incoming trashed state is now read from the file (the import sets it in the second pass, which a preview doesn't run), sort order respects IgnoreSortOrder, and published state only compares the cultures uSync is set to sync. The dry run's serializer options are kept on SyncItemPreview so the preview can follow the same settings as the import. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Preview content and media imports with the real property editors
The visual preview is now the default, left-hand tab and is called Changes; the old changes list becomes Diff. Both tabs have icons and sit in a bar so they stand apart from the page. A choice of Diff sticks while stepping through items, and a loader shows while the preview loads. The headline gets a second line with the item type and change, e.g. "Content type · Update". Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Previews are now mapped by ISyncPreviewMapper classes, found by the type loader into a weighted collection (like the trackers), and picked by item type. The preview service runs the mapper inside the preview scope, so the controller no longer knows about any item types. The response is a common envelope with the mapper's model in Preview. In the backoffice, a 'usync-item-preview' element is registered for each entity type and shown through an extension slot, so packages (Forms, Commerce etc.) can add previews for their own items. The core previews are registered the same way and now load lazily. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This was referenced Nov 3, 2026
This was referenced Nov 3, 2026
Merged
This was referenced Nov 9, 2026
This was referenced Nov 13, 2026
This was referenced Nov 27, 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.
Adds a Preview tab to the uSync change details modal. It shows the site's current version of an item and the incoming one from the uSync files side by side, rendered with the real backoffice property editors.
Inspired by Moriyama's umbraco-pr-preview.
How it works
SerializerFlags.DoNotSave. Folders are looked up but never created or re-keyed, and editor-rename tracking is skipped.ISyncPreviewServiceruns the dry run inside a scope that is never completed, with notifications suppressed, so anything that slips through is rolled back.DataTypeResponseModel,DocumentTypeResponseModel, …). For content types the response also carries every composition either side uses and the data types their properties use.SyncSerializerOptions.PendingItemResolver, only set when previewing), so the property keeps its real editor and new data types and compositions are tagged as new.GET /umbraco/usync/api/v1/Preview?handler=&key=(404 when the handler doesn't support previews; the modal then looks as it did before).No breaking changes
Everything is additive:
SyncSerializerOptions.DoNotSave(was commented out)FindOrCreateAsync(node, options)andFindFolderAsync(key, path, createIfMissing)overloads; the existing methods are unchanged and still used for importsDeserializeBaseAsyncandCleanFolderAsyncgain options-aware overloads on the content type serializers; the existing ones behave as beforeISyncHandler.GetPreviewAsyncwith a default that returns null; the data type, content type, media type and member type handlers opt inISyncPreviewService, controller, response model, client component; the regenerated API client only gains typesTesting
DataTypePreviewTests(integration): dry run changes the item in memory only, a new item in a missing folder creates neither, a normal import still creates the folder, the handler preview returns both sides, a handler without support returns null.ContentTypePreviewTests(integration): dry run of an existing type changes it in memory only, a new type in a missing folder creates neither, the handler preview returns both sides.usync-item-preview.spec.ts): writes a new data type and a document type using it into the test site, runs a report and checks both previews render the real editors.Notes
Known limits
🤖 Generated with Claude Code