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

On clicking on the symbol in the consistency check results table select the respective field #12658

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

priyanshu16095
Copy link
Contributor

@priyanshu16095 priyanshu16095 commented Mar 9, 2025

Refers to JabRef/blog.jabref.org#109 (comment)

This PR ensures that clicking on a symbol in the Consistency Check Results table navigates to the Entry Editor for the corresponding field.

Mandatory checks

  • I own the copyright of the code submitted and I licence it under the MIT license
  • Change in CHANGELOG.md described in a way that is understandable for the average user (if change is visible to the user)
  • Tests created for changes (if applicable)
  • Manually tested changed features in running JabRef (always required)
  • Screenshots added in PR description (for UI changes)
  • Checked developer's documentation: Is the information available and up to date? If not, I outlined it in this pull request.
  • Checked documentation: Is the information available and up to date? If not, I created an issue at https://github.com/JabRef/user-documentation/issues or, even better, I submitted a pull request to the documentation repository.

@priyanshu16095
Copy link
Contributor Author

priyanshu16095 commented Mar 9, 2025

Recording.2025-03-09.mp4

There is one problem with it: it works fine and correctly checks if the field exists in the Entry Editor, but for some fields, it behaves unexpectedly by opening the AI Chat tab.
Could this be a bug in libraryTab.editEntryAndFocusField() ?

@subhramit subhramit requested a review from InAnYan March 9, 2025 16:52
@priyanshu16095 priyanshu16095 changed the title Symbol in the consistency check results table selection the respective field On clicking on the symbol in the consistency check results table select the respective field Mar 9, 2025
@InAnYan
Copy link
Member

InAnYan commented Mar 10, 2025

Don't want to bring bad news, but for me this doesn't work at all...

  • It doesn't go to many fields that are actually present.
  • Often it goes to a wrong field.
  • Yeah, quite often it goes to AI tab, but then it won't go to other fields.

Okay, after recheck, some columns are working. Columns that don't work:

  • citationkey.
  • archiveprefix -- yeah, sometimes it goes to AI tab.
  • comment.
  • copyright.
  • hal_id.
  • hal_version.

One of the biggest problems I'm having is that when it goes to AI tab, after closing the "Consistency check", I can't switch to other editing tab

@@ -1035,6 +1035,7 @@ required\ field\ is\ present=required field is present
optional\ field\ is\ present=optional field is present
unknown\ field\ is\ present=unknown field is present
field\ is\ absent=field is absent
Field\ does\ not\ exist\ in\ the\ editor!=Field does not exist in the editor!
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Avoid exclamation marks at the end of a sentence. They are more for screaming. Use a dot to end the sentence.

@koppor
Copy link
Member

koppor commented Mar 11, 2025

Could this be a bug in libraryTab.editEntryAndFocusField() ?

At org.jabref.gui.integrity.IntegrityCheckDialog#onSelectionChanged, we are also using that method.

org.jabref.gui.entryeditor.EntryEditor#setFocusToField looks right.

Maybe you need to add LOGGER.trace statements and increase the log elvel at tinylog.properties. See https://devdocs.jabref.org/code-howtos/logging.html for details.

You can leave LOGGER.trace statements in - and just remove the tinylog.properties configuraiton.

@koppor
Copy link
Member

koppor commented Mar 11, 2025

Don't want to bring bad news, but for me this doesn't work at all...

Is there a library which can be checked? Chocolate.bib? complex.bib?

@priyanshu16095
Copy link
Contributor Author

https://github.com/JabRef/jabref/blob/main/src/main/java/org/jabref/gui/consistency/ConsistencyCheckDialog.java#L182

Just a thought, we can use the Singleton design pattern instead of creating a new ConsistencySymbolsDialog every time the button is clicked.

@priyanshu16095
Copy link
Contributor Author

priyanshu16095 commented Mar 16, 2025

Recording.2025-03-16.mp4

It can be checked on Choclate.bib.
It works fine for all the columns in Choclate.bib.
It only works for StandardField and shows unexpected behavior when the field does not exist in the entry editor, such as booktitle

@koppor
Copy link
Member

koppor commented Mar 16, 2025

You mean the "Field does not exist in the editor!" error message? (I needed to make screenshots to see it in my firefox video player)

image

If a field does not exist in the entry editor is a WTF thing. Something is wrong in the code then. -- Unknown fields are gathered in the "Other fields" tab - for each field present in BibEntry data structure, there is an entry editor. The only issue I can think of that "field aliasses" are not properly handled.

booktitle exists at @inproceedings:

image

If one has @article, it goes to "Other fields":

image

@priyanshu16095
Copy link
Contributor Author

priyanshu16095 commented Mar 17, 2025

Yeah, I mean to say that the aliases does not exist.
I wil fix this.

@priyanshu16095
Copy link
Contributor Author

priyanshu16095 commented Mar 17, 2025

It works fine, "field does not exist" means when the entire column Booktitle has same value - means field is absent, and it is also not present in the other fields tab.
This will not occur becuase coumns with uniform value are removed in a recent PR.

image

Please try on Chocolate.bib or after pulling the latest changes.

@priyanshu16095
Copy link
Contributor Author

The check fails because I cannot use any link to the issue, as it is a follow-up to the feature.

Copy link

trag-bot bot commented Mar 17, 2025

@trag-bot didn't find any issues in the code! ✅✨

Copy link
Contributor

Your pull request conflicts with the target branch.

Please merge upstream/main with your code. For a step-by-step guide to resolve merge conflicts, see https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/addressing-merge-conflicts/resolving-a-merge-conflict-using-the-command-line.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants