TypeGen improvements for Svelte, enhanced object dialog (beta) improvements, and various bug fixes
Published: January 6, 2026
v5.2.0
Sanity Studio
TypeGen improvements for Svelte
- TypeGen will now find queries declared in
.sveltefiles. It also automatically looks for.svelteand.vuefiles in your./srcor./appfolders. If you've already set up typegen in your Svelte app and configuredpath, you may need to addsvelteto your file endings in order to find the queries. This is typically located insanity.cli.tsunder thetypegenconfiguration property. - TypeGen query detection now supports
defineQueryimports from@sanity/sveltekitin addition togroqandnext-sanity.
Enhanced object dialog (beta) improvements
Enhanced object dialog was originally introduced in Studio version 4.12.0.
- Improves keyboard accessibility for navigation breadcrumbs.
- Adds array titles to the breadcrumbs in the enhanced object dialog. An example: previously, the breadcrumbs would render as (Field title /
#4 Item 4/#3 Item 3) but with this update, they will instead display information of the field from which the items come (Field Title /#4 Item 4/ Parent field of the next item /#3 Item 3). - Overall accessibility label improvements for breadcrumbs.
- Fixes issue where navigating across items would not reset scroll top of the dialog.
- Fixes issue where clicking escape in a full-screen pte while editing an image would not fall back to the full screen and would instead close the whole modal.
Other features
- New quick links to navigate to lists of all scheduled drafts and content releases from the releases dropdown list.
- Visual refinements to the document header versions list.
- All content releases may now be duplicated.
- All content releases may now be reverted.
- TypeGen now performs narrowing in more scenarios based on filter predicates. Simple predicates like
defined(field)andfoo == "bar"now narrow their subject. In this example,foowill be typed as a string literal with the value"bar". ORs, and more complex assertions, are not yet narrowed.
🐛 Notable bugfixes
- Fixes issue causing custom reference filters to receive a stale document value.
- Fixes issue causing reference search to keep showing a spinner when there are no hits.
- Fixes an issue causing custom access roles with
_type-based resource filters to disallow creating new documents where this should be allowed. - Fixes a regression where
ServerStyleSheetfromstyled-componentswas reintroduced, breaking compatibility with@sanity/css-in-js. Users who overridestyled-componentswith@sanity/css-in-jswill no longer encounter build errors about missingServerStyleSheetexport. - Fixes an issue where newer plugins that no longer ship CJS formats and contain CSS imports would cause an
ERR_UNKNOWN_FILE_EXTENSIONerror when running commands likesanity schema extract.sanity-plugin-markdownstopped shipping CJS and has been ESM only since v7 and was impacted by this. - Fixed
Rule.fields()validation when used insideRule.all()orRule.either()combinators.