Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
3 changes: 3 additions & 0 deletions backport-changelog/7.2/15138.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
https://github.com/WordPress/wordpress-develop/pull/15138

* https://github.com/WordPress/gutenberg/pull/85565
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,12 @@ class Gutenberg_REST_Comment_Controller_7_2 extends WP_REST_Comments_Controller
*
* @since 7.2.0
*
* @return string[] Hex keys for heart, celebration, smile, eyes and rocket.
* @return string[] Hex keys for thumbs up, plus, heart, celebration, smile, eyes and rocket.
*
* @phpstan-return non-empty-list<lowercase-string&non-falsy-string>
*/
private static function get_note_reaction_keys(): array {
return array( '2764', '1f389', '1f604', '1f440', '1f680' );
return array( '1f44d', '2795', '2764', '1f389', '1f604', '1f440', '1f680' );

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess this bit needs a backport pr

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, will handle this tomorrow.

}
// END CHANGE.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,21 @@ export interface ReactionEmoji {
* that phrase needs.
*/
export const REACTION_EMOJIS: ReactionEmoji[] = [
{
emoji: 'πŸ‘',
hexKey: '1f44d',
label: _x( 'Thumbs up', 'emoji reaction' ),
sentenceLabel: _x(
'thumbs up',
'emoji reaction, after "reacted with"'
),
},
{
emoji: 'βž•',
hexKey: '2795',
label: _x( 'Plus', 'emoji reaction' ),
sentenceLabel: _x( 'plus', 'emoji reaction, after "reacted with"' ),
},
{
emoji: '❀️',
hexKey: '2764',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -804,7 +804,7 @@ public function data_invalid_reaction_inputs() {
'no parent' => array( 'none', '2764', true, 'rest_comment_invalid_parent', 400 ),
'parent is a regular comment' => array( 'comment', '2764', true, 'rest_comment_invalid_parent', 400 ),
'content is not in emoji list' => array( 'note', 'invalid_emoji', true, 'rest_comment_invalid_reaction', 400 ),
'emoji outside the curated set' => array( 'note', '1f44d', true, 'rest_comment_invalid_reaction', 400 ),
'emoji outside the curated set' => array( 'note', '1f525', true, 'rest_comment_invalid_reaction', 400 ),
'uppercase hex key' => array( 'note', '1F680', true, 'rest_comment_invalid_reaction', 400 ),
'emoji name instead of hex' => array( 'note', 'heart', true, 'rest_comment_invalid_reaction', 400 ),
'anonymous user' => array( 'none', '2764', false, 'rest_comment_login_required', 401 ),
Expand Down Expand Up @@ -941,8 +941,10 @@ public function test_create_reaction_valid_emojis( $emoji ) {
}

public function data_valid_reaction_emojis() {
// The five quick reactions: heart, celebration, smile, eyes, rocket.
// The seven quick reactions: thumbs up, plus, heart, celebration, smile, eyes, rocket.
return array(
'thumbs up' => array( '1f44d' ),
'plus' => array( '2795' ),
'heart' => array( '2764' ),
'celebration' => array( '1f389' ),
'smile' => array( '1f604' ),
Expand Down
10 changes: 5 additions & 5 deletions test/e2e/specs/editor/various/block-notes.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -1353,25 +1353,25 @@ test.describe( 'Block Notes', () => {
// The arrow keys move through the emoji, and Enter picks one.
await page.keyboard.press( 'Enter' );
await expect(
menu.getByRole( 'menuitemcheckbox', { name: 'Heart' } )
menu.getByRole( 'menuitemcheckbox', { name: 'Thumbs up' } )
).toBeFocused();
await page.keyboard.press( 'ArrowRight' );
await expect(
menu.getByRole( 'menuitemcheckbox', { name: 'Celebration' } )
menu.getByRole( 'menuitemcheckbox', { name: 'Plus' } )
).toBeFocused();
await page.keyboard.press( 'Enter' );

await expect(
page.getByRole( 'button', { name: /Celebration/ } )
page.getByRole( 'button', { name: /Plus/ } )
).toContainText( '1' );

// The menu marks the emoji the user has already reacted with.
await trigger.click();
await expect(
menu.getByRole( 'menuitemcheckbox', { name: 'Celebration' } )
menu.getByRole( 'menuitemcheckbox', { name: 'Plus' } )
).toBeChecked();
await expect(
menu.getByRole( 'menuitemcheckbox', { name: 'Heart' } )
menu.getByRole( 'menuitemcheckbox', { name: 'Thumbs up' } )
).not.toBeChecked();

// The emoji name shows in a tooltip, and one Escape closes both.
Expand Down
Loading