-
Notifications
You must be signed in to change notification settings - Fork 4.6k
Block comments: Add the ability to reopen resolved comments #71250
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
Merged
t-hamano
merged 20 commits into
WordPress:trunk
from
yashjawale:feat/reopen-resolved-comments
Sep 15, 2025
Merged
Changes from 12 commits
Commits
Show all changes
20 commits
Select commit
Hold shift + click to select a range
3786a56
feat: initial implementation - enable reopening comments
yashjawale 1b36276
fix: update comment resolution status to 'hold' when reopening
yashjawale 1a962d8
feat: update comment button to use undo icon for reopening approved c…
yashjawale 34960f3
refactor: add onCommentReopen function to handle reopening comments i…
yashjawale eb94947
fix: restore translator comment to previous state
yashjawale e9e89ba
fix: prevent rendering of focused thread for approved comments
yashjawale 0a88fc4
fix: move reopen approved comments option to the comment actions menu
yashjawale 22a1421
fix: revert unrelated change in imports
yashjawale 675905e
fix: update success message for reopening comments
yashjawale 9ae8b8d
fix: remove redundant confirmation dialogs for reopening and resolvin…
yashjawale 4a4d193
fix: comment resolution functionality after removing dialogs
yashjawale cc431a5
feat: add CommentQuickReply component for quick replies on resolved t…
yashjawale c8c5696
fix: remove translator comments without placeholders
yashjawale 2d5cd92
Merge branch 'trunk' into feat/reopen-resolved-comments
yashjawale 381bbae
fix: use resolve button instead of separate tooltip for resolved threads
yashjawale 8ef98f1
refactor: remove CommentQuickReply component and use CommentForm instead
yashjawale b79517a
feat: add props to CommentForm for rows & placeholder
yashjawale 96c9338
fix: button layout with large text
yashjawale 90f88e5
Merge branch 'trunk' into feat/reopen-resolved-comments
yashjawale f961cf5
refactor: remove unnecessary button styles from comment dropdown menu
yashjawale File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
73 changes: 73 additions & 0 deletions
73
packages/editor/src/components/collab-sidebar/comment-quick-reply.js
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,73 @@ | ||
| /** | ||
| * WordPress dependencies | ||
| */ | ||
| import { useState } from '@wordpress/element'; | ||
| import { | ||
| __experimentalHStack as HStack, | ||
| Button, | ||
| __experimentalInputControl as InputControl, | ||
| } from '@wordpress/components'; | ||
| import { _x, __ } from '@wordpress/i18n'; | ||
|
|
||
| /** | ||
| * Internal dependencies | ||
| */ | ||
| import { sanitizeCommentString } from './utils'; | ||
|
|
||
| /** | ||
| * CommentQuickReply component. | ||
| * Displayed on resolved thread to allow quick reply. | ||
| * Also reopens the thread on submit. | ||
| * | ||
| * @param {Object} props - The component props. | ||
| * @param {Function} props.onSubmit - The function to call when updating the comment. | ||
| * @return {React.ReactNode} The CommentQuickReply component. | ||
| */ | ||
| function CommentQuickReply( { onSubmit } ) { | ||
| const [ inputComment, setInputComment ] = useState( '' ); | ||
|
|
||
| const [ isFocused, setIsFocused ] = useState( false ); | ||
|
|
||
| return ( | ||
| <> | ||
| <InputControl | ||
| __next40pxDefaultSize | ||
| __nextHasNoMarginBottom | ||
| value={ inputComment ?? '' } | ||
| onChange={ setInputComment } | ||
| label={ __( 'Reopen the thread & reply' ) } | ||
| placeholder={ __( 'Replying will reopen this thread' ) } | ||
| onFocus={ () => setIsFocused( true ) } | ||
| hideLabelFromVision | ||
| /> | ||
| { isFocused && ( | ||
| <HStack alignment="left" spacing="3" justify="flex-start"> | ||
| <Button | ||
| __next40pxDefaultSize | ||
| accessibleWhenDisabled | ||
| variant="primary" | ||
| onClick={ () => { | ||
| onSubmit( inputComment ); | ||
| setInputComment( '' ); | ||
| } } | ||
| disabled={ | ||
| 0 === sanitizeCommentString( inputComment ).length | ||
| } | ||
| text={ _x( 'Reply', 'Add reply comment' ) } | ||
| /> | ||
| <Button | ||
| __next40pxDefaultSize | ||
| variant="tertiary" | ||
| onClick={ () => { | ||
| setIsFocused( false ); | ||
| setInputComment( '' ); | ||
| } } | ||
| text={ _x( 'Cancel', 'Cancel comment button' ) } | ||
| /> | ||
| </HStack> | ||
| ) } | ||
| </> | ||
| ); | ||
| } | ||
|
|
||
| export default CommentQuickReply; | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.