Add conditional workspace visibility and general bug fixing
Published: April 22, 2026
v5.22.0
New hidden property in workspace configuration
New hidden property on workspace configuration. Accepts a boolean or a callback that receives {currentUser} and returns true to hide the workspace.
hidden: ({currentUser}) => {
if (currentUser === null) return false
return !currentUser.roles.some((role) => role.name === 'administrator')
}hidden: truehides the workspace unconditionally.hidden: (context) => booleanevaluates after authentication resolves.- Before auth completes,
currentUserisnull. Handle this in callbacks. - Client-side UI visibility only. Enforce access control server-side via Sanity role-based access controls (RBAC)
🐛 Notable bugfixes and improvements
- References in dialogs and popovers will be visible with the available space and not hide under different sections of the UI
- Fixes a bug breaking document lists sorting on a sub path (e.g.
slug.current) when using thegroq2024search strategy. - Fixed programmatic focus (e.g. jumping to a divergence from the overview) when inline changes mode is on. Previously the focus was silently dropped for string fields in this mode.
BlockRulenow usesPortableTextBlockinstead ofany[], matching the actual runtime value passed to custom validators.- Fixes an issue where document list previews could fail to load on slower connections due to redundant network requests triggered by unrelated document mutations.
- CLI: Adds
--skip-content-releasesflag tosanity datasets copyfor excluding content release documents from the target dataset. - CLI: MCP auto-configuration now supports Antigravity, Cline CLI, Codex CLI, GitHub Copilot CLI, and MCPorter.
- CLI: Fixed environment variable loading to include all variables from
.envfiles, not justSANITY_STUDIO_/SANITY_APP_prefixed ones. Client bundle exposure remains restricted to prefixed variables only.