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

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

Closed
payacoub opened this issue Dec 17, 2018 · 14 comments

Comments

@payacoub
Copy link

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
@ehhc
Copy link
Contributor

ehhc commented Dec 17, 2018

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
Copy link
Contributor

ehhc commented Dec 17, 2018

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 :)

@payacoub
Copy link
Author

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

@daiyam
Copy link
Contributor

daiyam commented Dec 17, 2018

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

@daiyam
Copy link
Contributor

daiyam commented Dec 17, 2018

@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?

@ehhc
Copy link
Contributor

ehhc commented Dec 18, 2018

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 ?

@Rokt33r
Copy link
Member

Rokt33r commented Dec 18, 2018

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

@daiyam
Copy link
Contributor

daiyam commented Dec 18, 2018

@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.

@ehhc
Copy link
Contributor

ehhc commented Dec 18, 2018

@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?

@daiyam
Copy link
Contributor

daiyam commented Dec 18, 2018

@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 😉

@payacoub
Copy link
Author

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

@daiyam
Copy link
Contributor

daiyam commented Dec 24, 2018

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

@Rokt33r
Copy link
Member

Rokt33r commented Dec 24, 2018

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. 😢

@daiyam
Copy link
Contributor

daiyam commented Dec 24, 2018

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants