JabRef / jabref

Graphical Java application for managing BibTeX and biblatex (.bib) databases
https://devdocs.jabref.org
MIT License
3.54k stars 2.47k forks source link

Allow file attachment into the comments editor (Markdown) #10559

Open koppor opened 10 months ago

koppor commented 10 months ago

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

Background:

DavidCoy77 commented 10 months ago

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 commented 10 months ago

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.

fyssgo commented 10 months ago

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!

weronikaulbricht commented 5 months ago

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.

github-actions[bot] commented 5 months ago

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.

ThiloteE commented 3 months ago

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

abimael-turing commented 3 months ago

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

ThiloteE commented 3 months ago

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

ADm1n766 commented 3 months ago

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 ...
Siedlerchr commented 3 months ago

@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

ADm1n766 commented 3 months ago

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?

Siedlerchr commented 3 months ago

@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

ADm1n766 commented 3 months ago

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 javafx.web@22.0.1/com.sun.webkit.dom.JSObject.fwkMakeException(JSObject.java:160) at javafx.web@22.0.1/com.sun.webkit.WebPage.twkExecuteScript(Native Method) at javafx.web@22.0.1/com.sun.webkit.WebPage.executeScript(WebPage.java:1576) at javafx.web@22.0.1/javafx.scene.web.WebEngine.executeScript(WebEngine.java:985) at org.jabref@100.0.0/org.jabref.gui.preview.PreviewViewer.highlightSearchPattern(PreviewViewer.java:211) at org.jabref@100.0.0/org.jabref.gui.preview.PreviewViewer.lambda$new$2(PreviewViewer.java:176) at javafx.base@22.0.1/com.sun.javafx.binding.ExpressionHelper$SingleChange.fireValueChangedEvent(ExpressionHelper.java:192) at javafx.base@22.0.1/com.sun.javafx.binding.ExpressionHelper.fireValueChangedEvent(ExpressionHelper.java:91) at javafx.base@22.0.1/javafx.beans.property.ReadOnlyObjectPropertyBase.fireValueChangedEvent(ReadOnlyObjectPropertyBase.java:80) at javafx.base@22.0.1/javafx.beans.property.ReadOnlyObjectWrapper.fireValueChangedEvent(ReadOnlyObjectWrapper.java:102) at javafx.base@22.0.1/javafx.beans.property.ObjectPropertyBase.markInvalid(ObjectPropertyBase.java:113) at javafx.base@22.0.1/javafx.beans.property.ObjectPropertyBase.set(ObjectPropertyBase.java:147) at javafx.web@22.0.1/javafx.scene.web.WebEngine$LoadWorker.updateState(WebEngine.java:1264) at javafx.web@22.0.1/javafx.scene.web.WebEngine$LoadWorker.dispatchLoadEvent(WebEngine.java:1379) at javafx.web@22.0.1/javafx.scene.web.WebEngine$PageLoadListener.dispatchLoadEvent(WebEngine.java:1244) at javafx.web@22.0.1/com.sun.webkit.WebPage.fireLoadEvent(WebPage.java:2577) at javafx.web@22.0.1/com.sun.webkit.WebPage.fwkFireLoadEvent(WebPage.java:2421) at javafx.web@22.0.1/com.sun.webkit.network.URLLoaderBase.twkDidFinishLoading(Native Method) at javafx.web@22.0.1/com.sun.webkit.network.HTTP2Loader.notifyDidFinishLoading(HTTP2Loader.java:566) at javafx.web@22.0.1/com.sun.webkit.network.HTTP2Loader.lambda$callBackIfNotCanceled$10(HTTP2Loader.java:429) at javafx.graphics@22.0.1/com.sun.javafx.application.PlatformImpl.lambda$runLater$10(PlatformImpl.java:456) at java.base/java.security.AccessController.doPrivileged(AccessController.java:400) at javafx.graphics@22.0.1/com.sun.javafx.application.PlatformImpl.lambda$runLater$11(PlatformImpl.java:455) at javafx.graphics@22.0.1/com.sun.glass.ui.InvokeLaterDispatcher$Future.run(InvokeLaterDispatcher.java:95) at javafx.graphics@22.0.1/com.sun.glass.ui.win.WinApplication._runLoop(Native Method) at javafx.graphics@22.0.1/com.sun.glass.ui.win.WinApplication.lambda$runLoop$3(WinApplication.java:184) at java.base/java.lang.Thread.run(Thread.java:1583)

Siedlerchr commented 3 months ago

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

at org.jabref@100.0.0/org.jabref.gui.preview.PreviewViewer.highlightSearchPattern(PreviewViewer.java:211)

koppor commented 2 months ago

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.