Skip to content

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

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

Open
3 tasks
koppor opened this issue Oct 23, 2023 · 25 comments · May be fixed by #12819
Open
3 tasks

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

koppor opened this issue Oct 23, 2023 · 25 comments · May be fixed by #12819
Assignees
Labels
📍 Assigned Assigned by assign-issue-action (or manually assigned) component: entry-editor good second issue Issues that involve a tour of two or three interweaved components in JabRef 📌 Pinned

Comments

@koppor
Copy link
Member

koppor commented Oct 23, 2023

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:

@koppor koppor added the good first issue An issue intended for project-newcomers. Varies in difficulty. label Oct 23, 2023
@github-project-automation github-project-automation bot moved this to Free to take in Good First Issues Oct 23, 2023
@DavidCoy77
Copy link

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!

@ThiloteE ThiloteE moved this from Free to take to Reserved in Candidates for University Projects Oct 25, 2023
@ThiloteE ThiloteE moved this from Free to take to Reserved in Good First Issues Oct 25, 2023
@ThiloteE ThiloteE added the FirstTimeCodeContribution Triggers GitHub Greeter Workflow label Oct 25, 2023
@DavidCoy77 DavidCoy77 removed their assignment Oct 27, 2023
@DavidCoy77
Copy link

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.

@ThiloteE ThiloteE moved this from Reserved to Free to take in Candidates for University Projects Oct 27, 2023
@ThiloteE ThiloteE moved this from Reserved to Free to take in Good First Issues Oct 27, 2023
@JabRef JabRef deleted a comment from github-actions bot Oct 27, 2023
@koppor koppor removed the FirstTimeCodeContribution Triggers GitHub Greeter Workflow label Oct 27, 2023
@fyssgo
Copy link

fyssgo commented Oct 28, 2023

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!

@ThiloteE ThiloteE moved this from Free to take to Reserved in Candidates for University Projects Oct 28, 2023
@ThiloteE ThiloteE moved this from Free to take to Reserved in Good First Issues Oct 28, 2023
@ThiloteE ThiloteE added the FirstTimeCodeContribution Triggers GitHub Greeter Workflow label Oct 28, 2023
@JabRef JabRef deleted a comment from github-actions bot Apr 8, 2024
@koppor koppor removed the FirstTimeCodeContribution Triggers GitHub Greeter Workflow label Apr 8, 2024
@koppor koppor moved this from Reserved to Free to take in Candidates for University Projects Apr 8, 2024
@koppor koppor moved this from Reserved to Free to take in Good First Issues Apr 8, 2024
@weronikaulbricht
Copy link

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.

@JorECardenas
Copy link

Hi, I've been working for a bit on this issue and I managed to add the functionalities to drag-and-drop and also copy-paste images on the markdown editor and insert the text in the format, the next challenge is that the way I found to access files is by using "file://" with the absolute path of the image so it ends up looking like this:

Image

For the next part I'm planning to make it so that the markdown editor shows only the image name instead of the full path but then the preview adds the "file://" so it can access the image, there is also a few other details here that maybe aren't inside the scope of the issue but here they are:

  • The images are shown with their actual size so they end up mostly looking too big for the preview pane
  • I'm still not able to check if the image is on the default directory or able to move/copy images that aren't in this directory (for now I'm planning to at least check if the image is on the folder)

So it would help me if you could at least point me in the right direction so I can solve this in the best way possible

@koppor koppor added the 📍 Assigned Assigned by assign-issue-action (or manually assigned) label Oct 16, 2024
@koppor
Copy link
Member Author

koppor commented Oct 16, 2024

* Like the way you can add an image from the website, is this done with the extension or you drag and drop from the web browser on to JabRef?

See step 5 on the issue description: Drag'n'drop from web browser.

Additionally: drag''drop from the file system should also be possible.

When drag'n'drop of a file, the ususal file attachment handling should be made. (which moves the file if it is outside, the functionality is there)

Moreover, I think, it would be good if drag'n'drop from firefox, the file should also be linked. Then, one does not have issues at find-unlinked-files.

* Or does this issue apply to when you copy and paste an image from a website

This is an additional wish, you can also implement that.

*  or also from the file explorer?

This is an additional wish, you can also implement that.

@koppor
Copy link
Member Author

koppor commented Oct 16, 2024

Hi, I've been working for a bit on this issue and I managed to add the functionalities to drag-and-drop and also copy-paste images on the markdown editor and insert the text in the format,

Nice! You can open a PR if you want. It might be hard to discuss things with screenshots only.

the next challenge is that the way I found to access files is by using "file://" with the absolute path of the image so it ends up looking like this:

file:// is wrong.

See how it works in markdown: https://github.com/JabRef/jabref/blob/main/README.md. Click on "Raw" and see

![main table](docs/images/jabref-mainscreen.png)

no file://.

For the next part I'm planning to make it so that the markdown editor shows only the image name instead of the full path

The path needs to be relative. See also the handling of linked files. - Maybe, it is good to re-use the linked files functionality.

but then the preview adds the "file://" so it can access the image, there is also a few other details here that maybe aren't inside the scope of the issue but here they are:

The images are shown with their actual size so they end up mostly looking too big for the preview pane

There is Resizable Image Extension

I'm still not able to check if the image is on the default directory or able to move/copy images that aren't in this directory (for now I'm planning to at least check if the image is on the folder)

org.jabref.logic.util.io.FileUtil#find(java.lang.String, java.util.List<java.nio.file.Path>) is your friend here.

@ThiloteE
Copy link
Member

@JorECardenas even if you have dropped this issue, opening a pull-request would be nice, since you say you have solved the issue at least partially. Other people might pick it up from there.

@JorECardenas
Copy link

JorECardenas commented Nov 15, 2024

Hi, I made the PR draft #12193 of my attempt to add this feature, I hope it is helpful to the next person that works on this issue

@github-actions github-actions bot removed the 📍 Assigned Assigned by assign-issue-action (or manually assigned) label Feb 24, 2025
@koppor koppor moved this from Assigned to Free to take in Good First Issues Feb 25, 2025
@koppor koppor moved this from Assigned to Free to take in Candidates for University Projects Feb 25, 2025
@eslamnumber
Copy link

/assign-me

@koppor
Copy link
Member Author

koppor commented Mar 12, 2025

/assign @eslamnumber

@github-actions github-actions bot added the 📍 Assigned Assigned by assign-issue-action (or manually assigned) label Mar 12, 2025
Copy link
Contributor

👋 Hey @eslamnumber, thank you for your interest in this issue! 🎉

We're excited to have you on board. Start by exploring our Contributing guidelines, and don't forget to check out our workspace setup guidelines to get started smoothly.

In case you encounter failing tests during development, please check our developer FAQs!

Having any questions or issues? Feel free to ask here on GitHub. Need help setting up your local workspace? Join the conversation on JabRef's Gitter chat. And don't hesitate to open a (draft) pull request early on to show the direction it is heading towards. This way, you will receive valuable feedback.

Happy coding! 🚀

⏳ Please note, you will be automatically unassigned if the issue isn't closed within 45 days (by 26 April 2025). A maintainer can also add the "📌 Pinned"" label to prevent automatic unassignment.

@koppor koppor moved this from Free to take to Assigned in Candidates for University Projects Mar 12, 2025
@koppor koppor moved this from Free to take to Assigned in Good First Issues Mar 12, 2025
@koppor koppor added good second issue Issues that involve a tour of two or three interweaved components in JabRef and removed good first issue An issue intended for project-newcomers. Varies in difficulty. labels Mar 12, 2025
@koppor
Copy link
Member Author

koppor commented Mar 12, 2025

Example:

Image

This shows that the "Comment" field supports markdown - and the rendering supports images (theoretically)

Images can also be displayed:

Image

One neesd to investigate how local paths work in that markdown syntax.

One might need to resolve the relative paths to an aboslute one.

                    LinkedFile fileName = files.get(j);
                    Optional<Path> path= fileName.findIn(databaseContext, preferences.getFilePreferences());

eslamnumber added a commit to eslamnumber/jabref that referenced this issue Mar 25, 2025
- Implemented JabRef's download functionality to save images locally.
- Inserted the image link into the comment field next to the cursor.
- Updated 'Find unlinked files' to ignore images referenced in comments.
- Ensured proper image saving in the directory configured for the .bib file.

This fix improves image handling and aligns with expected behavior.
eslamnumber added a commit to eslamnumber/jabref that referenced this issue Mar 25, 2025
@koppor koppor moved this from Assigned to In Progress in Good First Issues Mar 25, 2025
@koppor koppor moved this from Assigned to In Progress in Candidates for University Projects Mar 25, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
📍 Assigned Assigned by assign-issue-action (or manually assigned) component: entry-editor good second issue Issues that involve a tour of two or three interweaved components in JabRef 📌 Pinned
Projects
Status: In Progress
Status: In Progress
10 participants