Repository navigation
Fix numeric sorting for citationcount, day, and dayfiled columns - #17649
Conversation
Qodo reviews are paused for this user.Troubleshooting steps vary by plan Learn more → On a Teams plan? Using GitHub Enterprise Server, GitLab Self-Managed, or Bitbucket Data Center? |
|
Hey @kpunia306! 👋 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. |
|
Hello @kpunia306 what I tried to say at #17476 (comment) still applies, albeit my wording might have been too generic to convey my meaning. I think we all would benefit from finding out why those field are not numeric in the first place. Is there a reason for it? One reason might be, that those fields are defined in the bibtex or biblatex standard to be non-numeric and since JabRef follows those standards, it is so. Another reason might be that people that write articles and books don't follow those standards perfectly, so we might find entries out there in the wild containing non-numeric data in those fields, such as for the So what I think should be done to make sure we do the right thing here is to first look at the definitions, such as in the biblatex package documentation at https://ctan.org/pkg/biblatex and https://ctan.org/pkg/tamethebeast and then to find some real entries uploaded to scientific journals or data providers like Crossref. If you can find one or multiple entries WITH numeric field content and some others WITHOUT numeric field content, then fixing this becomes more complicated. |
|
Thank you for pointing this out @ThiloteE! I looked into the official BibTeX/BibLaTeX specifications and how JabRef's comparator handles these fields:
If you prefer to keep |
|
Fair point, sorry about that! To keep it simple: I think citationcount, day, and dayfiled definitely make sense as numeric. Happy to revert chapter and part so we keep the PR minimal. Let me know if that works and I'll update the branch! |
bd8c0b9 to
1674d19
Compare
Code Review by Qodo
1. Large citation counts sort before zero
|
|
Successfully created backport PR for |
…n-list * upstream/main: (74 commits) Reduce layout jump of tags editors (#17555) [Port to main] Chore(deps-dev): Bump @modelcontextprotocol/server from 2.0.0 to 2.4.0 (#17670) Make arXiv fallback title matching locale independent (#17652) Chore(deps): Bump org.eclipse.jgit:org.eclipse.jgit.ssh.apache.agent from 7.8.0.202609011348-r to 7.8.1.202611041320-r in /versions (#17726) Chore(deps): Bump org.eclipse.jgit:org.eclipse.jgit from 7.8.0.202609011348-r to 7.8.1.202611041320-r in /versions (#17727) Chore(deps): Bump org.eclipse.jgit:org.eclipse.jgit.ssh.apache from 7.8.0.202609011348-r to 7.8.1.202611041320-r in /versions (#17728) Chore(deps): Bump com.dlsc.gemsfx:gemsfx from 4.6.0 to 4.7.0 in /versions (#17729) New Crowdin updates (#17725) chore(deps): update dependency com.nimbusds:oauth2-oidc-sdk to v11.39 (#17723) Fix numeric sorting for citationcount, day, and dayfiled columns (#17649) Preserve syntax highlighting when copying BibTeX in Source tab (#17392) (#17441) Chore(deps): Bump com.dlsc.gemsfx:gemsfx from 4.5.0 to 4.6.0 in /versions (#17721) Chore(deps): Bump com.konghq:unirest-java-core from 4.11.2 to 4.11.3 in /versions (#17719) Chore(deps): Bump org.graalvm.sdk:nativeimage from 25.4.4.1.1 to 25.5.5.0.3 in /versions (#17718) Chore(deps): Bump com.konghq:unirest-modules-gson from 4.11.2 to 4.11.3 in /versions (#17720) New Crowdin updates (#17715) chore(deps): update dependency org.eclipse.jgit:org.eclipse.jgit.pgm to v7.8.1.202611041320-r (#17712) Restrict consistency check columns to the fields of a .bst style (#17710) Remove OCR language handling from DoclingEngine (#17674) Exclude "file" field from consistency check (#17651) ...
Summary
Fixes #17459
In
StandardField.java, the fieldsCITATIONCOUNT,DAY, andDAYFILEDwere missingFieldProperty.NUMERIC. Because of this, their table columns sorted values alphabetically (e.g.1, 10, 2, 200, 9) rather than numerically (1, 2, 9, 10, 200).Following maintainer guidance in #17459 and #17469, this PR:
FieldProperty.NUMERICtoCITATIONCOUNT,DAY, andDAYFILEDinStandardField.java.StandardFieldTest.javaverifyingisNumeric()on all updated fields.CHANGELOG.md.Steps to test
dayorcitationcount.Related issues and pull requests
Closes #17459
AI usage
I used Antigravity / Gemini 3.8 Flash (Medium) to assist with finding the enum in
StandardField.javaand preparing unit tests inStandardFieldTest.java. I reviewed, tested, and verified all changes locally.Checklist
CHANGELOG.mddescribing the change from the user's point of view (if the change is visible to the user)