Combine SearchableComboBox and TextField for adding fields in Custom Entry Types
Closes #14547
This pull request replaces the separate mechanisms (SearchableComboBox and free TextField) for adding new fields with a single TextField utilizing auto-completion in the "Custom Entry Types" preference pane.
This improves usability by unifying the workflow: users can quickly filter and find a standard field or type a custom field name directly in the same control. The option is located under File -> Preferences -> Entry types.
Steps to test the combined input field
- Go to
File -> Preferences -> Entry types. - Select any entry type from the list on the left.
- In the "Required and optional fields" section, locate the new "Type new field..." text input at the bottom.
- Verify the auto-completion for standard fields:
- Start typing a standard name (e.g., day).
- Verify that the list suggests matching fields.
- Select a field and click the
+button. - Verify it is added to the list.
- Verify the creation of custom fields:
- Type a custom name that matches no suggestions (e.g., customField).
- Verify that the input is valid (no red border) and the
+button is enabled. - Click
+to add it.
Final Result
Mandatory checks
- [x] I own the copyright of the code submitted and I license it under the MIT license
- [x] I manually tested my changes in running JabRef (always required)
- [/] I added JUnit tests for changes (if applicable)
- [x] I added screenshots in the PR description (if change is visible to the user)
- [x] I described the change in
CHANGELOG.mdin a way that is understandable for the average user (if change is visible to the user) - [x] I checked the user documentation: Is the information available and up to date? If not, I created an issue at https://github.com/JabRef/user-documentation/issues or, even better, I submitted a pull request updating file(s) in https://github.com/JabRef/user-documentation/tree/main/en.
In general I like this; however, the drawback is that you need to know the field names to search for...
the drawback is that you need to know the field names to search for...
You're right, I didn't think about that drawback. I'll try to explore options to improve it, but no guarantee for now. Thanks for the feedback!
can you please fix the failing test? I think something with the localization is off https://devdocs.jabref.org/code-howtos/localization.html
@Siedlerchr It’s fixed now!
Tested a little bit:
If i have no entry type selected, i am still able type something in the textfield for a new field:
If i press return then in that field, the dialog closes trying to save the preferences. If i press return in the field for new entry type, the dialog closes, trying to save
as a user i expect pressing return in the text fields to add the field to the list.
if i have added a field and want to add another field, the custom field is not added to autocompletion list.