jabref icon indicating copy to clipboard operation
jabref copied to clipboard

Combine SearchableComboBox and TextField for adding fields in Custom Entry Types

Open Memeel opened this issue 2 weeks ago • 4 comments

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

  1. Go to File -> Preferences -> Entry types.
  2. Select any entry type from the list on the left.
  3. In the "Required and optional fields" section, locate the new "Type new field..." text input at the bottom.
  4. 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.
Capture d'écran 2025-12-08 005824
  1. 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.
Capture d'écran 2025-12-08 010734

Final Result

Capture d'écran 2025-12-08 010742

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.md in 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.

Memeel avatar Dec 08 '25 00:12 Memeel

In general I like this; however, the drawback is that you need to know the field names to search for...

Siedlerchr avatar Dec 08 '25 20:12 Siedlerchr

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!

Memeel avatar Dec 09 '25 15:12 Memeel

can you please fix the failing test? I think something with the localization is off https://devdocs.jabref.org/code-howtos/localization.html

Siedlerchr avatar Dec 09 '25 19:12 Siedlerchr

@Siedlerchr It’s fixed now!

Memeel avatar Dec 11 '25 23:12 Memeel

Tested a little bit: If i have no entry type selected, i am still able type something in the textfield for a new field: grafik

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. grafik

calixtus avatar Dec 14 '25 21:12 calixtus