Sanity Studio v5.21.0: GROQ improvements to Vision plugin and assorted bugfixes

This release improves syntax highlighting for GROQ queries and fixes multiple stability issues including autocompletion rendering, crashes from localized bundles, document ID copying, search focus loss, and reference editing problems.

Vision tool improvements

Improved syntax highlighting of GROQ-queries in the Vision plugin.

🐛 Notable bugfixes and improvements

Fixed a issue where autocompletion for reference picker wouldn’t render correctly in some situations.

Fixes an issue where some localized bundles would cause the studio to crash.

Fixed an issue where “Copy document ID” on live edit document types copied the draft ID instead of the published ID.

Fixes an issue where typing in the release document search would cause the input to lose focus when no results matched.

extractSchema now returns a proper object type for object types without fields, instead of returning an unknown type. This affects consumers of the @sanity/schema extract API.

In multi-workspace studios, changing the document list sort order in one workspace no longer crashes another workspace whose schema lacks the sorted field. The studio falls back to sorting by last edited. Invalid sort orderings appear disabled in the menu and log a console warning.

Fixes an issue preventing referenced document from being edited when opened from an object in popover mode.

Custom sort orderings now support array index access in field paths (e.g., items[0].value). Previously, defining an ordering like by: [{field: 'items[0].value', direction: 'asc'}] would crash the document list. Array index and _key-based access are both supported for single-member-type arrays.

The incoming references inspector now shows a loading indicator while fetching data instead of briefly displaying “No incoming references found.”