Studio search configuration
Implements React Compiler for auto-updating Studios and additional fixes
v3.66.0
✨ Highlights
React Compiler for auto-updating studios
Studios that have opted in to the auto-updating feature will now use code optimized by the React Compiler. In many cases, this results in a faster user interface.
Other features
Configurable slug field weight
It's now possible to configure search weights for slug fields using the options.search.weight field option:
defineField({
name: 'slug',
type: 'slug',
+ options: {
+ search: {
+ weight: 50,
+ },
+ },
}),
The slug field's weight will now be respected when using global search with "Best match" sorting selected, and when using reference search. Learn more about search weights in the Studio Search Configuration documentation.
Crop/hotspot vector format warning
When using vector formats (like SVG), any crop/hotspot defined for the image will only be applied if the image is delivered in a raster format. To make this clear, a warning is now displayed when setting a crop/hotspot on vector images.
Document links in Vision
When using the @sanity/vision
plugin, if query results contain either _id
or _ref
attributes, a link icon is displayed next to the value making it easier to find and edit the document.
Note: This is currently only displayed if the queried dataset matches the dataset of the active workspace.
Sanity v2 CLI commands removed
v2 has been end-of-life since April 2024 and the CLI commands for v2 will no longer display a removed error.
You can still use @sanity/cli@^2
should you need to run CLI commands against the an old studio project. See the guide for more details on migrating from v2 to v3.
🐛 Notable bugfixes
- Annotations in the Portable Text Editor will now autofocus on the first input when being created.
- Fixed a regression in v3.65.0 that caused the document editor panel header to look slightly misaligned with presentation tool's URL bar, and the Tasks panel header.
- Fixes an issue where editing an annotation in the Portable Text Editor could result in multiple editing dialogs being opened.
Enhanced Global Search, Improved PTE Functionality ++
v3.38.0
Installation and upgrading
Install
To initiate a new Studio without installing the CLI globally:
npm create sanity@latest
Upgrade
In most cases upgrading your studio is as straight-forward as installing the latest version:
npm install sanity@latest
For more information, visit the article on upgrading Sanity Studio in the docs.
If you are upgrading from a version earlier than 3.37.0, you also need to upgrade styled-components and @sanity/ui. To learn more, visit this help article on keeping dependencies up to date.
✨ Highlights
- Improved global search with better performance and new features.
- Custom styles are now displayed in the Portable Text Editor (PTE) style selector.
Enhanced Global Search
We've optimized the search functionality in the Studio for increased performance, especially in workspaces with large schemas. This improvement includes support for wildcard (*
) and negation (-
) tokens in search queries, allowing for more flexible and powerful search options. This enhanced search feature uses an internal API that is not yet documented for public use.
If you need to revert to the previous search behavior for any reason, you can disable the new search functionality by setting search.enableLegacySearch
to true
in your configuration.
Other features
- Fixes tooltip text for the publish button to correctly display "yesterday" without the "ago" suffix when appropriate.
🐛 Notable bugfixes
- Fixes a crash in the image hotspot and cropping tool within Next.js embedded Studios.
- Improves focus handling in PTE and the document pane.
- Fixes an edge case where PTE threw exceptions after resizing the validation panel.
- Fixes issue where annotations in PTE would incorrectly retain markup if all fields were null.
- Resolves an issue where custom sort orders, or sort orders in lists that are not
documentTypeList
s, would send invalid requests to the persistent user settings backend. - Fixes regression that hid tool buttons when Sanity Studio was embedded in Next.js applications.
- Fixes a bug where the caret was not visible on code-formatted text within the PTE when using the dark scheme.
- Fixes an issue where the component for custom PTE styles was not being rendered in the style selector.
- Fixes an issue where copying strikethrough text from a google doc would remove the strikethrough once pasted in the PTE.
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:
npm create sanity@latest
npm install sanity@latest
🐛 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
anddefineField
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.