-
-
Notifications
You must be signed in to change notification settings - Fork 2.9k
Keyword Tooltip/Cleanup for MSC codes added to Keyword Editor #12914
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
Conversation
@@ -50,6 +55,8 @@ public class KeywordsEditor extends HBox implements FieldEditorFX { | |||
private static final Logger LOGGER = LoggerFactory.getLogger(KeywordsEditor.class); | |||
private static final PseudoClass FOCUSED = PseudoClass.getPseudoClass("focused"); | |||
|
|||
private Map<String, String> mscmap = MscCodeUtils.loadMscCodesFromJson("../../resources/main/org/jabref/gui/fieldeditors/msccodes/msc_codes.json"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This won't work inside a jar, you need to use class.getResource
…to ktooltip updates from jabref main
src/main/java/org/jabref/gui/fieldeditors/msccodes/MscCodeUtils.java
Outdated
Show resolved
Hide resolved
…to ktooltip pulling changes from main to local
Please fix the failing tests before. This reduces the burden of us maintainers to review incomplete PRs |
src/main/java/org/jabref/gui/fieldeditors/msccodes/MscCodeUtils.java
Outdated
Show resolved
Hide resolved
…iptions, bug: error when trying to cleanup when editor is open
…er and special characters were added
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The logic seems to require a JavaFX thread. This must not happen.
Logic should be able to run in a jar file without any gui.
jablib/src/test/java/org/jabref/logic/cleanup/ConvertMSCCodesCleanupTest.java
Outdated
Show resolved
Hide resolved
jablib/src/test/java/org/jabref/logic/cleanup/ConvertMSCCodesCleanupTest.java
Outdated
Show resolved
Hide resolved
jablib/src/main/resources/msc2020.pdf needs to be places in |
Co-authored-by: Oliver Kopp <[email protected]>
jablib/src/main/java/org/jabref/logic/cleanup/CleanupWorker.java
Outdated
Show resolved
Hide resolved
jablib/src/main/java/org/jabref/logic/cleanup/CleanupWorker.java
Outdated
Show resolved
Hide resolved
Does this directory exist? jablib/src/misc/ does not exist even after updating my branch with the latest. |
You will need to create it. |
@koppor I believe I fixed everything from what we've discussed. |
@trag-bot didn't find any issues in the code! ✅✨ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good - I think, more things can be added follow-up
I am not sure if we should move the conversion to a real formatter -- the idea of the formatters is exactly that what the the current code does.
I know the UX is bad for the formatters, but with the current implementation, the UI gets even more cluttered.
In other words: The contents in "Miscellaneous" are working multi-field, whereas "field formatters" work single field
The original feature/issue requested a cleanup or button. I can look into this over the coming weekend.On May 27, 2025, at 1:22 AM, Oliver Kopp ***@***.***> wrote:
@koppor requested changes on this pull request.
Looks good - I think, more things can be added follow-up
I am not sure if we should move the conversion to a real formatter -- the idea of the formatters is exactly that what the the current code does.
I know the UX is bad for the formatters, but with the current implementation, the UI gets even more cluttered.
In other words: The contents in "Miscellaneous" are working multi-field, whereas "field formatters" work single field
image.png (view on web)
—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you modified the open/close state.Message ID: ***@***.***>
|
I found #12944 (comment). This talks about a button at the keyword field. Should be shown only if any of the keywords is an MSC keyword. It also talked about a cleanup operation, which I commented using the screenshot 😅 Sorry that we did not unzip the text of that comment.
Nice! Thank you in advance! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this is okay right now and we can do the reworking of the abbrev stuff in another follow up pr
// Add active jobs from preset panel | ||
for (CleanupPreferences.CleanupStep action : preset.getActiveJobs()) { | ||
jobs.add(toJob(action)); | ||
jobs.add(toJob(action)); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reads like AI-modified content.
--> indent is wrong and comment could be removed
Could also be done in a follow-up PR
I filed #13227. @JustinHennis1 You can take it or we hope that someone else takes it. |
I have the FieldFormatter implemented locally, I just need to remove the cleanup and change the tests. Would the easiest way be to create a new fork on Github? I don't want to lose the changes I made. |
Closes #12944
Created a JSON file to hold key-value pairs of MSC codes to their respective descriptions/classifications by parsing msc_2020.pdf (which was provided in link to zbmath).
Created MscCodeUtils.java class that implements a method to load a JSON file and converts said file into a Map object.
Created ConvertMSCCodesCleanupTest.java, added to panel, and when user selects preference to convert and saves, the codes are converted to descriptions. Alternatively, when unselected, descriptions are reverted back to code.
In KeywordsEditor.java I added a private variable, mscmap, that calls the above method. Using this map object, I added a condition in the create tag method to check if the label text matches any of the keys. If it does, then we initialize a Tooltip and call install onMouseEnter and uninstall onMouseExited.
ToolTip
Cleanup
Before:
After:
Mandatory checks
CHANGELOG.md
described in a way that is understandable for the average user (if change is visible to the user)