Skip to content

Conversation

@comlit
Copy link
Contributor

@comlit comlit commented May 28, 2025

added ability to copy and paste bpmn elemtents between browser window or different applications using the systems clipboard

implementation based on this

closes #1709

@barmac
Copy link
Member

barmac commented Jun 3, 2025

The CI is failing right now. Can you have a look?

@comlit
Copy link
Contributor Author

comlit commented Jun 4, 2025

yes we looked at the failing tests and identified it happening because of issues with asynchronous code in testing, which did not occur while testing locally. We are on it👍

@barmac barmac requested review from a team, Buckwich and philippfromme and removed request for a team June 18, 2025 14:25
@barmac barmac added the needs review Review pending label Jun 25, 2025
@barmac
Copy link
Member

barmac commented Jun 25, 2025

Hi,
I've tried this out, and it worked fine for a basic case. However, once we dig deeper, there are the following issues:

  • The module logs an error for any text in the clipboard which does not meet the expectations.
  • There are even uncaught errors in case a proper JSON was present in the clipboard. After that, the feature stops to work.
  • Naturally, you cannot copy and paste elements with custom moddle extensions to an instance without it. This is expected, but we could handle this gracefully (e.g. strip extensions).
  • Obviously, the browser asks for a permission to use the clipboard. I think this should happen only when one tries to copy or paste, and not immediately when canvas is focussed.
  • There is a problem with serialization when I try to paste an element with a linked root element (receive task with messageRef): Failed to parse clipboard contents: Cannot read properties of null (reading '$type')
Screen.Recording.2025-06-25.at.16.24.16.mov

I think this should happen only when one tries to copy or paste, and not immediately when canvas is focussed.

This requirement might be difficult to implement given the asynchronous nature of the API. This could be a reason to make the feature optional.

@barmac
Copy link
Member

barmac commented Jun 26, 2025

Suggestion: Look up how excalidraw handles cross-browser copy and paste. You can use an existing copy-to-image service, and add descriptor embedding to it.

@barmac
Copy link
Member

barmac commented Jun 26, 2025

Or easier: Adopt the pattern of setting type on the text contents, and ignore anything that does not match the expectation

Copy link
Member

@barmac barmac left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cf. the comments above.

@bpmn-io-tasks bpmn-io-tasks bot removed the needs review Review pending label Jun 26, 2025
@barmac barmac marked this pull request as draft June 26, 2025 08:55
@comlit
Copy link
Contributor Author

comlit commented Jun 29, 2025

Hey, thank you very much for your feedback. Unfortunatly the submission deadline for the informaticup (which was our motivation to tackle this issue in the first place) ends tomorrow. This means that we as a team unfortunatly have to focus on other university work. Nevertheless we would like to see this feature merged and will try to tackle the requested changes in our own time.

@barmac
Copy link
Member

barmac commented Jun 30, 2025

All right! Thanks for notice.

@barmac barmac added the backlog Queued in backlog label Oct 21, 2025 — with bpmn-io-tasks
@Buckwich Buckwich removed their request for review October 22, 2025 11:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backlog Queued in backlog

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Copy and paste between different browser windows

2 participants