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

Refresh button for LaTeX citations #10584

Closed
koppor opened this issue Oct 25, 2023 · 8 comments · Fixed by #10901
Closed

Refresh button for LaTeX citations #10584

koppor opened this issue Oct 25, 2023 · 8 comments · Fixed by #10901
Assignees
Labels
FirstTimeCodeContribution Triggers GitHub Greeter Workflow good first issue An issue intended for project-newcomers. Varies in difficulty.

Comments

@koppor
Copy link
Member

koppor commented Oct 25, 2023

The LaTeX citations are NOT backed by our file monitor.

Quick win: Add a "refresh" button:

a

The button then first sets latexParserResult to null and then calls org.jabref.gui.entryeditor.LatexCitationsTabViewModel#init.

For the button implementation inspiration see #10580

@koppor koppor added the good first issue An issue intended for project-newcomers. Varies in difficulty. label Oct 25, 2023
@taliashark77
Copy link

@koppor may I try this issue for my university assignment?

@koppor koppor added the FirstTimeCodeContribution Triggers GitHub Greeter Workflow label Oct 26, 2023
@github-actions
Copy link
Contributor

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.

@taliashark77
Copy link

Hi @koppor thanks for assigning me this issue, I just have a few questions about this task, any answers would be great. Firstly, is the purpose of the refresh button to give a quick fix to problems caused by the LaTeX citations not having a file monitor? Secondly, for setting the latexParserResult to null would creating a private setter method (to set to null specifically) in LatexCitationsViewModel an acceptable approach? Lastly, for calling init on the model after this has been done I need the current BibEntry, is there a way of retrieving this information? Thanks

@koppor
Copy link
Member Author

koppor commented Oct 28, 2023

Firstly, is the purpose of the refresh button to give a quick fix to problems caused by the LaTeX citations not having a file monitor?

Yes. (The "full" solution is #10585. I think, that solution is very difficult; and we need something working the next days/weeks)

Secondly, for setting the latexParserResult to null would creating a private setter method (to set to null specifically) in LatexCitationsViewModel an acceptable approach?

I analyzed org.jabref.gui.entryeditor.LatexCitationsTabViewModel#searchAndParse, which is called when the tab is displayed. -- If you come up with something better, please let us know.

Lastly, for calling init on the model after this has been done I need the current BibEntry, is there a way of retrieving this information?

I don't understand the question. The current BibEntry is stored in the variable currentEntry in the method init(BibEntry). Thus, you should have access in the class... -- Nevertheless, I do not know, why you need that -- You should have a ViewModel at hand at the button...

@taliashark77
Copy link

Thank you for your guidance, I have now implemented a button which when clicked refreshes. I have only tested it by adding entries to my libraries and then loading up the LaTeX citations tab, then when I click refresh it seems to reload. Would you be able to point me in the right direction for testing it more extensively? Would it be best to use a UI, mocking or JUNIT test?

@koppor
Copy link
Member Author

koppor commented Oct 29, 2023

Quick repy: have a .tex document ready. Add cite of entry1. Navigate to entry1 in JabRef. In .tex add cite to entry2. Save. In JabRef go to entry2. Check citations tab. Should be empty. Click on refresh, then the cite in the .tex should be shown.

entry1 and entry2 need to be created in JabRef.

I think, ChatGPT can generate you a .tex document if you are unware of LaTeX.

No need for a full tex installation since JabRef parses .tex in this case.

Automated tests: Difficult one. You can try with TestFX. Huge effort as we dont have good UI test examles. General testing hints are available at https://devdocs.jabref.org/code-howtos/testing.html

@AbdAlRahmanGad
Copy link
Contributor

@koppor Hi, since I think the assignee is not working on this issue anymore, can I work on this issue?

@ThiloteE
Copy link
Member

Yes @AbdAlRahmanGad, I will assign you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
FirstTimeCodeContribution Triggers GitHub Greeter Workflow good first issue An issue intended for project-newcomers. Varies in difficulty.
Projects
Development

Successfully merging a pull request may close this issue.

4 participants