-
-
Notifications
You must be signed in to change notification settings - Fork 3.2k
Improve newentry dialog #14768
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
Improve newentry dialog #14768
Conversation
- Add ChangeListener to idText field to detect identifier type on input - Automatically update idFetcher ComboBox when valid identifier is detected - Only updates when 'Automatically determine identifier type' is selected - Also detects identifier type when switching to auto-detect mode - Handles arXiv, DOI, ISBN, RFC, and SSRN identifier types - Validates DOI and ISBN identifiers before updating fetcher Fixes #14660
- Extract identifier validation logic into isValidIdentifier() method - Use the extracted method in both listeners and extractValidIdentifierFromClipboard() - Reduces code duplication as requested in review Addresses review feedback on PR #14662
The previous formatting commit reformatted the entire file including unrelated code. This reverts those changes. Only the new code we added should be formatted if needed.
- Remove unnecessary null checks (idText.getText() and newValue) - Replace unused 'observable' parameter with '_' - Format code according to project guidelines - Add changelog entry Addresses review feedback on PR #14662
…b.com/atul-raman/jabref into fix/identifier-type-auto-detect-14660
Fixes issue where URLs with fragments (e.g., https://arxiv.org/html/2503.08641v1#bib.bib5) were not being detected. The cleanIdentifierText() method now strips fragments and query parameters before identifier parsing.
…b.com/atul-raman/jabref into fix/identifier-type-auto-detect-14660
…tifier-type-auto-detect-14660
- Removed cleanIdentifierText() method as Identifier.from() already handles parsing - Extracted duplicate identifier detection logic into updateFetcherFromIdentifierText() helper method - Updated both listeners to use the shared helper method - Updated extractValidIdentifierFromClipboard() to use Identifier.from() directly Addresses reviewer feedback on code duplication and approach.
The reviewer's refactoring left an incomplete switch statement that caused a compilation error. Removed the broken code to restore compilation.
…rror" This reverts commit d4f3c71.
The TODO comment from the reviewer was removed when fixing the compilation error. Restored it as requested by the reviewer.
|
@jetbrains-junie fix the failing tests |
|
Hey, it's Junie by JetBrains! I started processing your request 🚀 📢 Thanks for participating in our GitHub EAP! Starting February, use the CLI at https://junie.jetbrains.com/ and the GitHub Action at https://github.com/JetBrains/junie-github-action. Active users already have CLI access, if anything goes wrong, reach out on Discord! |
✅ The execution was successful
📢 Thanks for participating in our GitHub EAP! Starting February, use the CLI at https://junie.jetbrains.com/ and the GitHub Action at https://github.com/JetBrains/junie-github-action. Active users already have CLI access, if anything goes wrong, reach out on Discord! More information: |
User description
Follow-up to #14662
Unifies code for identifier-based parsing.
SsrnFetcherwas introduced for simple code inCompositeIdFetcher-Steps to test
Use the New Entry dialog and the identifier-based fetching
Mandatory checks
CHANGELOG.mdin a way that is understandable for the average user (if change is visible to the user)PR Type
Enhancement, Bug fix
Description
Unify identifier-based parsing logic across New Entry dialog and fetchers
Auto-detect identifier type when typing in identifier field
Refactor variable naming for clarity (guiPreferences vs newEntryPreferences)
Extract identifier validation and fetcher selection into reusable methods
Add SSRN fetcher and support for ISSN identifier type
Diagram Walkthrough
File Walkthrough
NewEntryView.java
Refactor preferences naming and unify identifier fetcher selectionjabgui/src/main/java/org/jabref/gui/newentry/NewEntryView.java
guiPreferencestopreferencesandpreferencestonewEntryPreferencesfor claritySSRN) and use WebFetchers utility
fetcherForIdentifier()method with call toWebFetchers.getIdBasedFetcherFoIdentifier()fetcher when typing
variable names
@NonNullannotations to description methodsFetchAndMergeEntry.java
Update supported identifier fields and add ISSN supportjabgui/src/main/java/org/jabref/gui/mergeentries/FetchAndMergeEntry.java
List.of()instead ofArrays.asList()WebFetchers#getIdBasedFetcherFoIdentifierWebFetchers.java
Add unified identifier-to-fetcher mapping method with cachingjablib/src/main/java/org/jabref/logic/importer/WebFetchers.java
getIdBasedFetcherFoIdentifier()to handleidentifier-based fetcher selection
RFC, SSRN)
methods
SsrnFetcher.java
Add new SSRN fetcher extending DoiFetcherjablib/src/main/java/org/jabref/logic/importer/fetcher/SsrnFetcher.java
getName()to return "SSRN"performSearchById()to handle SSRN-to-DOI conversionCompositeIdFetcher.java
Simplify identifier fetching using unified WebFetchers utilityjablib/src/main/java/org/jabref/logic/importer/CompositeIdFetcher.java
RFC, SSRN)
WebFetchers.getIdBasedFetcherFoIdentifier()performSearchById()method using functional compositionIdentifier.java
Add consistency documentation to Identifier.from() methodjablib/src/main/java/org/jabref/model/entry/identifier/Identifier.java
from()method documenting consistencyrequirement
identifier parsing