Add drop down for citation key patterns#12516
Conversation
|
Screenshot? |
Recording.2025-02-16.mp4The positioning of list is not perfect, it comes on top of it, else works fine and the list of patterns is hardcoded. |
subhramit
left a comment
There was a problem hiding this comment.
I know it's a draft, but requesting a minor change.
Really good work so far! Thanks for picking this up.
There was a problem hiding this comment.
Your code currently does not meet JabRef's code guidelines. We use OpenRewrite to ensure "modern" Java coding practices. The issues found can be automatically fixed. Please execute the gradle task rewriteRun, check the results, commit, and push.
You can check the detailed error output by navigating to your pull request, selecting the tab "Checks", section "Tests" (on the left), subsection "OpenRewrite".
There was a problem hiding this comment.
Your code currently does not meet JabRef's code guidelines. We use Checkstyle to identify issues. Please carefully follow the setup guide for the codestyle. Afterwards, please run checkstyle locally and fix the issues.
In case of issues with the import order, double check that you activated Auto Import. You can trigger fixing imports by pressing Ctrl+Alt+O to trigger Optimize Imports.
|
There is a problem with using the context menu because when it reaches the bottom of the screen, it shifts upward, making the UI buggy. |
If you don't get an answer quickly, just assume that nobody has a clue and will need invest time to investigate. Thus, go ahead and try. Note that we could accept a different UI using a popup and buttons -similar to "Select entry type" -- if this works better With this, we could even recommend certain citation key paterns. |
Co-authored-by: Subhramit Basu Bhowmick <subhramit.bb@live.in>
|
|
||
| private void populatePopup(List<String> searchResult) { | ||
| List<CustomMenuItem> menuItems = new ArrayList<>(); | ||
| int maxEntries = 7; |
There was a problem hiding this comment.
Move this to a class-level constant with a brief comment explaining its use and the value
|
I found this solution on Stack Overflow for GUI. |
|
Update - tested a case - in case of compound patterns like |
|
Will do. I'll ensure [auth]_[year] triggers the dropdown. |
|
This pattern [auth]_[year] does not exist in the Java record. |
There was a problem hiding this comment.
Your code currently does not meet JabRef's code guidelines. We use Checkstyle to identify issues. Please carefully follow the setup guide for the codestyle. Afterwards, please run checkstyle locally and fix the issues.
In case of issues with the import order, double check that you activated Auto Import. You can trigger fixing imports by pressing Ctrl+Alt+O to trigger Optimize Imports.
|
Wow this is a really epic feature! Looks great! |
|
Please add a changelog entry! |
Head branch was pushed to by a user without write access
Yes, it is not supposed to, it is a compound pattern - what I meant was (as per #12502 (comment)) - the individual components of a compound pattern should trigger a dropdown. I have given an example. I like your solution more though, and hardcoding it into the record works as it's a common pattern. Any less used pattern can be manually typed anyway. The sub-dropdowns are an icing on the cake, so really good work. JabRef users will love this. |
|
Thanks for the clarification! I will try it in a follow-up PR. |
Not a priority right now, maybe when you can't find things more striking to work on. Also, to clarify:
I was referring to what you did, not what is left :) |
| Author\ related=Author related | ||
| Editor\ related=Editor related | ||
| Title\ related=Title related | ||
| BibEntry\ fields=BibEntry fields |
There was a problem hiding this comment.
@priyanshu16095 I totally overlooked the last entry while reviewing. (Nearly) all other translations use "entry" only.
Can you file a full-up PR replacing "BibEntry" by "Entry"/"entry"? (I found two hits in the language file)


Fixes #12502
This PR introduces a functionality to display a drop-down list of matching suggestions when typing a citation key pattern.
Mandatory checks
CHANGELOG.mddescribed in a way that is understandable for the average user (if change is visible to the user)