diff --git a/CHANGELOG.md b/CHANGELOG.md index ca5cd9a4d470..79a11fa3e62a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -148,6 +148,7 @@ Note that this project **does not** adhere to [Semantic Versioning](https://semv - We fixed an issue where the button shape changed when hovering over it. [#16188](https://github.com/JabRef/jabref/issues/16188) - We fixed handling of `exit` in the LSP server. [#16268](https://github.com/JabRef/jabref/pull/16268) - We fixed an issue where `LinkedFile.isOnlineLink()` did not recognize `ftp://` links as online links. [#16400](https://github.com/JabRef/jabref/issues/16400) +- We fixed an issue where the "Jump to field" dialog only searched fields already shown in the entry editor. It now searches all known fields and adds the selected field if it is not yet visible. [#16593](https://github.com/JabRef/jabref/issues/16593) ### Removed diff --git a/jabgui/src/main/java/org/jabref/gui/entryeditor/AllFieldsTab.java b/jabgui/src/main/java/org/jabref/gui/entryeditor/AllFieldsTab.java index bf2e20fc82dc..e26b4bd348eb 100644 --- a/jabgui/src/main/java/org/jabref/gui/entryeditor/AllFieldsTab.java +++ b/jabgui/src/main/java/org/jabref/gui/entryeditor/AllFieldsTab.java @@ -115,6 +115,11 @@ public class AllFieldsTab extends FieldsEditorTab { private final Map sectionExpandOverrides = new EnumMap<>(FieldListSections.SectionType.class); + /// Tracks the [TitledPane] created for each section type, so we can expand a collapsed + /// section on demand (e.g. when jump-to-field targets a field inside it). + private final Map sectionPanes = + new EnumMap<>(FieldListSections.SectionType.class); + /// Sticky per tab instance: whether the secondary-optional chips are expanded. private boolean showSecondaryOptionalChips; @@ -253,6 +258,14 @@ private void refreshShownFieldsIfNeeded(FieldChangedEvent event) { } } + @Override + public void requestFocus(Field fieldName) { + Optional.ofNullable(sectionPanes.get(FieldListSections.sectionOf(fieldName))) + .filter(pane -> !pane.isExpanded()) + .ifPresent(pane -> pane.setExpanded(true)); + super.requestFocus(fieldName); + } + /// Main fields as a grid with natural row heights, then the optional-field chip bar, /// then the always-present collapsible sections (identifiers / files & links / /// bibliometrics / comments / meta, collapsed when empty) each with its own add-chips, @@ -260,6 +273,7 @@ private void refreshShownFieldsIfNeeded(FieldChangedEvent event) { /// tab height. @Override protected void layoutEditors(BibDatabaseContext bibDatabaseContext, BibEntry entry, boolean compressed, List