MM-62383 Replace React Bootstrap with Floating UI in Emoji Picker (#29835)

* Convert EmojiPickerOverlay to functional component

* Convert EmojiPickerTabs to functional component

* Extract AddReactionButton from ReactionList

This is so that I can make part of it functional without rewriting
the whole thing.

* Convert PostReaction to functional component

* Add general version of useEmojiPicker and use for AddReactionButton

* Rename returned showEmojiPicker to emojiPickerOpen

* Add test for AddReactionButton

* Move showEmojiPicker state out of useEmojiPicker

I hoped to avoid this by just having the hook return the
show state, but unfortunately, too many of the existing places
rely on controlling the state themselves

* Change PostReaction to use useEmojiPicker

I ran into some trouble with this getting the hover state to properly
disappear from the PostComponent when clicking out of the picker. That
seems to be a downside of the browser's mouseenter/mouseleave not
handling cases where the component is covered up. It doesn't work 100%,
but it works at least as well as master by disabling pointer-events to
the FloatingOverlay (which I also think we could probably remove since
it's supposed to just be for darkening the backdrop behind the picker,
but it ended up being helpful for setting the z-index on mobile).

* Change AdvancedTextEditor to use new useEmojiPicker

I renamed its version of useEmojiPicker to useEditorEmojiPicker since it
still contains information about how to position the emoji or gifs in
the post text.

* Convert EditPost to use useEmojiPicker

* Convert CreateModalNameInput to use useEmoijPicker

* Convert CustomStatusModal to use useEmojiPicker

* Remove EmojiPickerOverlay and cleanup related code

* Remove unneeded translation string

* asdf Attempting to fix E2E test

* Improve how useEmojiPicker positions itself to stay on screen more

* Add offset between Emoji Picker and reference

* Add horizontallyWithin middleware and use it to right-align the emoji picker in the post textbox
Этот коммит содержится в:
Harrison Healey
2025-02-14 13:53:30 -05:00
коммит произвёл GitHub
родитель da7192246e
Коммит b6118b7701
34 изменённых файлов: 751 добавлений и 897 удалений

Просмотреть файл

@@ -193,7 +193,7 @@ describe('Keyboard shortcut CTRL/CMD+Shift+\\ for adding reaction to last messag
cy.get('#emojiPicker').should('exist');
// # Click anywhere to close emoji picker
cy.get('#channelHeaderInfo').click();
cy.get('body').click();
cy.get('#emojiPicker').should('not.exist');
});

Просмотреть файл

@@ -64,6 +64,8 @@ describe('Edit Message', () => {
// * Assert channel autocomplete is not visible
cy.get('#suggestionList').should('not.exist');
cy.wait(TIMEOUTS.HALF_SEC);
// # In the modal click the emoji picker icon
cy.get('div.post-edit__container button#emojiPickerButton').click();