From 55362293f9bcf0a3ff37371bc3597c5f0a97467e Mon Sep 17 00:00:00 2001 From: Abdelrhman Date: Thu, 20 Aug 2026 20:52:34 +0300 Subject: [PATCH 01/32] Fix field editor focus for non-required fields and scroll into view --- .../jabref/gui/entryeditor/AllFieldsTab.java | 16 +++++++ .../gui/fieldeditors/FieldEditorFX.java | 44 ++++++++++++++++--- 2 files changed, 55 insertions(+), 5 deletions(-) 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..0ed7bf5559df 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,15 @@ private void refreshShownFieldsIfNeeded(FieldChangedEvent event) { } } + @Override + public void requestFocus(Field fieldName) { + TitledPane pane = sectionPanes.get(FieldListSections.sectionOf(fieldName)); + if (pane != null && !pane.isExpanded()) { + 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 +274,7 @@ private void refreshShownFieldsIfNeeded(FieldChangedEvent event) { /// tab height. @Override protected void layoutEditors(BibDatabaseContext bibDatabaseContext, BibEntry entry, boolean compressed, List