-
Notifications
You must be signed in to change notification settings - Fork 450
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(sanity): allow discovery of all document versions using groq2024 search #8775
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
2 Skipped Deployments
|
f8dbf32
to
a80672c
Compare
No changes to documentation |
Component Testing Report Updated Mar 6, 2025 4:04 PM (UTC) ❌ Failed Tests (3) -- expand for details
|
⚡️ Editor Performance ReportUpdated Thu, 06 Mar 2025 16:02:57 GMT
Detailed information🏠 Reference resultThe performance result of
🧪 Experiment resultThe performance result of this branch
📚 Glossary
|
a80672c
to
3be2dc4
Compare
The document collator currently inadvertently works for version documents simply because it assigns them to the `draft` property. This commit clarifies the situation by adding a dedicated `versions` property to the collator. In practice, Studio behaviour should be unchanged.
This property was unused, and computed incorrectly, referring to `doc.id` instead of `doc._id`.
3be2dc4
to
21e7565
Compare
The document collator currently inadvertently works for version documents simply because it assigns them to the `draft` property. This commit clarifies the situation by adding a dedicated `versions` property to the collator. In practice, Studio behaviour should be unchanged.
This property was unused, and computed incorrectly, referring to `doc.id` instead of `doc._id`.
21e7565
to
59a8a82
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great, thanks @juice49
@@ -20,15 +20,13 @@ export function getDocumentKey(value: DocumentListPaneItem, index: number): stri | |||
|
|||
export function removePublishedWithDrafts(documents: SanityDocumentLike[]): DocumentListPaneItem[] { | |||
return collate(documents).map((entry) => { | |||
const doc = entry.draft || entry.published | |||
const isVersion = doc?.id && isVersionId(doc._id) | |||
const doc = entry.draft || entry.published || entry.versions[0] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we could perhaps consider adding a preference for what version to chose, but probably better to defer that to when we need it
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think that could be a good idea. Settled for this now just to make things a bit clearer.
The document collator currently inadvertently works for version documents simply because it assigns them to the `draft` property. This commit clarifies the situation by adding a dedicated `versions` property to the collator. In practice, Studio behaviour should be unchanged.
This property was unused, and computed incorrectly, referring to `doc.id` instead of `doc._id`.
Description
The
groq2024
search strategy currently relies on Content Lake perspectives to collate documents. This means global search is unable to discover document versions outside of the selected perspective.This branch changes back to the
raw
perspective and returns to client-side collation in order to make all document versions discoverable via global search, regardless of the selected perspective.What to review
Global search: discoverability of versions outside the selected perspective.
Document lists: should be unchanged.
Testing
Updated unit tests and tested manually.