Skip to content
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

Inline commenting: UX Enhancements for Comments #67385

Merged
Merged
Show file tree
Hide file tree
Changes from 10 commits
Commits
Show all changes
17 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ export function AddComment( {
return (
<VStack
spacing="3"
className="editor-collab-sidebar-panel__thread editor-collab-sidebar-panel__active-thread"
className="editor-collab-sidebar-panel__thread editor-collab-sidebar-panel__active-thread editor-collab-sidebar-panel__focus-thread"
>
<HStack alignment="left" spacing="3">
<CommentAuthorInfo />
Expand Down
19 changes: 12 additions & 7 deletions packages/editor/src/components/collab-sidebar/comment-button.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,18 @@ const { CommentIconSlotFill } = unlock( blockEditorPrivateApis );
const AddCommentButton = ( { onClick } ) => {
return (
<CommentIconSlotFill.Fill>
<MenuItem
icon={ commentIcon }
onClick={ onClick }
aria-haspopup="dialog"
>
{ _x( 'Comment', 'Add comment button' ) }
</MenuItem>
{ ( { onClose } ) => (
<MenuItem
icon={ commentIcon }
onClick={ () => {
onClick();
onClose();
} }
aria-haspopup="dialog"
>
{ _x( 'Comment', 'Add comment button' ) }
</MenuItem>
) }
</CommentIconSlotFill.Fill>
);
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,10 @@ function CommentForm( { onSubmit, onCancel, thread, submitButtonText } ) {
__next40pxDefaultSize
accessibleWhenDisabled
variant="primary"
onClick={ () => onSubmit( inputComment ) }
onClick={ () => {
onSubmit( inputComment );
setInputComment( '' );
} }
disabled={
0 === sanitizeCommentString( inputComment ).length
}
Expand Down
Loading
Loading