Skip to content
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

Bring back content selectors #10560

Closed
4 tasks
koppor opened this issue Oct 23, 2023 · 12 comments · Fixed by #10910
Closed
4 tasks

Bring back content selectors #10560

koppor opened this issue Oct 23, 2023 · 12 comments · Fixed by #10910
Assignees
Labels
entry-editor FirstTimeCodeContribution Triggers GitHub Greeter Workflow good first issue An issue intended for project-newcomers. Varies in difficulty. keywords ui

Comments

@koppor
Copy link
Member

koppor commented Oct 23, 2023

Introduction

JabRef 3.8.2

JabRef 3.8.2 had the possibility to use pre-defined words for the keyword field. Instead of auto-completion, the user could use a drop down field:

a

JabRef 5.12

In today's JabRef, there is no such possibility:

b

One can still configure the list where the user can choose the available "keywords" to offer.

c

On the left, the field is selected, on the right, the possible contents are shown.

Tasks

  • Add the selection box next to the keyword field. The list should be filled with the contents of the content selectors list, minus the existing keywords.
    • This box is OUTSIDE the text box. It allows for selecting an item in a pre-defined list. Once a user clicks on the item, it is added alphabetically inside the list. In case the list is not alphabetically sorted, it is added to the end.
  • In the configuration of the "Content Selectors", do NOT allow configuration of Fields having the property "org.jabref.model.entry.field.FieldProperty#PERSON_NAMES" (because there are soooo many authors, we think, it does not make sense to use it there)
  • Change the popup to enter types to the combo box for custom entry types
    • old: d
    • new: e
  • Optional: Rewrite the keyword edit to tags, also called chips
@koppor koppor added ui good first issue An issue intended for project-newcomers. Varies in difficulty. labels Oct 23, 2023
@Rohxn16
Copy link

Rohxn16 commented Oct 24, 2023

i would like to work on this issue

@Siedlerchr Siedlerchr added the FirstTimeCodeContribution Triggers GitHub Greeter Workflow label Oct 24, 2023
@github-actions
Copy link
Contributor

As a general advice for newcomers: check out Contributing for a start. Also, guidelines for setting up a local workspace is worth having a look at.

Feel free to ask here at GitHub, if you have any issue related questions. If you have questions about how to setup your workspace use JabRef's Gitter chat. Try to open a (draft) pull-request early on, so that people can see you are working on the issue and so that they can see the direction the pull request is heading towards. This way, you will likely receive valuable feedback.

@Satya-Manikanta
Copy link

Satya-Manikanta commented Jan 23, 2024

Hi @koppor

In the org.jabref.gui.entryeditor.* folder,
I found the files for Required fields, Optional fields, Comments as well (as you can see I modifiled the tab name with the integer)
but I am not able to locate the file for General tab.

Can you please provide the steps or instructions on how General tab is being rendered in the UI.
And from which file we are getting the data for General tab shown in screenshot.

image

@Siedlerchr, @Rohxn16 if you do have idea on this, please provide your inputs

@koppor
Copy link
Member Author

koppor commented Jan 24, 2024

@Satya-Manikanta Understanding how the EntryEditor works is part of the levelling-up the code reading skills.

In org.jabref.gui.entryeditor.EntryEditor#createTabs, the routine after the "Comments" tab, there is the routine to fill the "General" tab. There, some magic is happening, because the content of that tab is configured in the preferences. The defaults are put at org.jabref.preferences.JabRefPreferences#setLanguageDependentDefaultValues.

@LoayGhreeb
Copy link
Collaborator

I would like to try to work on this issue.

@koppor, could you clarify how I can get the existing keywords to exclude them from the selection box? Should I split them by space, comma separator, or something else to be able to retrieve the words correctly?

@koppor
Copy link
Member Author

koppor commented Feb 23, 2024

I would like to try to work on this issue.

@koppor, could you clarify how I can get the existing keywords to exclude them from the selection box? Should I split them by space, comma separator, or something else to be able to retrieve the words correctly?

@LoayGhreeb Thank you for working on this. I didn't get that you are the one with the pull request. I will provide a more detailed answer later. I don't know all code by heart. One hint now: The separator is configured globally (called KeywordSeparator) and we have a class handling keywords (converting them to a list and back). Maybe you find it witj Ctrl+Shift+F.

@LoayGhreeb
Copy link
Collaborator

Hi @koppor, I have implemented most of the first task and the 3rd task is ready for review, I'm waiting for your feedback.

I have a small question regarding the first task. Do you want to check if all keywords in the text field are ordered alphabetically so that the selected item should be placed in the correct order? Otherwise, it will be added to the end.

@koppor
Copy link
Member Author

koppor commented Feb 29, 2024

@LoayGhreeb Let JabRef be smart here. In case the list is ordered alphabetically, add it alphabetically. Else: Add it to the end. That way, JabRef is "smart" and does not change an existing order.

@LoayGhreeb
Copy link
Collaborator

Let JabRef be smart here. In case the list is ordered alphabetically, add it alphabetically. Else: Add it to the end. That way, JabRef is "smart" and does not change an existing order.

Thanks for clarification @koppor, but since I will implement it using the Tags Field there is no need for this.

By the way, is this what is required in the second task?

Demo.mp4

@koppor
Copy link
Member Author

koppor commented Feb 29, 2024

Regardingthe second task. A user can configure the content selectors for fields:

image

My idea was to exclude field names which do not make sense to have content selectors. Not by name, but by property.

Maybe, it does not make sense. One would really need to think for which fields the content selectors would make sense. Much more work. The proposal with avoiding "PERSON" was a gut thing. Not well-thought...

@koppor
Copy link
Member Author

koppor commented Feb 29, 2024

Refined answer: If you are going to implement that - the combo box should just NOT contain some fields... No exception thrown.

@koppor
Copy link
Member Author

koppor commented Feb 29, 2024

but since I will implement it using the Tags Field there is no need for this.

I'm curious how this will be then... I hope, it won't resort the content. Let's see...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
entry-editor FirstTimeCodeContribution Triggers GitHub Greeter Workflow good first issue An issue intended for project-newcomers. Varies in difficulty. keywords ui
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

6 participants