Skip to content

Conversation

@shubhamk0205
Copy link

Closes #14143

This PR removes the SmartGroup class and replaces it with ExplicitGroup, as both provided the same functionality. It also resolves an architectural violation by moving the group factory methods from the GUI layer (JabRefSuggestedGroups) into the logic layer (GroupsFactory). Additionally, DefaultGroupsFactory has been renamed to GroupsFactory for improved clarity and naming consistency.

To preserve compatibility, migration logic has been added to ensure that existing .bib files containing serialized SmartGroup entries continue to load correctly and are transparently converted to ExplicitGroup.

Steps to test

  1. Test group creation and functionality

    • Open JabRef and create a new library.
    • Right-click on the All entries group → Add JabRef suggested groups.
    • Verify that:
      • Entries without linked files
      • Entries without groups
        are created successfully.
    • Ensure both groups filter entries as expected.
  2. Test backward compatibility

    • Open a .bib file containing SmartGroup entries (if available).
    • Verify that the groups load correctly and appear in the group tree.
    • Confirm that SmartGroup entries are automatically migrated to ExplicitGroup.
  3. Test “Imported Entries” group

    • Enable Preferences → Library → Add imported entries to group.
    • Import entries using web search, PDF import, or fetchers.
    • Check that imported entries appear in the Imported Entries group.
    • Confirm the group is an ExplicitGroup.
  4. Test general group operations

    • Create, edit, and delete groups.
    • Drag and drop groups in the groups tree.
    • Ensure all group operations behave normally without regressions.

Mandatory checks

  • [/] I own the copyright of the code submitted and I license it under the MIT license
  • [/] I manually tested my changes in running JabRef (always required)
  • [/] I added JUnit tests for changes (if applicable)
  • [/] I added screenshots in the PR description (if the change is visible to the user)
  • [/] I described the change in CHANGELOG.md in a way that is understandable for the average user (if the change is visible to the user)
  • [/] I checked the user documentation: If documentation needs updates, I opened an issue or submitted a PR to https://github.com/JabRef/user-documentation/

@github-actions
Copy link
Contributor

Hey @shubhamk0205!

Thank you for contributing to JabRef! Your help is truly appreciated ❤️

We have automated checks in place, based on which you will soon get feedback if any of them are failing. In a while, maintainers will also review your contribution. Once that happens, you can go through their comments in the "Files changed" tab and act on them, or reply to the conversation if you have further inputs.

Please re-check our contribution guide in case of any other doubts related to our contribution workflow.

}

@Test
void serializeSmartGroup() {
Copy link
Member

@Siedlerchr Siedlerchr Nov 24, 2025

Choose a reason for hiding this comment

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

Please also add a test for the migration of the SmartGroup to the new Explicit groups and ideally roundtrip test.
Reading in old format -> Conversion -> Storing in new format

Copy link
Member

@Siedlerchr Siedlerchr left a comment

Choose a reason for hiding this comment

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

add tests for parsing and roundtrip

@Siedlerchr Siedlerchr added the status: changes-required Pull requests that are not yet complete label Nov 24, 2025
@github-actions github-actions bot removed the status: changes-required Pull requests that are not yet complete label Nov 25, 2025
@shubhamk0205
Copy link
Author

Done with the tests @Siedlerchr

@koppor koppor added the status: ready-for-review Pull Requests that are ready to be reviewed by the maintainers label Nov 26, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

first contrib 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.

Rewrite "Imported Entries" feature

3 participants