Skip to content
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

feat: render MessageActionsBox on modal #1716

Closed

Conversation

MartinCupela
Copy link
Contributor

🎯 Goal

Render the message actions menu above an overlay that would prevent the erratic behavior of menu disappearing when hovered away. Make sure that only one menu is rendered in a given container.

🛠 Implementation details

This implementation uses React portal to append the modal to a selected container. That avoids the message hover state to influence the display of the message actions menu.

Only one message actions menu can be rendered per message list.

Each menu is positioned using react-popper. This assures that the menu position will be adjusted so that it is always entirely visible.

Message options are kept visible meanwhile the message actions menu is open.

During the implementation the Modal component received changes that allows us to pass the properties to the inner modal container div as well as to set the reference to this div for the parent components. This is used in connection with the react-popper.

🎨 UI Changes

demo_message_actions_on_modal.webm

@MartinCupela MartinCupela requested review from oliverlaz, khushal87 and arnautov-anton and removed request for khushal87 August 18, 2022 14:42
Base automatically changed from theming-v2-user-testing to theming-v2 August 18, 2022 15:41
@codecov
Copy link

codecov bot commented Aug 19, 2022

Codecov Report

Attention: Patch coverage is 96.96970% with 3 lines in your changes missing coverage. Please review.

Project coverage is 83.63%. Comparing base (363676e) to head (f87a809).
Report is 616 commits behind head on master.

Files with missing lines Patch % Lines
src/components/MessageActions/MessageActions.tsx 96.96% 0 Missing and 1 partial ⚠️
.../components/MessageList/VirtualizedMessageList.tsx 75.00% 0 Missing and 1 partial ⚠️
src/components/Modal/Modal.tsx 94.73% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1716      +/-   ##
==========================================
+ Coverage   83.44%   83.63%   +0.19%     
==========================================
  Files         251      252       +1     
  Lines        6166     6196      +30     
  Branches     1647     1654       +7     
==========================================
+ Hits         5145     5182      +37     
+ Misses        870      864       -6     
+ Partials      151      150       -1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Base automatically changed from theming-v2 to develop September 9, 2022 08:41
@DannyBiezen
Copy link

I've been trying to find a way to not have the message actions menu disappear when hovering away and found this PR which seems to do exactly what I want!

Are there any plans on getting this merged? It would be great having this provided by this SDK instead of having to customize a lot of components in my codebase.

@MartinCupela
Copy link
Contributor Author

Hello @DannyBiezen , this is currently on hold due the focus on other priorities. I plan to get back to this, but I do not have an exact roadmap to provide you.

@MartinCupela
Copy link
Contributor Author

fixed by #2489

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants