Sanity logosanity.ioAll Systems Operational© Sanity 2026
Change Site Theme
Sanity logo

Documentation

    • Overview
    • Platform introduction
    • Next.js quickstart
    • Nuxt.js quickstart
    • Astro quickstart
    • React Router quickstart
    • Studio quickstart
    • Build with AI
    • Content Lake
    • Functions
    • APIs and SDKs
    • Visual Editing
    • Blueprints
    • Platform management
    • Dashboard
    • Studio
    • Canvas
    • Media Library
    • App SDK
    • Content Agent
    • HTTP API
    • CLI
    • Libraries
    • Specifications
    • Changelog
    • User guides
    • Developer guides
    • Courses and certifications
    • Join the community
    • Templates

Changelog

Track new features, improvements, and fixes across all Sanity products.

Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...

On this page

Back to Changelog
  1. Changelog
  2. Sanity Studio

Incoming references view, automatic type generation, external studio support + improvements and bugfixes

Published: February 3, 2026

v5.8.0
Sanity Studio

This release adds views for incoming references, automatic type generation, URL-to-link pasting in Portable Text, external studio registration, improved dialog interactions, and includes performance improvements and bug fixes for document loading and validation.

Add typegen to dev and build commands

This feature adds automatic TypeScript type generation during development and build. When enabled, the Sanity CLI generates types on startup and whenever files change, providing real-time type safety for your queries.

To enable this feature, add the enabled flag to your typegen configuration in sanity.cli.ts:

export default defineCliConfig({
  // ...
  typegen: {
    enabled: true,

    // Optional: customize paths
    schema: 'schema.json',
    generates: 'sanity.types.ts',
  },
})

Watch mode for typegen generate command

The sanity typegen generate command now features a watch flag that you can use to start type generation in watch mode. It will listen for changes in the schema JSON file and files in your project.

sanity typegen generate --watch

Selection state indicators for all menu items (actions, etc.)

Adds support for toggle/selected state on custom menu items in document list panes. The selected state checkmark can optionally be hidden if it’s not wanted for .menuItem in document list panes.

S.menuItem()
   .title('No checkmark')
   .icon(EmptyIcon)
   .action(() => console.log('you clicked!'))
   .params({hideSelectionIndicator: true}),

You can also read the params to check in an .action() in a .menuItem whether the action is selected or not in document list panes.

S.menuItem()
  .title('View Mode: Default')
  .icon(DocumentIcon)
  .group('view')
  .params({value: 'default'})
  .action((params) => console.log('default', params?.isSelected, params)),

Allow external studio deployments

Users can now register externally-hosted studios with the --external flag:

sanity deploy --external

This registers the studio URL without building or uploading assets, enabling features using the studio manifest for studios hosted on custom infrastructure.

To unregister an external studio:

sanity undeploy

For external studios, this uses “unregister” terminology and does not warn that the hostname will become available (since you control the external URL).

Note: External studio deployment requires a sanity.config.ts.

Display incoming references

New incoming references panel

You can now see which documents reference the active document without creating a custom document view.

Loading...

When viewing a document:

  • Select the ellipsis (...) menu at the top of the document.
  • Select Incoming references

This opens a side pane with the incoming references by type.

Loading...

Incoming references decoration

In addition to the incoming references panel, developers can also embed an incoming reference decoration alongside other fields in the document. This involves updating the document schema by using the new renderMembers functionality.

To get started, see the incoming reference field documentation.

Loading...

Built-in Portable Text pasteLink plugin enabled by default

Pasting a URL in a Portable Text Input now automatically creates a link.

Add disableNew option for image fields

New disableNew option for image and file fields - when enabled, hides the upload UI while preserving the ability to select existing assets from the media library. Useful for centralized asset management workflows where teams want to prevent ad-hoc uploads and enforce selection from a curated library.

Filter release documents by action and validation status

When viewing a content release, it’s now possible to filter the list of documents in the release by whether they have validation errors or by release action type (unpublish, add, or change).

Display validation icon for groups

Fieldgroup tabs will now show a validation status icon to indicate if any fields in that group needs attention.

Loading...

Adds path to ConditionalPropertyCallbackContext

Adds path to ConditionalPropertyCallbackContext allowing users to hide or disable fields according to the path they are in.

import * as PathUtils from '@sanity/util/paths'
import { defineType} from 'sanity'

export const conditionallyHiddenField = defineType({
  name: 'conditionallyHiddenObject',
  type: 'object',
  title: 'Conditionally Hidden Object',
  description: 'Object with a conditionally hidden field',
  fields: [
    defineField({
      name: 'title',
      type: 'string',
      title: 'Title ',
      description: 'Title (hidden if path starts with "hiddenTitles")',
      hidden: ({path}) => {
        if (PathUtils.startsWith(['hiddenTitles'], path)) {
          return true
        }
        return false
      },
    }),
    defineField({
      name: 'description',
      type: 'string',
      title: 'Description',
    }),
  ],
})

Click outside dialogs to close

Click outside of an object dialog to close all of the dialogs in a single go.

🐛 Notable bugfixes and improvements

  • Fix references between media libraries and datasets.
  • Improved performance when loading up Studio.
  • Styled components code in the studio is now minified while publishing to npm, reducing the amount of JS executed by browsers, speeding up initial load, and lazy-loading views.
  • Fixes an issue in live-edit documents where the first transaction is lost when created. Users needed to do the first action twice.
  • Fixes an issue in Safari where object array items weren’t opening on first click.
  • Fixes issues where large releases would sometimes hang on document loading and validation.
  • Fixes an issue where the confirm dialog, before discarding a version that was going to be unpublished was showing the wrong preview

Related documentation

  • Structure Builder API Reference

  • Connected Content

  • Incoming reference decoration

  • Image

  • TypeGen

  • Deploy

On this page

  • Add typegen to dev and build commands
  • Watch mode for typegen generate command
  • Selection state indicators for all menu items (actions, etc.)
  • Allow external studio deployments
  • Display incoming references
  • New incoming references panel
  • Incoming references decoration
  • Built-in Portable Text pasteLink plugin enabled by default
  • Add disableNew option for image fields
  • Filter release documents by action and validation status
  • Display validation icon for groups
  • Adds path to ConditionalPropertyCallbackContext
  • Click outside dialogs to close
  • 🐛 Notable bugfixes and improvements
Back to Changelog
export default defineCliConfig({
  // ...
  typegen: {
    enabled: true,

    // Optional: customize paths
    schema: 'schema.json',
    generates: 'sanity.types.ts',
  },
})
sanity typegen generate --watch
S.menuItem()
   .title('No checkmark')
   .icon(EmptyIcon)
   .action(() => console.log('you clicked!'))
   .params({hideSelectionIndicator: true}),
S.menuItem()
  .title('View Mode: Default')
  .icon(DocumentIcon)
  .group('view')
  .params({value: 'default'})
  .action((params) => console.log('default', params?.isSelected, params)),
A content management interface showing a document named 'Aristotle' and an open dropdown menu with options like 'Incoming references'.
A user interface displays an "Aristotle" entry being edited, alongside a sidebar titled "Incoming references" listing an author and books "Politics" and "Metaphysics" by Aristotle.
A UI panel titled "Books created by this author" listing "Politics" and "Metaphysics" by Aristotle, with an "Add item" button.
Screenshot 2026-01-28 at 12 55 05
import * as PathUtils from '@sanity/util/paths'
import { defineType} from 'sanity'

export const conditionallyHiddenField = defineType({
  name: 'conditionallyHiddenObject',
  type: 'object',
  title: 'Conditionally Hidden Object',
  description: 'Object with a conditionally hidden field',
  fields: [
    defineField({
      name: 'title',
      type: 'string',
      title: 'Title ',
      description: 'Title (hidden if path starts with "hiddenTitles")',
      hidden: ({path}) => {
        if (PathUtils.startsWith(['hiddenTitles'], path)) {
          return true
        }
        return false
      },
    }),
    defineField({
      name: 'description',
      type: 'string',
      title: 'Description',
    }),
  ],
})

Related documentation

  • Structure Builder API Reference

  • Connected Content

  • Incoming reference decoration

  • Image

  • TypeGen

  • Deploy