-
-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
Show compound patterns in the dropdown for citation key patterns #12580
base: main
Are you sure you want to change the base?
Conversation
} | ||
|
||
public List<String> generateCompoundPatterns(String enteredText) { | ||
List<String> patterns = List.of("auth", "edtr", "year", "title", "date"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@subhramit I used this list as I don’t have much knowledge about the fields and can you explain more about compound patterns?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please use the constants of org.jabref.model.entry.field.StandardField here.
The fields can be read about at BibLaTeX documentation at https://ctan.org/pkg/biblatex.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think, the list should be manually crafted instead of just combinding all fields
The description at #12502 (comment) talks about auto completion
That would be nice.
If this is not possible, some pre-selected combinations should be doable.
I think, it needs to be a separate pop up then - even if multiple modals are not a good style ^^
Grammar: [{pattern}](_[{pattern}])*
- A user can select a pattern.
- Then, the user can select "+"
- Then, JabRef adds "_" and offers another dropdown to select (the one selected before is NOT offered)
Reason: A user wants to use AuthEtAl together with year typically.
@priyanshu16095 Think of this as autogenerated (!) human-readable-primary-key in databases. MAybe this helps. -- Another thing: Either data of a BibEntry can be used directly or some processing of JabRef can be used. The former is ensured by CAPITAL LETTERS (first paragraph at https://docs.jabref.org/setup/citationkeypatterns#citation-key-patterns). The latter is described in the other text.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
JUnit tests are failing. In the area "Some checks were not successful", locate "Tests / Unit tests (pull_request)" and click on "Details". This brings you to the test output.
You can then run these tests in IntelliJ to reproduce the failing tests locally. We offer a quick test running howto in the section Final build system checks in our setup guide.
Recording.2025-02-28.mp4@koppor Thanks for your insights! I’ve come up with a different solution that addresses the concerns and removes the overhead of an algorithm, maintaining it, and making it more efficient. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
JUnit tests are failing. In the area "Some checks were not successful", locate "Tests / Unit tests (pull_request)" and click on "Details". This brings you to the test output.
You can then run these tests in IntelliJ to reproduce the failing tests locally. We offer a quick test running howto in the section Final build system checks in our setup guide.
Sorry, I am a little low on time to test this - What does the menu "Create compound pattern" do? Why is it needed if we can create compound patterns by taking patterns from the "All patterns" list? As far as I understand, only thing it does is add underscores in between patterns - the choice of that separator can be arbitrary for a user. @koppor do we wish to make underscore a default for this? Or is it a wider convention? This user, for example, was using colons ( @priyanshu16095 Can you move the black arrows of the first menu (first two items having sublists) to the extreme right of the cell (like in the sublist menu)? (Updated) |
Just like a dropdown that shows generated compound patterns, it allows the user to create any pattern on their own. |
@koppor ping |
Good idea! |
The functionality is unclear because of the wording. The options need to be "parallel", like this: Example 1
Example 2
Example 3
What about modifiers? These could be available after the first field or field marker has been selected, maybe like this. Example 4
Another possibility for modifiers and even more detail would be to include an "expert" option linking to documentation or just add |
@ryan-carpenter I was unable to convey this properly. What I mean to say is that, without writing much additional code and by simply adding a few lines in the UI, it significantly improves the user experience. This is because there's no need to read any documentation or manually reopen the dropdown. |
Follow-up for #12516
This PR enhances the citation key dropdown feature by adding a submenu for compound patterns.
Mandatory checks
CHANGELOG.md
described in a way that is understandable for the average user (if change is visible to the user)Recording.2025-02-28.mp4