feat: add multi-delete functionality for messages. #34952
+79
−0
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.
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