We did something similar few years ago. The user had to be able to choose and also sort documents, we then merged to one pdf.
It was the time when I introduced the first version of the modal dialogues, which Daniel Krüger improved a lot.
Have a look at https://daniels-notes.de/posts/2022/modal-dialog.
We used a menu action that opened the form in a dialogue. The form has an itemlist, which we initialize with the attachments of the calling element. And some more to name and categorize the merged pdf. The workflow only has a path to merge the selected pdf's and add the merged document to the attachments.
You could do something similar to send selected attachments in an email.