-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
Add Inline comment experimental flag #60622
Add Inline comment experimental flag #60622
Conversation
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.
To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
👋 Thanks for your first Pull Request and for helping build the future of Gutenberg and WordPress, @poojabhimani12! In case you missed it, we'd love to have you join us in our Slack community. If you want to learn more about WordPress development in general, check out the Core Handbook full of helpful information. |
The following is a summary of the discussion that was had with @ellatrix, that's being posted by me for posterity. In order to be able to test this feature end to end, this PR would need to be updated to add the ability to save comments as well. As a result, the following will need to be be done as the next steps:
|
Block commenting feature
…line-block-commenting
revert the changes
…ting Fix linting errors
I have updated the PR as proposed above. Please review it and provide any feedback. |
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.
Noticed while testing this using playground and wp-now that the block comments are enabled by default, regardless of the checkbox being selected or not. In addition, the collab sidebar is not visible either.
const post = select( editorStore ).getCurrentPost(); | ||
|
||
return { | ||
threads: post?.meta?.collab ? JSON.parse( post.meta.collab ) : [], |
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.
Could this create problem if there's a large enough number of comments on a post? Could it be lazy loaded in some way to work around this problem? Thinking in terms of google docs, you have to scroll both on the page and on the comments dropdown to see all the comments.
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 have implemented a feature where the sidebar displays if any comment is open. However, we have now changed the flow so that the sidebar will be visible even if there are no collaborative activities.
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 have conducted testing and believe that a large number of comments will not have a significant impact. Once the flow is finalized, we can definitely implement lazy loading.
…enting Remove 6.7 rest API and other minor fixes
}, | ||
]; | ||
|
||
const moreActions = actions.filter( ( item ) => item.onClick ); |
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.
actions
is constant, so this doesn't filter anything?
@@ -115,7 +115,6 @@ function gutenberg_override_default_rest_server() { | |||
} | |||
add_filter( 'wp_rest_server_class', 'gutenberg_override_default_rest_server', 1 ); | |||
|
|||
|
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.
Could you remove this line to have a clean change set?
…enting Fixes local state changes
…enting Fix static lint issue
status: 'any', | ||
per_page: 100, | ||
} ); | ||
return Array.isArray( data ) ? data : []; |
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 shouldn't create a new array inside useSelect
, it will create excessive re-renders. useSelect
will think there's change. Can you create an EMTPY_ARRY constant outside this component. Same for the early return above.
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.
Alternatively, let it return null and move the array checks outside of useSelect
.
…enting made changes with useSelect
…enting Address empty array feedback Co-authored-by: rishishah-multidots <[email protected]>
…enting define empty array outside the component
…enting made changes to compatible with FSE
…enting restore thread code
…enting fix lint error
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.
Ok, there's a number of things that should be addressed in a follow-up, but let's start with this.
Kudos all for driving this one! |
Fantastic work here, this is so exciting to see! 🎉 I've just done a tiny update to the PR description and added another screenshot as I missed at first that the Comments button had been moved to the block settings menu. Hope you don't mind! |
Co-authored-by: MD-sunilprajapati <[email protected]> Co-authored-by: poojabhimani12 <[email protected]> Co-authored-by: rishishah-multidots <[email protected]> Co-authored-by: ingeniumed <[email protected]> Co-authored-by: ellatrix <[email protected]> Co-authored-by: tyxla <[email protected]> Co-authored-by: ciampo <[email protected]> Co-authored-by: mtias <[email protected]> Co-authored-by: jasmussen <[email protected]> Co-authored-by: youknowriad <[email protected]> Co-authored-by: annezazu <[email protected]> Co-authored-by: jameskoster <[email protected]>
What?
Introducing the "Block Comment" experiment, with added functionality accessible via this feature flag which when enabled, allows users to add comments to the selected block by clicking on "comment" icon in the toolbar dropdown.
Why?
#59445
How?
Testing Instructions
Screenshots or screencast
Current state:
Earlier iterations:
demo.webm