How to Distinguish if a Submit is Triggered from List View or Form?

Hello everyone,

In my implementation, I have set up a confirmation step before the submission of a document, using the before_submit hook along with an asynchronous confirmation dialog. However, I’m facing an issue where this confirmation dialog interferes with the process when documents are submitted in bulk from the list view, causing the bulk submission operation to fail.

My question is: Is there a way to determine within the before_submit method whether the submission is triggered by a bulk operation in the list view or by clicking the submit button in the individual form view? This would allow me to display the confirmation dialog only for submissions from the form view and skip it during bulk submissions from the list view.

Any insights or suggestions on this matter would be greatly appreciated. Thank you in advance for your time and help!