Skip to content

Automatic Grouping By Entry Type#15081

Merged
Siedlerchr merged 7 commits into
JabRef:mainfrom
alxafan:fix-for-issue-15040
Feb 13, 2026
Merged

Automatic Grouping By Entry Type#15081
Siedlerchr merged 7 commits into
JabRef:mainfrom
alxafan:fix-for-issue-15040

Conversation

@alxafan

@alxafan alxafan commented Feb 10, 2026

Copy link
Copy Markdown
Contributor

Closes #15040

Added the option to group entries by entry type
Modified the group dialog window to accommodate for the new option and implemented the necessary logic

Steps to test

  1. Open or create a library with entries of multiple types
  2. Add a new group and select the option "Entry type"
  3. Check if all existing entries are assigned to a subgroup in accordance with their type
Screenshot From 2026-02-10 14-18-45 Screenshot From 2026-02-10 14-20-43 image

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 change is visible to the user)
  • I added a screenshot in the PR description showing a library with a single entry with me as author and as title the issue number.
  • I described the change in CHANGELOG.md in a way that is understandable for the average user (if change is visible to the user)
  • I checked the user 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 updating file(s) in https://github.com/JabRef/user-documentation/tree/main/en.

@github-actions

Copy link
Copy Markdown
Contributor

Hey @alxafan! 👋

Thank you for contributing to JabRef!

We have automated checks in place, based on which you will soon get feedback if any of them are failing. We also use Qodo for review assistance. It will update your pull request description with a review help and offer suggestions to improve the pull request.

After all automated checks pass, a maintainer 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. You can read about the whole pull request process in our contribution guide.

Please ensure that your pull request is in line with our AI Usage Policy and make necessary disclosures.

@qodo-free-for-open-source-projects

Copy link
Copy Markdown
Contributor

Review Summary by Qodo

Add entry type grouping feature for automatic group creation
✨ Enhancement

Grey Divider

Walkthroughs

Description
• Added ability to group entries by entry type automatically
• Implemented new AutomaticEntryTypeGroup and EntryTypeGroup classes
• Added UI radio button option in GroupDialog for entry type grouping
• Updated group management logic to handle entry type groups
Diagram
flowchart LR
  A["User selects Entry Type<br/>in GroupDialog"] --> B["GroupDialogViewModel<br/>creates AutomaticEntryTypeGroup"]
  B --> C["AutomaticEntryTypeGroup<br/>creates subgroups by type"]
  C --> D["EntryTypeGroup instances<br/>filter entries by type"]
  D --> E["Entries organized<br/>by entry type"]
Loading

Grey Divider

File Changes

1. jabgui/src/main/java/org/jabref/gui/groups/GroupDialogView.java ✨ Enhancement +2/-0

Added entry type radio button to group dialog

jabgui/src/main/java/org/jabref/gui/groups/GroupDialogView.java


2. jabgui/src/main/java/org/jabref/gui/groups/GroupDialogViewModel.java ✨ Enhancement +10/-0

Implemented entry type grouping logic and property binding

jabgui/src/main/java/org/jabref/gui/groups/GroupDialogViewModel.java


3. jabgui/src/main/java/org/jabref/gui/groups/GroupNodeViewModel.java ✨ Enhancement +15/-2

Added entry type group handling to group operations

jabgui/src/main/java/org/jabref/gui/groups/GroupNodeViewModel.java


View more (6)
4. jablib/src/main/java/org/jabref/model/groups/AutomaticEntryTypeGroup.java ✨ Enhancement +25/-0

Created automatic entry type group implementation

jablib/src/main/java/org/jabref/model/groups/AutomaticEntryTypeGroup.java


5. jablib/src/main/java/org/jabref/model/groups/EntryTypeGroup.java ✨ Enhancement +55/-0

Created entry type group model with matching logic

jablib/src/main/java/org/jabref/model/groups/EntryTypeGroup.java


6. jablib/src/test/java/org/jabref/model/groups/AutomaticEntryTypeGroupTest.java 🧪 Tests +57/-0

Added comprehensive tests for entry type grouping

jablib/src/test/java/org/jabref/model/groups/AutomaticEntryTypeGroupTest.java


7. jabgui/src/main/resources/org/jabref/gui/groups/GroupDialog.fxml ✨ Enhancement +6/-0

Added entry type radio button to FXML layout

jabgui/src/main/resources/org/jabref/gui/groups/GroupDialog.fxml


8. jablib/src/main/resources/l10n/JabRef_en.properties 📝 Documentation +1/-0

Added localization string for entry type grouping

jablib/src/main/resources/l10n/JabRef_en.properties


9. CHANGELOG.md 📝 Documentation +1/-1

Documented new entry type grouping feature

CHANGELOG.md


Grey Divider

Qodo Logo

@github-actions github-actions Bot added the good first issue An issue intended for project-newcomers. Varies in difficulty. label Feb 10, 2026
@alxafan alxafan changed the title Fix for issue 15040 Automatic Grouping By Entry Type Feb 10, 2026
@qodo-free-for-open-source-projects

Copy link
Copy Markdown
Contributor

Code Review by Qodo

🐞 Bugs (2) 📘 Rule violations (1) 📎 Requirement gaps (0)

Grey Divider


Action required

1. EntryType group not persisted 🐞 Bug ⛯ Reliability
Description
AutomaticEntryTypeGroup can be created via the UI, but the metadata group serializer/parser do not
recognize it. This will either crash on save (unsupported serialization) or fail to reload the group
tree (unknown group type), risking loss of group configuration.
Code

jabgui/src/main/java/org/jabref/gui/groups/GroupDialogViewModel.java[R389-390]

+            } else if (Boolean.TRUE.equals((typeEntryTypeProperty.getValue()))) {
+                resultingGroup = new AutomaticEntryTypeGroup(groupName, groupHierarchySelectedProperty.getValue());
Evidence
The UI creates AutomaticEntryTypeGroup, and saving groups always runs GroupSerializer over the tree.
GroupSerializer has a closed switch and throws for unknown group classes; GroupsParser similarly
throws for unknown group IDs; and there is no serialization ID constant for this new group type.

jabgui/src/main/java/org/jabref/gui/groups/GroupDialogViewModel.java[379-392]
jablib/src/main/java/org/jabref/logic/exporter/MetaDataSerializer.java[144-154]
jablib/src/main/java/org/jabref/logic/exporter/GroupSerializer.java[113-135]
jablib/src/main/java/org/jabref/logic/importer/util/GroupsParser.java[104-137]
jablib/src/main/java/org/jabref/logic/util/MetadataSerializationConfiguration.java[14-40]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

### Issue description
`AutomaticEntryTypeGroup` is creatable in the GUI, but it is not supported by the groups metadata persistence layer. This will break saving/loading group trees.

### Issue Context
JabRef persists groups via `MetaDataSerializer.serializeGroups(...)` which calls `GroupSerializer.serializeTree(...)`. Loading uses `GroupsParser.fromString(...)` keyed by `MetadataSerializationConfiguration` IDs.

### Fix Focus Areas
- jablib/src/main/java/org/jabref/logic/util/MetadataSerializationConfiguration.java[14-40]
- jablib/src/main/java/org/jabref/logic/exporter/GroupSerializer.java[113-195]
- jablib/src/main/java/org/jabref/logic/importer/util/GroupsParser.java[102-210]
- jablib/src/test/java/org/jabref/logic/exporter/GroupSerializerTest.java[113-156]
- jablib/src/test/java/org/jabref/logic/importer/util/GroupsParserTest.java[116-178]

### Notes on expected implementation
- Introduce something like `AUTOMATIC_ENTRY_TYPE_GROUP_ID = &quot;AutomaticEntryTypeGroup:&quot;`.
- Serialization format can mirror other `Automatic*Group` formats: `id + name + context + groupDetails` (expanded/color/icon/description).
- Parser should tokenize `name` and `context`, instantiate `new AutomaticEntryTypeGroup(name, context)`, then apply `addGroupDetails(...)`.
- Add unit tests for serialize + parse roundtrip for the new type.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools



Remediation recommended

2. Title-case %Entry Type label 📘 Rule violation ✓ Correctness
Description
The new group type radio button uses a title-case UI label (%Entry Type) while JabRef UI texts
should be sentence case. This creates inconsistent UI wording and violates the localization
conventions requirement.
Code

jabgui/src/main/resources/org/jabref/gui/groups/GroupDialog.fxml[R102-106]

+                    <RadioButton fx:id="entryTypeRadioButton" toggleGroup="$type" wrapText="true"
+                                 text="%Entry Type">
+                        <tooltip>
+                            <Tooltip text="%Automatically create groups by entry type"/>
+                        </tooltip>
Evidence
PR Compliance ID 20 requires sentence-case UI texts and consistent localization conventions. The
added RadioButton label uses %Entry Type (title case) instead of sentence case (e.g., the existing
localization key Entry type).

AGENTS.md
jabgui/src/main/resources/org/jabref/gui/groups/GroupDialog.fxml[102-106]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
The newly added group type radio button label uses title case (`%Entry Type`) but UI texts should be sentence case per JabRef localization conventions.

## Issue Context
`JabRef_en.properties` already contains a sentence-case key `Entry type`, which can be reused for this label.

## Fix Focus Areas
- jabgui/src/main/resources/org/jabref/gui/groups/GroupDialog.fxml[102-106]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


3. EntryTypeGroup switch coverage 🐞 Bug ⛯ Reliability
Description
EntryTypeGroup nodes are introduced as dynamic subgroups, but not all GUI capability switches
explicitly cover this new class. While currently unlikely to be hit in DnD (because these nodes are
not part of the persisted group tree), adding an explicit EntryTypeGroup branch avoids future
UnsupportedOperationExceptions and keeps behavior consistent with other dynamic subgroup types.
Code

jablib/src/main/java/org/jabref/model/groups/AutomaticEntryTypeGroup.java[R14-19]

+    @Override
+    public Set<GroupTreeNode> createSubgroups(BibEntry entry) {
+        EntryType type = entry.getType();
+        return Set.of(new GroupTreeNode(new EntryTypeGroup(type.getName(),
+                GroupHierarchyType.INDEPENDENT, type)));
+    }
Evidence
AutomaticEntryTypeGroup dynamically creates EntryTypeGroup nodes. GroupNodeViewModel uses a switch
with a throwing default in canBeDragged(), and it currently has no EntryTypeGroup case, so if
EntryTypeGroup ever reaches this method (e.g., via future changes making these nodes part of the
mutable group tree), it will throw.

jablib/src/main/java/org/jabref/model/groups/AutomaticEntryTypeGroup.java[14-19]
jabgui/src/main/java/org/jabref/gui/groups/GroupNodeViewModel.java[476-501]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

### Issue description
`EntryTypeGroup` is newly introduced, but not all GUI switch statements explicitly handle it. `canBeDragged()` has a throwing default and no `EntryTypeGroup` case.

### Issue Context
`EntryTypeGroup` instances are created dynamically as children of `AutomaticEntryTypeGroup`. Even if today these nodes are not part of the persisted group tree, explicit handling prevents future regressions and aligns with how other dynamic subgroup types are guarded.

### Fix Focus Areas
- jabgui/src/main/java/org/jabref/gui/groups/GroupNodeViewModel.java[476-501]

### Suggested change
- Add `case EntryTypeGroup _ -&gt; false;` (and consider `DateGroup _ -&gt; false;` for consistency) to avoid `UnsupportedOperationException` from the default branch.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


Grey Divider

ⓘ The new review experience is currently in Beta. Learn more

Grey Divider

Qodo Logo

Comment on lines +389 to +390
} else if (Boolean.TRUE.equals((typeEntryTypeProperty.getValue()))) {
resultingGroup = new AutomaticEntryTypeGroup(groupName, groupHierarchySelectedProperty.getValue());

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.

Action required

1. Entrytype group not persisted 🐞 Bug ⛯ Reliability

AutomaticEntryTypeGroup can be created via the UI, but the metadata group serializer/parser do not
recognize it. This will either crash on save (unsupported serialization) or fail to reload the group
tree (unknown group type), risking loss of group configuration.
Agent Prompt
### Issue description
`AutomaticEntryTypeGroup` is creatable in the GUI, but it is not supported by the groups metadata persistence layer. This will break saving/loading group trees.

### Issue Context
JabRef persists groups via `MetaDataSerializer.serializeGroups(...)` which calls `GroupSerializer.serializeTree(...)`. Loading uses `GroupsParser.fromString(...)` keyed by `MetadataSerializationConfiguration` IDs.

### Fix Focus Areas
- jablib/src/main/java/org/jabref/logic/util/MetadataSerializationConfiguration.java[14-40]
- jablib/src/main/java/org/jabref/logic/exporter/GroupSerializer.java[113-195]
- jablib/src/main/java/org/jabref/logic/importer/util/GroupsParser.java[102-210]
- jablib/src/test/java/org/jabref/logic/exporter/GroupSerializerTest.java[113-156]
- jablib/src/test/java/org/jabref/logic/importer/util/GroupsParserTest.java[116-178]

### Notes on expected implementation
- Introduce something like `AUTOMATIC_ENTRY_TYPE_GROUP_ID = "AutomaticEntryTypeGroup:"`.
- Serialization format can mirror other `Automatic*Group` formats: `id + name + context + groupDetails` (expanded/color/icon/description).
- Parser should tokenize `name` and `context`, instantiate `new AutomaticEntryTypeGroup(name, context)`, then apply `addGroupDetails(...)`.
- Add unit tests for serialize + parse roundtrip for the new type.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools

@github-actions github-actions Bot added the status: changes-required Pull requests that are not yet complete label Feb 10, 2026
@github-actions github-actions Bot added status: no-bot-comments and removed status: changes-required Pull requests that are not yet complete labels Feb 10, 2026
@testlens-app

testlens-app Bot commented Feb 10, 2026

Copy link
Copy Markdown

✅ All tests passed ✅

🏷️ Commit: 5702f2e
▶️ Tests: 11192 executed
⚪️ Checks: 62/62 completed


Learn more about TestLens at testlens.app.

@Siedlerchr Siedlerchr added the status: ready-for-review Pull Requests that are ready to be reviewed by the maintainers label Feb 13, 2026

@Siedlerchr Siedlerchr left a comment

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.

Works!

@Siedlerchr Siedlerchr enabled auto-merge February 13, 2026 19:11
@Siedlerchr

Copy link
Copy Markdown
Member

Thanks for your contribution! Looking forward to seeing more from you :)

@Siedlerchr Siedlerchr added this pull request to the merge queue Feb 13, 2026
@github-actions github-actions Bot added the status: to-be-merged PRs which are accepted and should go into the merge-queue. label Feb 13, 2026
Merged via the queue into JabRef:main with commit e0f3bea Feb 13, 2026
62 checks passed
Siedlerchr added a commit to faneeshh/jabref that referenced this pull request Feb 14, 2026
* upstream/main:
  Refine Automatic Field Editor filtering logic (fixes JabRef#15066) (JabRef#15094)
  Output URL to workflow
  Fix token
  Refine stats message
  Quick fix to reduce load on runners
  "Debug" output for assign-issue-action
  Streamline pr-comment.yml (and remove status: stale label)
  Feature provide insights citation fetcher (JabRef#15093)
  Automatic Grouping By Entry Type (JabRef#15081)
  Minor test fixes for arXiv (JabRef#15100)
  New Crowdin updates (JabRef#15101)
  recomment linked files handler (JabRef#15105)
  Chore(deps): Bump jablib/src/main/resources/csl-styles (JabRef#15087)
  Streamline binaries (JabRef#15085)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

first contrib good first issue An issue intended for project-newcomers. Varies in difficulty. status: no-bot-comments status: ready-for-review Pull Requests that are ready to be reviewed by the maintainers status: to-be-merged PRs which are accepted and should go into the merge-queue.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support grouping by entry type

2 participants