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

Add "Add JabRef suggested groups" #12746

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

Conversation

gepetton
Copy link
Contributor

Closes (#12659)

This PR resolves #12659 by adding a "Add JabRef suggested groups" option to the "All entries" context menu, which appends the groups "Entries without linked files" and "Entries without groups" to the list if they don’t already exist, and disables the option when both are present; it includes the logic and UI implementation, unit tests covering all cases (no groups, one group, both existing), and an update to CHANGELOG.md .

스크린샷 2025-03-16 오후 6 14 34 스크린샷 2025-03-16 오후 6 16 32 스크린샷 2025-03-16 오후 6 16 08

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.

Add new feature to automatically create useful suggested groups:
- "Entries without linked files" group to find entries missing file attachments
- "Entries without groups" group to find entries not assigned to any group

The feature is accessible through context menu on the "All entries" group.

Add comprehensive test cases that verify:
- Groups are correctly created with search expressions "file !=~.*" and "groups !=~.*"
- Duplicate groups are not created when the feature is used multiple times
- Only missing groups are added when some suggested groups already exist
- Both scenarios are tested: adding missing "files" group and missing "groups" group
- Changes are properly written to metadata
- Selected groups are updated after adding suggested groups

Add required localization strings to support this feature.
Add new feature to automatically create useful suggested groups:
- "Entries without linked files" group to find entries missing file attachments
- "Entries without groups" group to find entries not assigned to any group

The feature is accessible through context menu on the "All entries" group.

Add comprehensive test cases that verify:
- Groups are correctly created with search expressions "file !=~.*" and "groups !=~.*"
- Duplicate groups are not created when the feature is used multiple times
- Only missing groups are added when some suggested groups already exist
- Both scenarios are tested: adding missing "files" group and missing "groups" group
- Changes are properly written to metadata
- Selected groups are updated after adding suggested groups

Add required localization strings to support this feature.
Copy link

trag-bot bot commented Mar 16, 2025

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

@@ -205,7 +207,7 @@ public void addSuggestedSubGroup(GroupNodeViewModel parent) {

if (!hasEntriesWithoutFiles) {
SearchGroup withoutFilesGroup = new SearchGroup(
Localization.lang("Entries without linked files"),
Localization.lang(ENTRIES_WITHOUT_LINKED_FILES),
Copy link
Member

Choose a reason for hiding this comment

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

@gepetton gepetton marked this pull request as ready for review March 16, 2025 12:27
@gepetton
Copy link
Contributor Author

I’ve fixed it as you suggested. Thanks a lot for your help, @Siedlerchr!!

@gepetton gepetton requested a review from Siedlerchr March 16, 2025 18:53
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.

Add "Add JabRef suggested groups"
2 participants