feat: select correct tab for creation of new entry (#13087)#13091
Conversation
…d of setField to ensure immutability
| BibEntry tempEntry = new BibEntry().withField(StandardField.DOI, clipboardText); | ||
| IdentifierParser parser = new IdentifierParser(tempEntry); | ||
|
|
||
| if (parser.parse(StandardField.DOI).isPresent()) { |
There was a problem hiding this comment.
Can you please add a clarifying comment here that we put every kind of identifier from the clipboard in the temp DOI field because it also works for isbn or arxiv
|
thanks for your contribution! LGTM from my side! |
koppor
left a comment
There was a problem hiding this comment.
The issue description only superficially checked
public Optional<? extends Identifier> parse(Field field) {
The "better" code is org.jabref.logic.importer.CompositeIdFetcher#containsValidId
Add a new static method to CompositeIdFetcher
public static Optional<Identifier> getIdentifeir(String identifier) {
...
Use the fail-fast principle (not as in the current implementation)
Then rewrite containsValidId to use that method an return ...isPresent()
Sorry for the extra effort, but sometimes one sees the "better" way when reading a possible solutin.
|
@trag-bot didn't find any issues in the code! ✅✨ |
|
@lydia-yan Thank you for the quick and good follow up! I activated auto-merge; your contribution should be in JabRef's main branch in approx. 30 minutes. |
|
Ok! Thank you all for your quick and constructive feedback! |
|
@lydia-yan I got one more thing: Instead of "Automatically determine identifier type", the determined type could be selected I tried with 10.1109/MCOM.2010.5673082: As is: to be Do you have time for a follow-up or should I create an issue for other contributors? |
|
@koppor I’m happy to handle that! Should I create a new PR after I finish it? |
Happy to hear! Yes, start from the |
…ddLobidIsbnFetcher * 'addLobidIsbnFetcher' of github.com:JabRef/jabref: (26 commits) Bump com.konghq:unirest-java-core from 4.4.6 to 4.4.7 (#13104) Bump ai.djl:bom from 0.32.0 to 0.33.0 (#13106) Bump org.openrewrite.rewrite from 7.5.0 to 7.6.1 (#13105) Bump com.tngtech.archunit:archunit-junit5-engine from 1.4.0 to 1.4.1 (#13103) Bump com.konghq:unirest-modules-gson from 4.4.6 to 4.4.7 (#13102) Bump jablib/src/main/resources/csl-styles from `b8070a7` to `9b777f6` (#13101) Refine http sever doc (#13100) Add type "Bug" (#13099) Fix dash feat: select correct tab for creation of new entry (#13087) (#13091) Add missing empty line Fix notarization flag (#13095) Add more options to ADR-044 (#13098) Update year (#13097) Add ADR for migration from Apache Commons to Picocli (#13096) fix-localization (#13092) Fix condition for "comment-on-pr" fix-git-version (#13093) hotfix: enable ea build also on label added Check label "dev: binary" for upload to builds.jabref.org (#13086) ...



Select correct tab for creation of new entry (#13087)
Closes #13087
Summary of changes
This PR improves the user experience when creating new entries. If the clipboard contains a valid identifier (like a DOI), the 'Enter Identifier' tab will now be automatically selected, and the identifier will be pre-filled.
Changes made:
Screenshots
Before:

After:


Mandatory checks
CHANGELOG.mddescribed in a way that is understandable for the average user (if change is visible to the user)Collaborators
@lydia-yan @yoasaaa @brandon-lau0 @FlyJoanne