Skip to content

Make it easier to re-enable user comments. #12440

Merged
Siedlerchr merged 8 commits into
JabRef:mainfrom
11raphael:fix-for-issue-11021
Feb 8, 2025
Merged

Make it easier to re-enable user comments. #12440
Siedlerchr merged 8 commits into
JabRef:mainfrom
11raphael:fix-for-issue-11021

Conversation

@SihasA

@SihasA SihasA commented Feb 2, 2025

Copy link
Copy Markdown
Contributor

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.

  • The user comments field remains visible if it contains text (even if previously hidden).
Screenshot 2025-02-01 at 9 43 10 PM
  • Users can now easily toggle the empty comments field on or off via buttons, unless disabled in preferences.
Screenshot 2025-02-01 at 9 42 10 PM Screenshot 2025-02-01 at 9 42 50 PM
  • 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.

Screenshot 2025-02-02 at 12 44 29 AM

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

  • 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.

	•	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.
@SihasA SihasA marked this pull request as ready for review February 2, 2025 00:59

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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".

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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.

@subhramit subhramit added the status: ready-for-review Pull Requests that are ready to be reviewed by the maintainers label Feb 3, 2025
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()))

@subhramit subhramit Feb 3, 2025

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

No abbreviations please, "fnl" -> "fieldNameLabel"

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I’ve made the requested change to remove abbreviations. Let me know if anything else is needed!

@Siedlerchr Siedlerchr added this pull request to the merge queue Feb 8, 2025
Merged via the queue into JabRef:main with commit e0e7a2f Feb 8, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

status: ready-for-review Pull Requests that are ready to be reviewed by the maintainers

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Make it easier to re-enable user comments

3 participants