- 
          
- 
                Notifications
    You must be signed in to change notification settings 
- Fork 3k
Automatic Grouping By Date #14169
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
base: main
Are you sure you want to change the base?
Automatic Grouping By Date #14169
Conversation
…c tests currently only group based on year not months
…to-date-groups
…year following month and day, changing AutomaticDateGroup/DateGroup+ DateGranularity + tests (year/month/day)
Model of auto date groups complelte and the test added
- Add AUTOMATIC_DATE_GROUP_ID constant to MetadataSerializationConfiguration - Implement serializeAutomaticDateGroup() in GroupSerializer * Serializes field name * Serializes granularity (YEAR/MONTH/FULL_DATE) - Add AutomaticDateGroup case in serialization switch - Add getField() and getGranularity() methods to AutomaticDateGroup - Fix deepCopy() and hashCode() to include granularity Serialization format: AutomaticDateGroup:name;context;field;granularity;...
- Add AutomaticDateGroup and DateGranularity imports to GroupsParser - Implement automaticDateGroupFromString() method * Parse name, context, field from serialized string * Parse and convert granularity string to DateGranularity enum * Create AutomaticDateGroup with all parameters * Restore group details (color, icon, description) - Add condition check in fromString() to handle AutomaticDateGroup This enables AutomaticDateGroup to be loaded from .bib files, completing the save/load cycle with serialization.
Serialization tests (GroupSerializerTest.java): - Test YEAR granularity serialization - Test MONTH granularity serialization - Test serialization with color, icon, and description - Verify format: AutomaticDateGroup:name;context;field;granularity;... Deserialization tests (GroupsParserTest.java): - Test parsing YEAR granularity - Test parsing MONTH granularity - Test parsing FULL_DATE granularity - Test parsing with color, icon, and description - Verify correct object reconstruction from string Total: 7 new test cases covering all granularity types and edge cases.
Checkstyle reported DateGranularity as an unused import because we only use it through method return type inference (getGranularity().name()). The import is not needed since we don't declare any variables of this type.
- Document DateGranularity enum values - Add class-level documentation for DateGroup - Ensures these files are detected as changed files in CI for JBang testing
Logic serialization
Implement the GUI for auto date grouping
Syncing the upstream update
| Hey @elliotgnn!Thank you for contributing to JabRef! Your help is truly appreciated ❤️. We have automatic checks in place, based on which you will soon get automated feedback if any of them are failing. We also use TragBot with custom rules that scans your changes and provides some preliminary comments, before a maintainer takes a look. TragBot is still learning, and may not always be accurate. In the "Files changed" tab, you can go through its comments and just click on "Resolve conversation" if you are sure that it is incorrect, or comment on the conversation if you are doubtful. Please re-check our contribution guide in case of any other doubts related to our contribution workflow. | 
| Please provide steps to test without using a walkthrough. | 
Closes #10822
This PR adds Automatic Date Groups feature to JabRef. Users can create automatic groups by year, by year-month or by full date when the date field of entries are set. Membership is dynamic—no manual assignment. The following are the specifics of implementation.
Model
DateGranularityenum:YEAR,MONTH,FULL_DATE.DateGroup extends AbstractGroup: represents a single key like2024,2024-10, or2024-10-14. Matching uses JabRef’s aliasing (date ↔ year/month/day).AutomaticDateGroup: builds childDateGroups for all entries at the chosen granularity and merges identical keys.Serialization
GroupsParser: read/write support forAutomaticDateGroup. Deserialization is tolerant—if the granularity token is missing/invalid, it defaults toYEAR(backward-compatible with older libraries).jablib/src/main/java/org/jabref/logic/exporterandjablib/src/main/java/org/jabref/logic/importerfolderGUI
YEAR)gui/groupsfolderSteps to test
Automated tests
Corresponding unit and integration tests for model, logic have been added for testing feature and persistence, in order to run them user can execute the command:
Manual Test
Manual Test can also be carried out through directly interacting with the GUI, steps will be:
+Add groupunder walkthrough section to generate example entriesAdd Groupat the lower left cornerDateoption under Collect by section and you can keep the default granularity for DATE and YEAROKBelow are the Demonstration images:




step 2:
step 3:
step 4:
step 5:
Mandatory checks
CHANGELOG.mdin a way that is understandable for the average user (if change is visible to the user)