feat: persist Content Variants and pass variant through fetches - #1532
Open
stipsan wants to merge 5 commits into
Open
feat: persist Content Variants and pass variant through fetches#1532stipsan wants to merge 5 commits into
stipsan wants to merge 5 commits into
Conversation
commit: |
5 tasks
stipsan
changed the base branch from
feat/visual-editing-perspective
to
feat/visual-editing-standalone-v2
August 17, 2026 12:12
@sanity/visual-editing-standalone@2 no longer injects CSS, so import styles.css next to enableVisualEditing() to keep overlay styles loading. Co-authored-by: Cursor <cursoragent@cursor.com>
stipsan
force-pushed
the
feat/visual-editing-variants
branch
from
August 17, 2026 12:15
7d2ff6b to
5186461
Compare
Keep overlay onPerspectiveChange and onVariantChange private so cookies stay in sync without public nuxt.config hooks. Co-authored-by: Cursor <cursoragent@cursor.com>
stipsan
force-pushed
the
feat/visual-editing-variants
branch
from
August 17, 2026 12:21
5186461 to
da0d186
Compare
Keep @sanity/visual-editing-standalone at ^2.0.1 after main landed ^2.0.0. Co-authored-by: Cursor <cursoragent@cursor.com>
…ting-variants Co-authored-by: Cursor <cursoragent@cursor.com>
Keep private onPerspectiveChange/onVariantChange after #1530 landed. Co-authored-by: Cursor <cursoragent@cursor.com>
✅ Deploy Preview for nuxt-sanity-module ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
| if (studioPreviewPerspective) { | ||
| setCookie(event, perspectiveCookieName, studioPreviewPerspective, cookieOptions) | ||
| } | ||
|
|
There was a problem hiding this comment.
We are deleting the cookie with studioPreviewVariant is not present, but we are not doing that for studioPreviewPerspective do you need here also this? ?
Suggested change
| else { | |
| deleteCookie(event, perspectiveCookieName, cookieOptions) | |
| } |
| const queryKey = _key || 'sanity-' + hash(query + (params ? JSON.stringify(params) : '')) | ||
|
|
||
| const perspective = useSanityPerspective(perspectiveOption, clientConfig.perspective) | ||
| const variant = useSanityVariant() |
There was a problem hiding this comment.
Should we aim here also to preserve the clientConfig.variant? Following what perspective is doing:
const perspective = useSanityPerspective(perspectiveOption, clientConfig.perspective)
pedrobonamin
approved these changes
Aug 19, 2026
pedrobonamin
left a comment
There was a problem hiding this comment.
Pr looks good, added some comments that are not blocking, would appreciate your thoughts.
Thanks!
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
loader/perspective). OverlayonPerspectiveChange/onVariantChangestay private — they always writeuseSanityPerspective/useSanityVariant, with no nuxt.config hooks.variantthroughresolveFetchOptionsanduseSanityQuery(cookie by default;queryOptions.variantwins). Bump@sanity/core-loaderto^2.1.4so live loaders thread variants.useSanityPreviewVariantand the beta opt-ins (Studiobeta.variants.enabled, NuxtapiVersion: 'X'). Module defaultapiVersionis unchanged.Stacked on #1530. After that merges, retarget this PR at
main.Test plan
useSanityQuerysendsvariantonce the cookie is set;queryOptions.variantoverrides the cookievisualEditing.onPerspectiveChange/onVariantChangeare not module options