Skip to content
Prev Previous commit
Next Next commit
Removed return to block function
  • Loading branch information
karthick-murugan committed Sep 23, 2025
commit 8abb312a87b34602ff7fd9cb8f94f395f08f05c4
29 changes: 8 additions & 21 deletions packages/editor/src/components/collab-sidebar/comment-form.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,14 @@ import { sanitizeCommentString } from './utils';
/**
* EditComment component.
*
* @param {Object} props - The component props.
* @param {Function} props.onSubmit - The function to call when updating the comment.
* @param {Function} props.onCancel - The function to call when canceling the comment update.
* @param {Object} props.thread - The comment thread object.
* @param {string} props.submitButtonText - The text to display on the submit button.
* @param {string?} props.placeholderText - The placeholder text for the comment input.
* @param {number?} props.rows - The number of rows for the comment input.
* @param {string?} props.labelText - Custom label text for accessibility.
* @param {Function?} props.onReturnToBlock - Function to navigate back to the related block.
* @param {Object} props - The component props.
* @param {Function} props.onSubmit - The function to call when updating the comment.
* @param {Function} props.onCancel - The function to call when canceling the comment update.
* @param {Object} props.thread - The comment thread object.
* @param {string} props.submitButtonText - The text to display on the submit button.
* @param {string?} props.placeholderText - The placeholder text for the comment input.
* @param {number?} props.rows - The number of rows for the comment input.
* @param {string?} props.labelText - Custom label text for accessibility.
* @return {React.ReactNode} The CommentForm component.
*/
function CommentForm( {
Expand All @@ -42,7 +41,6 @@ function CommentForm( {
placeholderText,
rows = 4,
labelText,
onReturnToBlock,
} ) {
const [ inputComment, setInputComment ] = useState(
thread?.content?.raw ?? ''
Expand Down Expand Up @@ -88,17 +86,6 @@ function CommentForm( {
onClick={ onCancel }
text={ _x( 'Cancel', 'Cancel comment button' ) }
/>
{ onReturnToBlock && (
<Button
__next40pxDefaultSize
variant="tertiary"
onClick={ onReturnToBlock }
text={ _x(
'Return to Block',
'Navigate back to the related block'
) }
/>
) }
</HStack>
</VStack>
);
Expand Down
16 changes: 0 additions & 16 deletions packages/editor/src/components/collab-sidebar/comments.js
Original file line number Diff line number Diff line change
Expand Up @@ -188,16 +188,6 @@ function Thread( {
}
};

const handleReturnToBlock = () => {
if ( relatedBlock && relatedBlockElement ) {
relatedBlockElement.scrollIntoView( {
behavior: 'smooth',
block: 'center',
} );
flashBlock( relatedBlock );
}
};

return (
<VStack
className={ clsx( 'editor-collab-sidebar-panel__thread', {
Expand All @@ -215,7 +205,6 @@ function Thread( {
onEdit={ onEditComment }
onDelete={ onCommentDelete }
status={ thread.status }
onReturnToBlock={ handleReturnToBlock }
/>
{ 0 < thread?.reply?.length && (
<>
Expand Down Expand Up @@ -253,15 +242,13 @@ function Thread( {
showLabel={ false }
onEdit={ onEditComment }
onDelete={ onCommentDelete }
onReturnToBlock={ null }
/>
) }
{ 'approved' === thread.status && (
<CommentBoard
thread={ reply }
commentNumber={ commentNumber }
showLabel={ false }
onReturnToBlock={ null }
/>
) }
</VStack>
Expand Down Expand Up @@ -314,7 +301,6 @@ function Thread( {
),
commentNumber
) }
onReturnToBlock={ handleReturnToBlock }
/>
</VStack>
</VStack>
Expand All @@ -333,7 +319,6 @@ const CommentBoard = ( {
onEdit,
onDelete,
status,
onReturnToBlock,
} ) => {
const [ actionState, setActionState ] = useState( false );
const [ showConfirmDialog, setShowConfirmDialog ] = useState( false );
Expand Down Expand Up @@ -449,7 +434,6 @@ const CommentBoard = ( {
_x( 'Edit Comment %s', 'Edit specific comment' ),
commentNumber
) }
onReturnToBlock={ onReturnToBlock }
/>
) : (
<RawHTML className="editor-collab-sidebar-panel__user-comment">
Expand Down
Loading