Studio

Document Actions reference

Enhanced object navigation and full-screen editor view

v4.17.0

✨ Highlights

Enhanced object dialog

The enhanced object dialog is now switched on by default.

In order to opt out: Change / add the property beta.form.enhancedObjectDialog.enabled in your studio configuration (usually found in sanity.config.ts) and set it to false.

Full-screen editor view

You can now maximize the editor pane! By pressing the button on the header you now have a cleaner single pane experience for any document!

Other features

  • The onComplete callback for DocumentActionComponent hooks are deprecated and considered harmful for performance. Use local state instead, for example call setDialogOpen(false) in dialog onCancel attributes instead of onComplete.
  • scheduledPublishing.showReleasesBanner is now deprecated. When both Scheduled Publishing Plugin and Scheduled Drafts are enabled, Scheduled Drafts will default to being used for scheduling.

🐛 Notable bugfixes

  • Creating a scheduled draft will now discard the existing draft version after scheduling has been created
  • Removed errant scheduled draft existence warning banner
  • Fixed issue causing object array items to sometimes be invisible
  • Optimizes rendering of document actions so they're only rendered once, instead of 3x

Unpublish document action moved, Improvements, and bugfixes

v4.6.1

✨ Highlights

Unpublish from the Published perspective

The Unpublish document action has been relocated within Sanity Studio for improved workflow clarity.

  • Previous behavior: Unpublish action was available from draft perspective
  • New behavior: Unpublish action is now only available from the published perspective

Impact:

To unpublish a document, editors must now:

  • Select the published perspective (on the Studio or document header level)
  • Access the unpublish action from the actions document footer
a computer screen shows a published draft and a new release
how to switch to the published perspective from both the Studio and document header

This change ensures editors are working with the published version when making unpublish decisions, providing better context and reducing potential confusion between draft and published states.

Presentation tool update

In Presentation Tool, origin is now always included in the Main Document Resolver context object (DocumentResolverContext). Previously it would be undefined for relative URLs.

🐛 Notable bugfixes

  • Fixes an issue that could in some cases leave the document stuck in "Saving" state after a connection loss.
  • Fixes an issue that in rare cases could cause the publish action to get stuck in "Publishing" state.
  • When discarding a version from the release detail, the preview will now be the correct one.
  • Fixes issue preventing custom asset source being used if directUploads is set to false.
  • Fixes an issue causing the unpublish action to be shown erroneously for nonexistent drafts.

Install or upgrade Sanity Studio

To initiate a new Sanity Studio project or upgrade an existing one, please refer to our comprehensive guide on Installing and Upgrading Sanity Studio.

If you are updating from a version earlier than 3.37.0, you should also check out this article to ensure your dependencies are up to date.

Sanity Studio Update: Search weight no longer experimental, Document Actions API improved ++

v3.33.0

Installation and upgrading

To initiate a new Studio without installing the CLI globally:

To upgrade a Sanity Studio, run this command in its folder:

🐛 Notable bugfixes

  • Resolves an issue where users were not redirected to their original destination after re-authenticating, ensuring seamless access to linked content within the Studio.
  • _projectId and _strengthenOnPublish are now valid values for Initial Value Templates, allowing for Cross Dataset Reference values in templates.
  • Fixes a type bug where the type for defineType and defineField was not being captured correctly.

Other Features

  • __experimental_search is deprecated in favor of field-level search options for strings and Portable Text arrays. You should now be able to define search weights in your schema, like:
defineField({
  name: 'title',
  type: 'string',
  options: {
    search: {
      weight: 10,
    },
  },
})
  • Document Actions can now specify a group, which will allow users to specify whether a specific document action should appear in the footer or in the document's context menu.
  • Adds ability to open the hotspot and crop dialog by double-clicking image preview.