Make it easier to re-enable user comments. #12440
Conversation
• User comments field now remains visible as long as it contains content. • Improved toggle functionality: users can easily show or hide an empty field using buttons unless the field is disabled in preferences. • If the field contains text, it is displayed automatically, and toggle buttons are hidden to maintain a clean UI. - Made changes to CHANGELOG.md.
…ngs and hide button.
There was a problem hiding this comment.
Your code currently does not meet JabRef's code guidelines.
We use OpenRewrite to ensure "modern" Java coding practices.
The issues found can be automatically fixed.
Please execute the gradle task rewriteRun, check the results, commit, and push.
You can check the detailed error output by navigating to your pull request, selecting the tab "Checks", section "Tests" (on the left), subsection "OpenRewrite".
There was a problem hiding this comment.
JUnit tests are failing. In the area "Some checks were not successful", locate "Tests / Unit tests (pull_request)" and click on "Details". This brings you to the test output.
You can then run these tests in IntelliJ to reproduce the failing tests locally. We offer a quick test running howto in the section Final build system checks in our setup guide.
| Button hideDefaultOwnerCommentButton = new Button(Localization.lang("Hide user-specific comments field")); | ||
| hideDefaultOwnerCommentButton.setOnAction(e -> { | ||
| gridPane.getChildren().removeIf(node -> | ||
| (node instanceof FieldNameLabel fnl && fnl.getText().equals(userSpecificCommentField.getName())) |
There was a problem hiding this comment.
No abbreviations please, "fnl" -> "fieldNameLabel"
There was a problem hiding this comment.
I’ve made the requested change to remove abbreviations. Let me know if anything else is needed!
Enhance User Comments Field Visibility & Accessibility
What Does This PR Do
This PR improves the visibility and accessibility of the user-specific comments field in JabRef.
Prevents unnecessary UI clutter:
If the field contains text, it is always displayed, and the toggle buttons are hidden.
If the field is empty, the toggle buttons appear for user control.
Made changes to the preference settings- renamed "Show user comments field" to "Show user specified comments field" as requested.
Why These Changes
Previously, the user comments field was difficult to manage.
• Issue: Users had to manually re-enable the field via preferences if it was hidden.
• Fix: The field is now automatically restored if it contains content, improving usability.
• Improved UX: Now, users have direct control over visibility without affecting their saved comments.
Closes #11021
Mandatory checks
CHANGELOG.mddescribed in a way that is understandable for the average user (if change is visible to the user)