koppor / jabref

Collection of simple for JabRef issues. Please submit PRs to https://github.com/jabRef/jabref/.
https://github.com/jabRef/jabref/
MIT License
8 stars 13 forks source link

External changes should show content #624

Closed koppor closed 11 months ago

koppor commented 2 years ago

image

Can we show the two toString reprsentations?

This dialog happens if I create a new library and start working with it.

u7486259 commented 11 months ago

Hi could I work on this task if it is still available?. Thank you!

u7486259 commented 11 months ago

How exactly do I get this dialog to happen? Also could I have little bit more clarification on what is meant by show toString representations as well as what the issue is wanting overall? Thankyou

koppor commented 11 months ago

How exactly do I get this dialog to happen?

  1. Create a new library
  2. Add an entry
  3. Save as A.bib
  4. Right click on Tab, select "library properties"
  5. Click "Apply"
  6. See "The library has been modified by another program"
  7. Click on "Review changes"

As of 2023-11-02, following is shown

image


This is the general way. Now to the concrete one.

Modify A.bib in a text editor

@Comment{jabref-meta: databaseType:biblatex;}

Save

Now, JabRef goes back to step 6

It shows

image

So, no "mode" is no issue any more.

Now, let's try save actions

Modify to

image

(Just activate save actions)

This does not work any more

After apply and save, it is not activated any more

image

Can you investigate now that you know the UI?

Hint: with Ctrl+Shift+F you can search for a string.

JamesZhang11 commented 11 months ago

Hi, @koppor and @u7486259 Although it might be a bit abrupt, I'd like to ask both of you if you'd mind if I pull this issue to my local environment to give it a try. I am a newbie undergraduate student, and this is one of the few projects I can somewhat understand. It seems it has already been reserved for AAA, but I still hope to get a chance to try it in the coming period.

JamesZhang11 commented 11 months ago

Hi, @koppor, would you mind giving me some instructions for which part of the code should I go to figure out the issue.

JamesZhang11 commented 11 months ago

Hi, @koppor , I am concerning the following classes D:\git_project\jabref\src\main\java\org\jabref\gui\preferences\export\ExportTabViewModel.java D:\git_project\jabref\src\main\java\org\jabref\gui\commonfxcontrols\FieldFormatterCleanupsPanel.java D:\git_project\jabref\src\main\java\org\jabref\logic\cleanup\FieldFormatterCleanups.java D:\git_project\jabref\src\main\java\org\jabref\gui\cleanup\CleanupPresetPanel.java

Based on the mentioned packages, when I synchronize the preferences in the database, the subsequent synchronization to the panel's view model should also be the same. Therefore, there shouldn't be a situation where checking an option results in a reset. I want to know if there's an initialization of some settings when I externally modify the .bib file. Could you point me to the relevant code location (the code dealing with external changes)? Thank you for your guidance.

koppor commented 11 months ago

@u7486259 is assigned so I wait for him a few days to raise their voice whether they work on it.

Nevertheless, I gave hints to you @JamesZhang11, maybe, they are helpful to @u7486259, too.

@JamesZhang11 Unfortunately, you are on the wrong path. None of the code is used at the dialog. - The issue is NOT about the functionality of the formatters themselves, but about the META information...

If you can't find the code for the dialog and the data structures used there, I would recommend to check some issue from our board at https://github.com/orgs/JabRef/projects/3/views/3 and continue there.

JamesZhang11 commented 11 months ago

@koppor Hi, Kopper, thank you for your response. You're right, I'm a beginner. After examining the packages I found through related keywords and not identifying the issue, I sought your guidance. I appreciate your advice and response. I hope this won't disturb you.

koppor commented 11 months ago

The data is read in org.jabref.gui.collab.metedatachange.MetadataChangeDetailsView. Ctrl+click on MetadataChangeDetailsView leads you to the call. One needs to step through and search.

This issue is a hard one since one needs to understand how meta data is read and written. Some code is in org.jabref.logic.exporter.MetaDataSerializer and org.jabref.logic.importer.util.MetaDataParser. You can check the tests (using Ctrl+Shift+T to navigate to the tests.

As described at https://github.com/koppor/jabref/issues/624#issuecomment-1775019525, there is an issue with saving the save actions.

After re-checking, the issue seems to be solved: The contents are shown. There are other issues, but they are handled in other issue descriptions.


As of 2023-11-02

image

JamesZhang11 commented 11 months ago

Thank you for pointing out the facts. It seems I misunderstood what Koppor meant. At first, I checked 'change' and found it was displayed. I mistakenly thought from the information Koppor screenshot for AAA that you guys hoped that after modifying the external file and getting it approved, when I check the 'enable field formatter', the next time I open 'save action', it should still be checked. Thank you for the correction, and I wish you all the best.