microsoft / pxt-microbit

A Blocks / JavaScript code editor for the micro:bit built on Microsoft MakeCode
https://makecode.microbit.org
Other
726 stars 638 forks source link

Copy and paste block causes "Opps, don't know how to load this file!" #4944

Open microbit-carlos opened 1 year ago

microbit-carlos commented 1 year ago

Edit: This happens when there is an image in the clipboard and a user copy/pastes a block in the workspace. https://github.com/microsoft/pxt-microbit/issues/4944#issuecomment-1431216892


Describe the bug

I had this occur a couple of times in the past, but it went away fairly quickly (not sure if a number of refreshes or something else fixed it).

Today it seems to occur more consistently, at least on my system, also when using an incognito window. When trying to copy and paste a block with the keyboard it shows this warning.

Screenshot 2023-02-15 at 10 54 29

To Reproduce

This video shows a MakeCode session with the dbg flag, where I simply select a block and press Ctrl+C and Ctrl+V:

https://user-images.githubusercontent.com/29712657/219008747-45748649-a2dd-4fe7-83ad-261675c8b85c.mp4


Expected behavior The warning not to appear.

Screenshots

Included above.

micro:bit version (please complete the following information):

N/A

Desktop (please complete the following information):

Smartphone (please complete the following information): N/A

Additional context

makecode.microbit.org version: 5.0.12 Microsoft MakeCode version: 8.0.7 microbit runtime version: v2.2.0-rc6 codal-microbit-v2 runtime version: v0.2.40

microbit-carlos commented 1 year ago

@JohnVidler had a great epiphany about checking my clipboard and I can confirm that this issue is only replicable for me when I have an image (in this case a screenshot) in my clipboard.

abchatra commented 1 year ago

We don't support multiple things in clipboard as we can't load other files

microbit-carlos commented 1 year ago

Right, but Ctrl+C and Ctrl+V a block showing an inexplicable error is not a great user experience.

With the current UX, most users will be confused about what happened (I definitely was), since the block has been copied but MakeCode is showing that error.

Jaqster commented 1 year ago

@microbit-carlos - I can't reproduce this bug. Just successfully Ctrl+C, Ctrl+V pasted several blocks in the workspace. Can you provide more detailed repro steps?

microbit-carlos commented 1 year ago

Yes, sorry, I should have added the https://github.com/microsoft/pxt-microbit/issues/4944#issuecomment-1431216892 comment to the original message. To trigger the issue you need to have an image in your clipboard.

abchatra commented 1 year ago

May be mac specific. Doesn't repro in the windows machine.

abchatra commented 1 year ago

@carlosperate could reproduce in Mac.

martinwork commented 1 year ago

@abchatra I can repro on Windows in Chrome.

The block is pasted OK, but there is also the "oops" message.