BoostNote-Legacy icon indicating copy to clipboard operation
BoostNote-Legacy copied to clipboard

Pasting imaging not working anymore after last update (Windows 10, Boostnote 0.11.12)

Open payacoub opened this issue 7 years ago • 14 comments

Current behavior

Really easy: the pasting image function is no longer working. While it would correctly paste before by adding the bath to the file and showing the image in preview, it has no longer any effect.

Expected behavior

It should paste the file path to the editor and show the image on preview

Steps to reproduce

Just copy/screenshot something and paste into the editor on 0.11.12

Environment

  • Version : Boostnote 0.11.12
  • OS Version and name : Windows 10

payacoub avatar Dec 17 '18 17:12 payacoub

The problem is following: somehow pasting images is only allowed if you enable the 'smart paste' option in the interface... I have no idea why and don't find it good. Maybe @Rokt33r or @daiyam (you implemented it?) can enlight us :)

ehhc avatar Dec 17 '18 18:12 ehhc

btw: if somebody fixes this issue: intellij states that the method attachmentManagement.handlePastImageEvent is not used anymore (i think because of the implementation by @daiyam ), it would be nice to delete it completely... having dead code is.. ugly.. :) Thanks :)

ehhc avatar Dec 17 '18 18:12 ehhc

Hey @ehhc thanks for the reply :)

You are right, it was about the Smart Paste option that wasn't enabled. Don't remember if it was there before but I was using it for sure!

Closing the issue then

payacoub avatar Dec 17 '18 18:12 payacoub

@payacoub you don't need to enable the "smart paste". Instead, you can use Ctrl+Shift+V.

daiyam avatar Dec 17 '18 21:12 daiyam

@ehhc when pasting an image, there is 2 cases:

  • the clipboard has the data uri as text and the image as an object (example: copy image from google image)
  • the clipboard has only the image as an object (example: copy image from boostnote.io)

In the first case, a Ctrl+V gives you the data uri and a Ctrl+Shift+V gives the image In the second case, a Ctrl+Shift+V gives the image.

So Ctrl+Shift+V always give you the image.

There is 2 possible improvements:

  • in the second case,Ctrl+V should also give the data uri
  • in both cases, Ctrl+V should give the image (the data uri can't be pasted)

What do you think?

daiyam avatar Dec 17 '18 21:12 daiyam

I'm not sure but i think Ctrl + v always gives you the images sounds right, doesen't it? I mean: Pasting images should be allways possible.. At the other hand: i don't know.. what do you think @Rokt33r ?

ehhc avatar Dec 18 '18 07:12 ehhc

I'm actually leaning toward @ehhc's idea. Could you tell me why do we need to keep images as data uri? And do you have any examples of other apps woking like that? @daiyam

Rokt33r avatar Dec 18 '18 07:12 Rokt33r

@ehhc @Rokt33r I thought the extra possibility to be able to paste data uri would be good for some users. So if Ctrl+V has to paste images, I don't mind.

daiyam avatar Dec 18 '18 08:12 daiyam

@daiyam is there any use case in which i need the data uri? Maybe we can switch the behavior? ctrl + v = Iage ctrl + shift + v = data uri? What do you think about that?

ehhc avatar Dec 18 '18 08:12 ehhc

@ehhc I don't have any real use case.

I was more thinking:

  • Ctrl+V pastes only text
  • Ctrl+Shift+V pastes image, HTML or text

But if Ctrl+V has to paste images, I really don't mind 😉

daiyam avatar Dec 18 '18 09:12 daiyam

UX-wise if I may, I'd prefer having the Ctrl+V at least pasting the images as well :) In terms of use, I use Boostnote mostly for note taking (taking advantage of markdown and all) so images are of huge importance

The confusion with the smart paste option led to the opening of this ticket but it may depend on the main use-case of course

payacoub avatar Dec 20 '18 09:12 payacoub

@Rokt33r Should I change the Ctrl+V's behaviour to paste images?

daiyam avatar Dec 24 '18 08:12 daiyam

Ctrl+V pastes only text Ctrl+Shift+V pastes image, HTML or text

It sounds reasonable.

Should I change the Ctrl+V's behaviour to paste images?

Yeah, I think we should do. 😢

Rokt33r avatar Dec 24 '18 08:12 Rokt33r

@Rokt33r I've made the PR #2747 to fix that.

daiyam avatar Dec 24 '18 09:12 daiyam