-
Notifications
You must be signed in to change notification settings - Fork 11.1k
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: add multi-delete functionality for messages. #34952
base: develop
Are you sure you want to change the base?
feat: add multi-delete functionality for messages. #34952
Conversation
🦋 Changeset detectedLatest commit: fb32d6d The changes in this PR will be included in the next version bump. This PR includes changesets to release 35 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Looks like this PR is not ready to merge, because of the following issues:
Please fix the issues and try again If you have any trouble, please check the PR guidelines |
I’ve updated the PR title, trying to ensure it might align with the required format. Please let me know if there’s anything else I need to address or improve. I’m happy to make further changes if required. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The addition is really great but the way you implemented its not really friendly.
I would like to suggest some changes so we could merge the feature:
- We already have a pattern to select multiple messages, you can check it trying to use the export message feature.
- Instead of opening the confirmation modal when clicking in Delete message, you could open turn on the selection mode, selecting the initial message and allowing the user to select more and we can render a similar composer we have for export messages but now with the action to delete
- Now clicking on delete the confirmation modal is displayed
Thank you for the feedback. I appreciate the suggestions and will update the PR to use the selection mode approach as suggested. I'll work on the changes soon. Thanks for helping improve this feature! |
This implementation follows the existing pattern for selecting multiple messages, similar to the export message feature. When the delete button is clicked, the UI enters selection mode, allowing users to select the initial message and additional messages. A composer has been added to facilitate the deletion of selected messages . multi.message.delete.mp4thread.message.delete.mp4I have also added a Doc , For detailed information on the implementation : Doc Link Thank you for your time and consideration. I appreciate any further feedback to improve this feature. |
Proposed changes (including videos or screenshots)
This PR implements a new multi-delete functionality . The changes include:
Added Checkbox in Default Message Items:
A checkbox now appears with each message; however, it is rendered only if the current user has permission to delete that message.
Implemented MultiDeleteButton Component:
A new component,
MultiDeleteButton
, has been added. When multiple messages are selected, this button appears (via the Room header toolbox). Upon clicking, a confirmation modal is shown, and on confirmation, the component uses hook to call the existingchat.delete
endpoint for each selected message.Integration into RoomHeader:
The
MultiDeleteButton
is injected into the RoomHeader ,So that the multi-delete option is easily accessible in the header's toolbox area.Issue(s)
Closes #917
Steps to test or reproduce
Further comments
This change improves message management efficiency by enabling bulk deletion of messages. The implementation builds upon our existing deletion endpoint for individual messages. I have taken great care to preserve the existing code structure wherever possible. In areas such as the header title and the generic modal, I used raw message strings (with underscores) in cases where a proper translation did not yet exist, to ensure accurate rendering in the meantime. It is recommended that new translation keys be added to our i18n files for complete localization. I appreciate any feedback on further refinements or additional requirements.
multidelete.mp4