-
Notifications
You must be signed in to change notification settings - Fork 435
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
refactor(sanity): add changes to allow for comments in version documents #7404
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
1 Skipped Deployment
|
No changes to documentation |
Component Testing Report Updated Aug 27, 2024 9:19 AM (UTC) ✅ All Tests Passed -- expand for details
|
@@ -84,7 +83,7 @@ export function useCommentsStore(opts: CommentsStoreOptions): CommentsStoreRetur | |||
const handleListenerEvent = useCallback( | |||
async (event: ListenEvent<Record<string, CommentDocument>>) => { | |||
// Fetch all comments on initial connection | |||
if (event.type === 'welcome' && !didInitialFetch.current) { | |||
if (event.type === 'welcome') { |
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.
needed to remove it in order for the comments to be refetched on switching perspectives in a document
Screen.Recording.2024-08-26.at.13.42.37.mov
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.
Good catch, let's discuss in slack
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.
Can you ping the other reviewers when you come to a conclusion on this? 🙂
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'll be making this change 🔜
packages/sanity/src/structure/panes/document/comments/CommentsWrapper.tsx
Outdated
Show resolved
Hide resolved
packages/sanity/src/core/comments/context/comments/CommentsProvider.tsx
Outdated
Show resolved
Hide resolved
…ovider for useEditState
…hing between versions
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.
Thanks @RitaDias , looks good to me !
…nts (#7404) * refactor(sanity): add changes to allow for comments in version documents * refactor(sanity): send version via prop to commentsListItemLayout * docs(sanity): add comments for todo for readonly * refactor(sanity): fix comments * refactor(sanity): reverts changes to the potential ui for the future * chore(sanity): remove "comments support" comment * refactor(sanity): rename document ids and revert change in CommentsProvider for useEditState * refactor(sanity): refactor solution for re-rendering panes when switching between versions
…nts (#7404) * refactor(sanity): add changes to allow for comments in version documents * refactor(sanity): send version via prop to commentsListItemLayout * docs(sanity): add comments for todo for readonly * refactor(sanity): fix comments * refactor(sanity): reverts changes to the potential ui for the future * chore(sanity): remove "comments support" comment * refactor(sanity): rename document ids and revert change in CommentsProvider for useEditState * refactor(sanity): refactor solution for re-rendering panes when switching between versions
…nts (#7404) * refactor(sanity): add changes to allow for comments in version documents * refactor(sanity): send version via prop to commentsListItemLayout * docs(sanity): add comments for todo for readonly * refactor(sanity): fix comments * refactor(sanity): reverts changes to the potential ui for the future * chore(sanity): remove "comments support" comment * refactor(sanity): rename document ids and revert change in CommentsProvider for useEditState * refactor(sanity): refactor solution for re-rendering panes when switching between versions
…nts (#7404) * refactor(sanity): add changes to allow for comments in version documents * refactor(sanity): send version via prop to commentsListItemLayout * docs(sanity): add comments for todo for readonly * refactor(sanity): fix comments * refactor(sanity): reverts changes to the potential ui for the future * chore(sanity): remove "comments support" comment * refactor(sanity): rename document ids and revert change in CommentsProvider for useEditState * refactor(sanity): refactor solution for re-rendering panes when switching between versions
Description
Added changes to the comments to allow for version comments to show up when the version is switched to.
Screen.Recording.2024-08-26.at.14.22.02.mov
Added a todo for when the release is "complete", tested out the readOnly and it looks to do what we want. The rest will depend on design