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

fix (Whiteboard): Paste shape #8636

Merged
merged 18 commits into from Mar 1, 2023
Merged

fix (Whiteboard): Paste shape #8636

merged 18 commits into from Mar 1, 2023

Conversation

sprocketc
Copy link
Collaborator

@sprocketc sprocketc commented Feb 16, 2023

This fix allows copy/pasting objects instead of references using Ctrl+Shift+C and Ctrl+V (see https://discord.com/channels/725182569297215569/1075712494150111324/1075712494150111324)

I tried to add a test but couldn't make it work consistently, but I made some minor improvements to the test in the process.

There is a bigger issue here, which is the way copy/paste and dnd behaves. Copying the reference by default when we use Ctrl+C might not be expected in whiteboards context, and should be re-evaluated in my opinion. Dragging and dropping links does not create an iFrame object. Also, usePaste.ts is almost 500 lines of code and is responsible for pasting and dropping. We need to refactor it soon and add more tests to eliminate similar issues.

@sprocketc sprocketc changed the title fix (Whiteboard): Paste shape [WIP] fix (Whiteboard): Paste shape Feb 16, 2023
@sprocketc sprocketc changed the title [WIP] fix (Whiteboard): Paste shape fix (Whiteboard): Paste shape Feb 21, 2023
@sprocketc sprocketc marked this pull request as ready for review February 21, 2023 17:55
Copy link
Collaborator

@logseq-cldwalker logseq-cldwalker left a comment

Choose a reason for hiding this comment

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

@sprocketc Copying shapes with command-shift-C works nicely on a mac! 👍 🚢

@logseq-cldwalker
Copy link
Collaborator

Could be good to mention this shortcut in the docs. I wouldn't know this would work otherwise.

Fwiw I ignored this PR for awhile since it didn't have any reviewers requested and wasn't sure if you wanted it reviewed

@logseq-cldwalker logseq-cldwalker merged commit 1ff1517 into master Mar 1, 2023
@logseq-cldwalker logseq-cldwalker added this to the 0.8.19 milestone Mar 1, 2023
@sprocketc
Copy link
Collaborator Author

Could be good to mention this shortcut in the docs. I wouldn't know this would work otherwise.

@logseq-cldwalker That's true, but we are going to change this behavior soon, because that's not what most users would expect.

@tiensonqin tiensonqin deleted the fix/paste-shape branch July 5, 2023 10:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants