Skip to content

Added a setting to show File annotations' tab only when the PDF actually contains highlights or comments #13279

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

Merged
merged 4 commits into from
Jun 11, 2025

Conversation

ZodGaz
Copy link
Contributor

@ZodGaz ZodGaz commented Jun 8, 2025

Closes #13143

added a checkbox as described in the issue to not show the file annotation tab when annotations are not present in the entry files.

Steps to test

Screen.Recording.2025-06-08.at.18.25.17.mov

Mandatory checks

  • I own the copyright of the code submitted and I license 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 (if change is visible to the user)
  • 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.

ZodGaz added 2 commits June 8, 2025 18:39
… show the file annotation tab when annotations are not present in the entry files.
@@ -161,6 +164,18 @@ public void setShouldShowLatexCitationsTab(boolean shouldShowLatexCitationsTab)
this.shouldShowLatexCitationsTab.set(shouldShowLatexCitationsTab);
}

public boolean shouldShowFileAnnotationsTab() {
Copy link

Choose a reason for hiding this comment

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

The method should return an Optional instead of a primitive boolean to avoid returning null and adhere to modern Java practices.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

is that really necessary?I don't think it could ever return a null value

Copy link
Member

Choose a reason for hiding this comment

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

Take the comments with a grain of salt. In this case the bot is wrong

Comment on lines +29 to +30
public FileAnnotationTab(StateManager stateManager,
GuiPreferences preferences) {
Copy link

Choose a reason for hiding this comment

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

The constructor should not allow null values for 'stateManager' and 'preferences'. Consider using JSpecify @nonnull annotations to enforce non-null parameters.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

is that really necessary?

Copy link
Member

Choose a reason for hiding this comment

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

no

@Siedlerchr Siedlerchr added this pull request to the merge queue Jun 11, 2025
Merged via the queue into JabRef:main with commit c68cb5f Jun 11, 2025
41 checks passed
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.

Show/hide 'File annotations' tab
2 participants