Skip to content
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

Copying content with comment marker triggers change:data #15943

Closed
scofalik opened this issue Feb 28, 2024 · 4 comments · Fixed by #16005
Closed

Copying content with comment marker triggers change:data #15943

scofalik opened this issue Feb 28, 2024 · 4 comments · Fixed by #16005
Assignees
Labels
package:clipboard package:comments squad:collaboration Issue to be handled by the Collaboration team. type:bug This issue reports a buggy (incorrect) behavior.

Comments

@scofalik
Copy link
Contributor

📝 Provide detailed reproduction steps (if any)

It is better visible if you configure comments to copy markers on copy-paste (config.comments.copyMarkers: [ 'cut', 'copy' ]).

  1. Create some content and add marker on it.
  2. Select some content so that markers intersects with the selection (or is inside).
  3. Ctrl+C

✔️ Expected result

Nothing happens.

❌ Actual result

  1. Autosaved is triggered.
  2. Empty undo step is created.
  3. Other callbacks may be called unnecessarily.

📃 Other details

This is probably due to the fact that we temporarily insert $marker elements into the content. I hoped that change:data will not fire because in the end there are no real changes in the differ (the element is added and removed in the same batch). So either differ works differently than I thought, or something extra happens.

@scofalik scofalik added type:bug This issue reports a buggy (incorrect) behavior. package:clipboard squad:collaboration Issue to be handled by the Collaboration team. release:potential-blocker This issue potentially blocks the upcoming release (should be checked). package:comments labels Feb 28, 2024
@pomek pomek removed the release:potential-blocker This issue potentially blocks the upcoming release (should be checked). label Feb 29, 2024
@charlttsie
Copy link
Contributor

Comment markers are not retained after drag & drop in default mode

Steps

1. Open a manual test with comments - e.g. annotations.html
2. Set copyMarkers: 'default'
3. Add some comments
4. Drag and drop commented elements

Result

Comments are not retained:

drag-drop.mp4

@charlttsie
Copy link
Contributor

#15943 (comment) looks good already 👍

@michalbilik
Copy link
Contributor

michalbilik commented Mar 12, 2024

Comment markers are pasted into a table even when a marker already exists in the table

Steps

  1. Open a manual test with comments - e.g. all-features-rtc.html.
  2. Set copyMarkers: 'default'.
  3. Comment Cell 1.1.
  4. Use cmd + x to cut Row 1.
  5. Use Undo.
  6. Select Column 2 and paste content.

Result

Comments are duplicated

Screen.Recording.2024-03-12.at.13.13.24.mov

@michalbilik
Copy link
Contributor

michalbilik commented Mar 12, 2024

Comments can be duplicated when combining undo and pasting same comment twice

Steps

  1. Open a manual test with comments - e.g. all-features-rtc.html.
  2. Set copyMarkers: 'default'.
  3. Comment some content.
  4. Cut commented content with cmd + x.
  5. Use Undo.
  6. Paste the content into the same place.
  7. Paste the content again.

Result

Comments are duplicated:

Screen.Recording.2024-03-12.at.14.04.11.mov

Content in step 7 can be pasted to a different spot:

Screen.Recording.2024-03-12.at.14.12.33.mov

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
package:clipboard package:comments squad:collaboration Issue to be handled by the Collaboration team. type:bug This issue reports a buggy (incorrect) behavior.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants