jabref icon indicating copy to clipboard operation
jabref copied to clipboard

Allow file attachment into the comments editor (Markdown)

Open koppor opened this issue 1 year ago • 19 comments

How to reproduce

  1. Create a library with the file directory is .
  2. Firefox: Visit https://www.sequoiacap.com/article/ai-powered-developer-tools/
  3. Firefox: Import into JabRef
  4. Go to the tab "Comments"
  5. From Firefox: drag'n'drop the image onto the comment field

Expectation:

  1. ![](dev-ai-wide-10.png) appears in the editor
  2. dev-ai-wide-10.png exists next to the .bib file (which is the file directory configured for the bib file)

Actual behavior

File is attached

Additional Info

Note: Deep link to the image: https://www.sequoiacap.com/wp-content/uploads/sites/6/2023/03/dev-ai-wide-10.png?resize=1440,1400

TODOs

  • [ ] 1. Use JabRef's download functionality
  • [ ] 2. Add link into comment field (next to cursor)
  • [ ] 3. Change "Find unlinked files" to ignore files linked in the comment fields

Background:

  • Feature in VS.Code: https://code.visualstudio.com/updates/v1_79#_editor

koppor avatar Oct 23 '23 20:10 koppor

Hello, I'm an undergraduate programming major that's eager to make my first GitHub contribution. Would I be able to claim this issue? Thanks!

DavidCoy77 avatar Oct 25 '23 03:10 DavidCoy77

I'm thoroughly occupied with the other issue I claimed (#10558), so I "unassigned" myself on this one. I'm not going to work on it at all, so it is completely free for someone else to claim.

DavidCoy77 avatar Oct 27 '23 15:10 DavidCoy77

Hi, I'm looking for an issue for my project. Would you mind assigning this issue to me? I will try to fix it. Thanks!

fyssgo avatar Oct 28 '23 03:10 fyssgo

Hello there, would you be able to assign this project to me? I am supposed to work on an beginner - friendly issue for my Software Engineering Class.

weronikaulbricht avatar Apr 10 '24 07:04 weronikaulbricht

As a general advice for newcomers: check out Contributing for a start. Also, guidelines for setting up a local workspace is worth having a look at.

Feel free to ask here at GitHub, if you have any issue related questions. If you have questions about how to setup your workspace use JabRef's Gitter chat. Try to open a (draft) pull-request early on, so that people can see you are working on the issue and so that they can see the direction the pull request is heading towards. This way, you will likely receive valuable feedback.

github-actions[bot] avatar Apr 10 '24 07:04 github-actions[bot]

@weronikaulbricht Since there has not been any activity, I assume you have given up on this project, therefore will unassign you to make this issue available to other contributors. If you are still on it, just leave a message.

ThiloteE avatar May 20 '24 19:05 ThiloteE

@ThiloteE If you would like, you can assign this issue to me!

abimael-turing avatar May 20 '24 22:05 abimael-turing

I already assigned you to another good first issue today. Are you sure? Don't overload yourself.

ThiloteE avatar May 20 '24 23:05 ThiloteE

Hey, I'm looking for a good first issue and want to work at this one. I already have installed the jabref-Program working on intellij. Currently I try to reproduce the issue and need more information about the guideline.

At first what is important about the file directory, named: "."?

How to reproduce

  1. Create a library with the file directory is .
  2. Firefox: Visit https://www.sequoiacap.com/article/ai-powered-developer-tools/
  3. Firefox: Import into JabRef ...

ADm1n766 avatar May 24 '24 11:05 ADm1n766

@ADm1n766 create a new library in JabRef , then right click on the library properties -> General file directory set to "." this means it will take the relative path of the library, the location of the .bib file

Siedlerchr avatar May 24 '24 13:05 Siedlerchr

Probably I've reproduced the Issue completely: At first I created a new library, then put some information in required fields from the website and copied the image "03/dev-ai-wide-10.png?w=1024" and if I have a connection to a network the image is displayed.

But if I want to put the image per drag and drop from the website without saving in a file directory I get the exception:

Uncaught exception occurred in Thread[#53, JavaFX Application Thread, 5, main] ReferenceError: Can´t find variable: Mark

and much more detailed information. Thats the issue right?

ADm1n766 avatar May 31 '24 09:05 ADm1n766

@ADm1n766 Would be great if you could post the whole stackrace and if you have some local stuff already then go create a PR. Without seeing any code or the complete stacktrace it's hard to identify the root cause

Siedlerchr avatar May 31 '24 17:05 Siedlerchr

Of course, with pleasure! Here is a screenshot from my exception: Issue-10559

ReferenceError: Can´t find the variable: Mark The whole exception stacktrace was: netscape.javascript.JSException: ReferenceError: Can't find variable: Mark at [email protected]/com.sun.webkit.dom.JSObject.fwkMakeException(JSObject.java:160) at [email protected]/com.sun.webkit.WebPage.twkExecuteScript(Native Method) at [email protected]/com.sun.webkit.WebPage.executeScript(WebPage.java:1576) at [email protected]/javafx.scene.web.WebEngine.executeScript(WebEngine.java:985) at [email protected]/org.jabref.gui.preview.PreviewViewer.highlightSearchPattern(PreviewViewer.java:211) at [email protected]/org.jabref.gui.preview.PreviewViewer.lambda$new$2(PreviewViewer.java:176) at [email protected]/com.sun.javafx.binding.ExpressionHelper$SingleChange.fireValueChangedEvent(ExpressionHelper.java:192) at [email protected]/com.sun.javafx.binding.ExpressionHelper.fireValueChangedEvent(ExpressionHelper.java:91) at [email protected]/javafx.beans.property.ReadOnlyObjectPropertyBase.fireValueChangedEvent(ReadOnlyObjectPropertyBase.java:80) at [email protected]/javafx.beans.property.ReadOnlyObjectWrapper.fireValueChangedEvent(ReadOnlyObjectWrapper.java:102) at [email protected]/javafx.beans.property.ObjectPropertyBase.markInvalid(ObjectPropertyBase.java:113) at [email protected]/javafx.beans.property.ObjectPropertyBase.set(ObjectPropertyBase.java:147) at [email protected]/javafx.scene.web.WebEngine$LoadWorker.updateState(WebEngine.java:1264) at [email protected]/javafx.scene.web.WebEngine$LoadWorker.dispatchLoadEvent(WebEngine.java:1379) at [email protected]/javafx.scene.web.WebEngine$PageLoadListener.dispatchLoadEvent(WebEngine.java:1244) at [email protected]/com.sun.webkit.WebPage.fireLoadEvent(WebPage.java:2577) at [email protected]/com.sun.webkit.WebPage.fwkFireLoadEvent(WebPage.java:2421) at [email protected]/com.sun.webkit.network.URLLoaderBase.twkDidFinishLoading(Native Method) at [email protected]/com.sun.webkit.network.HTTP2Loader.notifyDidFinishLoading(HTTP2Loader.java:566) at [email protected]/com.sun.webkit.network.HTTP2Loader.lambda$callBackIfNotCanceled$10(HTTP2Loader.java:429) at [email protected]/com.sun.javafx.application.PlatformImpl.lambda$runLater$10(PlatformImpl.java:456) at java.base/java.security.AccessController.doPrivileged(AccessController.java:400) at [email protected]/com.sun.javafx.application.PlatformImpl.lambda$runLater$11(PlatformImpl.java:455) at [email protected]/com.sun.glass.ui.InvokeLaterDispatcher$Future.run(InvokeLaterDispatcher.java:95) at [email protected]/com.sun.glass.ui.win.WinApplication._runLoop(Native Method) at [email protected]/com.sun.glass.ui.win.WinApplication.lambda$runLoop$3(WinApplication.java:184) at java.base/java.lang.Thread.run(Thread.java:1583)

ADm1n766 avatar Jun 01 '24 14:06 ADm1n766

Ah interesting, that is coming from the javascript that is used for the search highlighting:

at [email protected]/org.jabref.gui.preview.PreviewViewer.highlightSearchPattern(PreviewViewer.java:211)

Siedlerchr avatar Jun 01 '24 21:06 Siedlerchr

The issue at hand is about the Markdown editor (!) , not the preview.

As picture:

image

Please try to focus on that and not to find other issues.

The class to modify should be https://github.com/JabRef/jabref/blob/f570a2d9157f9667bc84a1c2e4e6a4f15d999ca5/src/main/java/org/jabref/gui/fieldeditors/MarkdownEditor.java#L15.

Note for developers: The preview is discussed in an internal issue https://github.com/JabRef/jabref-issue-melting-pot/issues/452.

koppor avatar Jun 17 '24 19:06 koppor