Skip to content

Let callers choose where item previews come from - #1192

Merged
KevinJump merged 1 commit into
v17/mainfrom
v17/feature/preview-source
Nov 3, 2026
Merged

KevinJump merged 1 commit into
v17/mainfrom
v17/feature/preview-source

Conversation

@KevinJump

Copy link
Copy Markdown
Owner

The details dialog always builds its preview from the site's uSync folders (TryFindItemNodeAsync). Packages that show results for files somewhere else, such as a sync pack, a snapshot or a history event, open the same dialog through usync-results. They got a preview of the uSync folder version of the item, not the one being reported.

Changes

  • ISyncPreviewService.GetPreviewAsync(handlerAlias, XElement node, findNode?) builds the preview from the node it's given.
    • findNode(handler, key) supplies the items the preview needs that aren't in Umbraco yet, so they come from the same place.
    • Without it, they come from the uSync folders as before.
    • The existing overload that takes a key now calls this one, so the dry-run scope stays in one place.
  • previewSource on uSyncDetailsModalData and usync-results:
    • false shows just the diff.
    • A function loads the preview, and the dialog falls back to the diff if it throws.
    • Unset keeps the uSync folder preview.
  • The extension docs (docs/item-previews.md) are updated.

ISyncPreviewService gains a member. It only shipped in 17.6.0, so it's unlikely anyone implements it yet.

Testing

  • New SyncPreviewServiceTests check that:
    • the preview is built from the given node;
    • extra items come from the finder;
    • without a finder, they come from the uSync folders;
    • the scope is never completed;
    • an unknown handler returns null.
  • Full suite: 231 passed. The solution and client build.
  • Not yet tried in a running site.

🤖 Generated with Claude Code

The details dialog always previewed items from the site's uSync folders,
so anything showing results for files elsewhere (a sync pack, a snapshot)
got a preview of the wrong version.

- ISyncPreviewService gets a GetPreviewAsync overload that takes the node,
  and an optional finder for the pending items it uses.
- The details dialog data and usync-results take a previewSource: a
  function that loads the preview, or false for just the diff. Unset keeps
  the uSync folder preview.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

release/17.6.1 uSync 17.6.1 release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant