Studio

Compare document versions

The document comparison view in Sanity Studio provides a side-by-side view of different document versions.

Prerequisites

  • Sanity Studio v3.78.0 or later, which added the document comparison view.
  • A document with at least two versions to compare, such as a draft and a published document.
  • To compare a version that belongs to a release, Content Releases must be enabled in your studio.

Side-by-side comparison

Use the document comparison view to compare document versions. This includes drafts, published, and release versions. To get started, open a document in Sanity Studio that contains multiple document versions.

  • In the top right corner of the document view, click the ... icon.
  • Select Compare versions.
Loading...
Select Compare versions from the More options menu.

The document comparison view opens over your studio window. It contains a version selector and two panels, one for each version you compare.

Gotcha

Loading...
The document comparison panel.

Differences between the fields in the right version are highlighted in yellow. You may recognize this from other history or diff tools. In the screenshot, the Overview field has a yellow highlight along its edge to indicate changes.

You can adjust the compared versions with the version selector at the top of the window.

Loading...
The version selector in the document comparison view.

Protip

Advanced Version Control

Experimental feature

Advanced Version Control adds inline diff annotations to fields, letting editors see how content has changed between versions while they work on it. This functionality is available for string fields and Portable Text fields.

Loading...

Switching on Advanced Version Control

To switch on Advanced Version Control, set the advancedVersionControl.enabled configuration option to true. This feature can be switched on or off for different workspaces.

Editors must also switch on inline annotations per document. In the document's Show more menu (the ... button in the top right of the document pane), select Inline changes. The setting persists as you navigate.

Was this page helpful?