Fix/bug date range preservation#15511
Conversation
>> >> When a file pattern uses [DATE] and no exact match is found, the finder >> now falls back to progressively less specific date formats (year-month, >> then year-only) before returning empty.
…nto fix/date-fallback-file-finder
|
whats the status here? Is this rfr or draft status deliberately chosen? |
I apologize! Last week has been very busy. I hope to work more on this issue sometime today and have it done by this week. Will most likely commit today with an updated version. Also yes the draft status was deliberately chosen. |
Review Summary by QodoPreserve BibLaTeX date ranges in editor and normalize action
WalkthroughsDescription• Preserve date ranges in entry editor instead of truncating to start date • Synchronize text field and date picker with bidirectional updates • Keep both ends of date range in normalized date formatter output • Add text field with commit logic on Enter, Tab, and focus loss Diagramflowchart LR
A["User enters date range"] --> B["Text field captures input"]
B --> C["Commit on Enter/Tab/Focus loss"]
C --> D["Parse and validate date"]
D --> E["Sync picker with text"]
E --> F["Preserve full range in model"]
F --> G["Normalize keeps both dates"]
File Changes1. jabgui/src/main/java/org/jabref/gui/fieldeditors/DateEditor.java
|
Code Review by Qodo
1.
|
|
I tested it, works, needs a second lool |
Review Summary by QodoPreserve date ranges in BibLaTeX date editor
WalkthroughsDescription• Preserve date ranges in BibLaTeX date fields during editing • Prevent truncation of date ranges by normalize date action • Add text field to date editor for freeform input • Synchronize picker and text field with bidirectional updates Diagramflowchart LR
A["User enters date range"] --> B["DateEditor text field"]
B --> C["Commit on Enter/Tab/Focus loss"]
C --> D["Parse and validate date"]
D --> E["Sync picker if lossless"]
D --> F["Accept freeform text if valid"]
F --> G["Preserve full date range"]
G --> H["getNormalized includes both dates"]
File Changes1. jabgui/src/main/java/org/jabref/gui/fieldeditors/DateEditor.java
|
Code Review by Qodo
|
|
Sorry I accidentally closed the PR! |
Co-authored-by: Carl Christian Snethlage <50491877+calixtus@users.noreply.github.com>
|
not sure whats going on with the failing tests, mine are green locally |
| @Override | ||
| public void bindToEntry(BibEntry entry) { | ||
| viewModel.bindToEntry(entry); | ||
| syncPickerWithText(normalizeText(viewModel.textProperty().get())); |
There was a problem hiding this comment.
| syncPickerWithText(normalizeText(viewModel.textProperty().get())); | |
| syncPickerWithText(viewModel.textProperty().getValueSafe()); |
I would suggest to remove normalizeText completely - it sounds slightly misleading as it is just ensuring null safety. The other places can use Objects.requireNonNullElse(textField.getText(), ""); so that when the code is read, one doesn't have to figure out what normalizeText does.
There was a problem hiding this comment.
got it! I'll get to making the rest of the changes tomorrow when I'm at my computer
Co-authored-by: Subhramit Basu <subhramit.bb@live.in>
Co-authored-by: Subhramit Basu <subhramit.bb@live.in>
Co-authored-by: Subhramit Basu <subhramit.bb@live.in>
Co-authored-by: Subhramit Basu <subhramit.bb@live.in>
Thanks for the review! |
Related issues and pull requests
Closes #8902
PR Description
Normalize datesave action now keeps both ends of a parsed date range instead of truncating to the start date.After change, with ENTER, TAB, and Focus change
Recording.2026-04-13.001053.mp4
Steps to test
TODO: take videos of new behavior
Checklist
CHANGELOG.mdin a way that can be understood by the average user (if change is visible to the user)