Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
3786a56
feat: initial implementation - enable reopening comments
yashjawale Aug 19, 2025
1b36276
fix: update comment resolution status to 'hold' when reopening
yashjawale Aug 19, 2025
1a962d8
feat: update comment button to use undo icon for reopening approved c…
yashjawale Aug 19, 2025
34960f3
refactor: add onCommentReopen function to handle reopening comments i…
yashjawale Aug 20, 2025
eb94947
fix: restore translator comment to previous state
yashjawale Aug 20, 2025
e9e89ba
fix: prevent rendering of focused thread for approved comments
yashjawale Aug 20, 2025
0a88fc4
fix: move reopen approved comments option to the comment actions menu
yashjawale Aug 21, 2025
22a1421
fix: revert unrelated change in imports
yashjawale Aug 25, 2025
675905e
fix: update success message for reopening comments
yashjawale Aug 25, 2025
9ae8b8d
fix: remove redundant confirmation dialogs for reopening and resolvin…
yashjawale Aug 25, 2025
4a4d193
fix: comment resolution functionality after removing dialogs
yashjawale Aug 25, 2025
cc431a5
feat: add CommentQuickReply component for quick replies on resolved t…
yashjawale Aug 25, 2025
c8c5696
fix: remove translator comments without placeholders
yashjawale Sep 15, 2025
2d5cd92
Merge branch 'trunk' into feat/reopen-resolved-comments
yashjawale Sep 15, 2025
381bbae
fix: use resolve button instead of separate tooltip for resolved threads
yashjawale Sep 15, 2025
8ef98f1
refactor: remove CommentQuickReply component and use CommentForm instead
yashjawale Sep 15, 2025
b79517a
feat: add props to CommentForm for rows & placeholder
yashjawale Sep 15, 2025
96c9338
fix: button layout with large text
yashjawale Sep 15, 2025
90f88e5
Merge branch 'trunk' into feat/reopen-resolved-comments
yashjawale Sep 15, 2025
f961cf5
refactor: remove unnecessary button styles from comment dropdown menu
yashjawale Sep 15, 2025
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
Next Next commit
feat: initial implementation - enable reopening comments
  • Loading branch information
yashjawale committed Aug 19, 2025
commit 3786a56be30fbcfdeabb5da5617d55af3fb02d48
53 changes: 48 additions & 5 deletions packages/editor/src/components/collab-sidebar/comments.js
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ function Thread( {
) ) }
</>
) }
{ 'approved' !== thread.status && isFocused && (
{ isFocused && (
<VStack
className="editor-collab-sidebar-panel__child-thread"
spacing="2"
Expand Down Expand Up @@ -218,6 +218,12 @@ const CommentBoard = ( { thread, onResolve, onEdit, onDelete, status } ) => {
setShowConfirmDialog( false );
};

const handleConfirmReopen = () => {
onResolve( thread.id, 'reopen' );
setActionState( false );
setShowConfirmDialog( false );
};

const handleConfirmResolve = () => {
onResolve( thread.id );
setActionState( false );
Expand Down Expand Up @@ -291,10 +297,31 @@ const CommentBoard = ( { thread, onResolve, onEdit, onDelete, status } ) => {
</HStack>
) }
{ status === 'approved' && (
// translators: tooltip for resolved comment
<Tooltip text={ __( 'Resolved' ) }>
<Icon icon={ check } />
</Tooltip>
<HStack
alignment="right"
justify="flex-end"
spacing="0"
>
{ 0 === thread?.parent && onResolve && (
<Button
label={ _x(
'Reopen',
'Mark resolved comment as unresolved'
) }
__next40pxDefaultSize
icon={ check }
onClick={ () => {
setActionState( 'reopen' );
setShowConfirmDialog( true );
} }
showTooltip
/>
) }
{ /* translators: tooltip for resolved comment */ }
<Tooltip text={ __( 'Resolved' ) }>
<Icon icon={ check } />
</Tooltip>
</HStack>
) }
</span>
</HStack>
Expand Down Expand Up @@ -324,6 +351,22 @@ const CommentBoard = ( { thread, onResolve, onEdit, onDelete, status } ) => {
) }
</VStack>
</HStack>
{ 'reopen' === actionState && (
Comment thread
yashjawale marked this conversation as resolved.
Outdated
<ConfirmDialog
isOpen={ showConfirmDialog }
onConfirm={ handleConfirmReopen }
onCancel={ handleCancel }
confirmButtonText="Yes"
cancelButtonText="No"
>
{
// translators: message displayed when confirming an action
__(
'Are you sure you want to reopen this resolved comment?'
)
}
</ConfirmDialog>
) }
{ 'resolve' === actionState && (
<ConfirmDialog
isOpen={ showConfirmDialog }
Expand Down
13 changes: 9 additions & 4 deletions packages/editor/src/components/collab-sidebar/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -117,15 +117,20 @@ function CollabSidebarContent( {
}
};

const onCommentResolve = async ( commentId ) => {
const onCommentResolve = async ( commentId, action = 'resolve' ) => {
const status = action === 'reopen' ? 'unapproved' : 'approved';
const savedRecord = await saveEntityRecord( 'root', 'comment', {
id: commentId,
status: 'approved',
status,
} );

if ( savedRecord ) {
// translators: Comment resolved successfully
createNotice( 'snackbar', __( 'Comment marked as resolved.' ), {
const message =
action === 'reopen'
? __( 'Comment reopened successfully.' )
: __( 'Comment marked as resolved.' );
// translators: Comment resolved/reopened successfully
createNotice( 'snackbar', message, {
type: 'snackbar',
isDismissible: true,
} );
Expand Down
Loading