Skip to content

Fix Jump to field (ctrl + j) in the entry editor doesn't work - #16639

Open
adeifv wants to merge 23 commits into
JabRef:mainfrom
adeifv:fix-issue-16593
Open

Fix Jump to field (ctrl + j) in the entry editor doesn't work#16639
adeifv wants to merge 23 commits into
JabRef:mainfrom
adeifv:fix-issue-16593

Conversation

@adeifv

@adeifv adeifv commented Aug 20, 2026

Copy link
Copy Markdown
Contributor

Summary

The jump-to-field dialog now searches all known field names instead of only currently shown fields, and adds the field to the view if it isn't already visible (the same behaviour as clicking a "+" chip).

IMPORTANT:
Additionally,

  1. field editor focus was broken for non-required fields.
  2. fields were not scrolled into view when jumped to.
  3. fields inside collapsed sections could not be focused at all.
  4. dialog was not opened after left-clicking on another entry in the main entry table.

All four issues are fixed too.

jabref-contrib-policy:4.2:reviewed​:ok

Steps to test

As described in #16593

Screencast.from.2026-08-20.22-18-03.webm

Related issues and pull requests

Closes #16593

AI usage


GitHub Copilot by Student Pack, which only provides the Auto option, to assist with understanding certain concepts and implementing few parts. I also used the free tier of Claude Sonnet 5 available on its website.

Checklist

  • I own the copyright of the code submitted and I license it under the MIT license
  • If AI tools were used, I disclosed them in the "AI usage" section and reviewed, understood, and take full ownership of all AI-generated code
  • I manually tested my changes in running JabRef (always required)
  • I added JUnit tests for changes (if applicable)
  • I added screenshots in the PR description (if change is visible to the user)
  • I described the change in CHANGELOG.md describing the change from the user's point of view (if the change is visible to the user)
  • I checked the user documentation for up to dateness and submitted a pull request to our user documentation repository

@github-actions github-actions Bot added good first issue An issue intended for project-newcomers. Varies in difficulty. component: entry-editor labels Aug 20, 2026
@qodo-free-for-open-source-projects

Copy link
Copy Markdown
Contributor

PR Summary by Qodo

Fix jump-to-field (Ctrl+J) to add and focus hidden entry editor fields

🐞 Bug fix 📝 Documentation 🕐 20-40 Minutes

Grey Divider

AI Description

• Make jump-to-field search all known field names, not just currently visible editors.
• When a target field is hidden, add it to the All Fields tab and focus it.
• Ensure focused fields expand collapsed sections and scroll into view.
Diagram

graph TD
  A["Jump-to-field dialog"] --> B["JumpToFieldViewModel"] --> C["FieldFactory (all fields)"]
  A --> D["EntryEditorFocusUtils"] --> E["AllFieldsTab"] --> F["FieldEditorFX (focus+scroll)"]
Loading
High-Level Assessment

The chosen approach is appropriate for JabRef’s entry editor architecture: use the global field registry for discovery, and route focus through AllFieldsTab so it can materialize hidden fields and expand collapsed UI sections. Alternatives like keeping a cached AllFieldsTab reference or limiting the search list to entry-type fields are either minor refactors or change the intended UX.

Files changed (5) +90 / -20

Bug fix (4) +89 / -20
AllFieldsTab.javaExpand collapsed sections and add-and-focus fields on demand +29/-6

Expand collapsed sections and add-and-focus fields on demand

• Tracks section TitledPanes so requestFocus can expand collapsed sections before focusing a field. Defers focus/linked-file dialog opening via Platform.runLater and introduces addFieldAndFocus to materialize a missing field and immediately focus it.

jabgui/src/main/java/org/jabref/gui/entryeditor/AllFieldsTab.java

EntryEditorFocusUtils.javaFallback to All Fields tab when the target field is not shown +17/-1

Fallback to All Fields tab when the target field is not shown

• Extends jump-to-field focus logic: if the field (or its alias) is not currently shown in any tab, it selects the All Fields tab and adds the field (only if it is a known non-internal field) before focusing.

jabgui/src/main/java/org/jabref/gui/entryeditor/EntryEditorFocusUtils.java

JumpToFieldViewModel.javaList all known field names for jump-to-field search +6/-8

List all known field names for jump-to-field search

• Switches the dialog’s searchable field list from ‘currently shown fields’ to all known non-internal fields via FieldFactory, ensuring fields can be found even when not currently displayed.

jabgui/src/main/java/org/jabref/gui/entryeditor/JumpToFieldViewModel.java

FieldEditorFX.javaFix focus targeting and scroll focused editors into view +37/-5

Fix focus targeting and scroll focused editors into view

• Improves focus behavior by locating the first TextInputControl within an editor (fixing cases where focusing the container did nothing) and scrolls the focused node into view by adjusting the nearest ScrollPane’s vvalue.

jabgui/src/main/java/org/jabref/gui/fieldeditors/FieldEditorFX.java

Documentation (1) +1 / -0
CHANGELOG.mdDocument improved Jump-to-field behavior +1/-0

Document improved Jump-to-field behavior

• Adds a changelog entry noting that Jump to field now searches all known fields and auto-adds the selected field if it is not currently visible.

CHANGELOG.md

@qodo-free-for-open-source-projects

qodo-free-for-open-source-projects Bot commented Aug 20, 2026

Copy link
Copy Markdown
Contributor

Code Review by Qodo

🐞 Bugs (0) 📘 Rule violations (0) 📎 Requirement gaps (0) 🎨 UX issues (0) 🔗 Cross-repo conflicts (0) 📜 Skill insights (0)

Grey Divider


Remediation recommended

1. showFieldEditor missing staleness recheck ✓ Resolved 📘 Rule violation ☼ Reliability
Description
AllFieldsTab#showFieldEditor(...) schedules a nested Platform.runLater that performs focus
changes and may open the add-file dialog without re-checking that the tab is still bound to the
original entry, allowing UI changes to apply to stale state. If the entry changes between the
initial guard and the nested callback’s execution, the wrong entry’s editor can be focused and the
add-file dialog can be opened for the wrong entry, violating the runLater staleness-guard
requirement.
Code

jabgui/src/main/java/org/jabref/gui/entryeditor/AllFieldsTab.java[R595-598]

+            Platform.runLater(() -> {
+                requestFocus(field);
+                // Adding the File field via its "+" chip should immediately open the add-file dialog,
+                // since an empty File editor has no other purpose than to receive a file.
Evidence
PR Compliance ID 34 requires deferred JavaFX callbacks to guard against stale state at execution
time. In showFieldEditor, there is an entry-identity guard (`if (getCurrentEntry() != entry)
return;) before scheduling additional deferred work, but the newly added inner Platform.runLater`
runs later than that check and performs requestFocus / addNewFile actions without re-validating
getCurrentEntry() against the original entry, so the entry can change between the check and when
the UI mutation/dialog action actually executes.

jabgui/src/main/java/org/jabref/gui/entryeditor/AllFieldsTab.java[588-602]
jabgui/src/main/java/org/jabref/gui/entryeditor/AllFieldsTab.java[585-603]
Best Practice: Learned patterns

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
`AllFieldsTab#showFieldEditor(...)` uses a nested `Platform.runLater` where the inner callback performs UI mutations (e.g., `requestFocus(...)` and potentially `linkedFilesEditor.addNewFile()`) without verifying that the scheduled work is still current (i.e., the tab is still bound to the same `entry`). Because the guard (`if (getCurrentEntry() != entry) return;`) runs before the nested scheduling, the `entry` can change between the outer check and the inner runnable’s execution, causing focus/actions (including opening the add-file dialog) to apply to the wrong entry.
## Issue Context
There is already an outer deferred block intended to wait for UI rebuild and it checks `getCurrentEntry() != entry` before proceeding, but then it enqueues another deferred callback that can run after the entry/tab state changes again; this weakens the staleness guard and violates the requirement (PR Compliance ID 34) to re-check state at the time deferred work executes.
## Fix Focus Areas
- jabgui/src/main/java/org/jabref/gui/entryeditor/AllFieldsTab.java[585-604]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


2. focus() runLater unguarded ✓ Resolved 📘 Rule violation ☼ Reliability
Description
FieldEditorFX.focus() schedules scrollToVisible(target) via Platform.runLater without checking
that target is still attached/current when the callback runs. This risks applying UI mutations to
stale controls and violates the runLater staleness-guard requirement.
Code

jabgui/src/main/java/org/jabref/gui/fieldeditors/FieldEditorFX.java[R143-146]

+        Node target = findTextInput(getNode()).map(input -> (Node) input).orElseGet(this::getNode);
+        target.requestFocus();
+        Platform.runLater(() -> scrollToVisible(target));
+    }
Evidence
PR Compliance ID 34 requires guarding deferred JavaFX callbacks against stale state. The new
Platform.runLater(() -> scrollToVisible(target)) mutates scroll position later without any
validation that target is still current.

jabgui/src/main/java/org/jabref/gui/fieldeditors/FieldEditorFX.java[142-146]
Best Practice: Learned patterns

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
`FieldEditorFX.focus()` defers scrolling with `Platform.runLater` but does not verify that the `target` node is still valid/attached when the callback executes.
## Issue Context
The compliance rule requires stale-state guards for deferred UI mutations. A simple guard like `if (target.getScene() == null) return;` (or equivalent) inside the callback can prevent stale updates.
## Fix Focus Areas
- jabgui/src/main/java/org/jabref/gui/fieldeditors/FieldEditorFX.java[142-176]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


3. Alias adds wrong field ✓ Resolved 🐞 Bug ≡ Correctness
Description
When a field isn’t currently shown, EntryEditorFocusUtils#setFocusToField falls back to
addFieldViaAllFieldsTab(field) even if an alias exists (e.g., journaljournaltitle). In
BibLaTeX mode this can add the deprecated BibTeX field (journal) instead of the canonical BibLaTeX
field (journaltitle), leading users to edit the wrong field.
Code

jabgui/src/main/java/org/jabref/gui/entryeditor/EntryEditorFocusUtils.java[R75-77]

+                    getTabContainingField(aliasField).ifPresentOrElse(
+                            tab -> selectTabAndField(tab, aliasField),
+                            () -> addFieldViaAllFieldsTab(field));
Evidence
The fallback calls addFieldViaAllFieldsTab(field) after alias lookup fails, but alias mappings
explicitly map BibTeX to BibLaTeX field names (e.g., JOURNAL -> JOURNALTITLE) and BibLaTeX entry
types require the BibLaTeX variant, so adding the original BibTeX field in BibLaTeX mode is
incorrect/deprecated.

jabgui/src/main/java/org/jabref/gui/entryeditor/EntryEditorFocusUtils.java[70-102]
jablib/src/main/java/org/jabref/model/entry/EntryConverter.java[20-39]
jablib/src/main/java/org/jabref/model/entry/types/BiblatexEntryTypeDefinitions.java[17-25]
jablib/src/main/java/org/jabref/model/entry/types/BibtexEntryTypeDefinitions.java[21-25]
jablib/src/main/java/org/jabref/model/entry/BibEntryType.java[88-109]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
`EntryEditorFocusUtils#setFocusToField` checks `EntryConverter.FIELD_ALIASES` but if neither the requested field nor its alias is currently shown, it always falls back to `addFieldViaAllFieldsTab(field)` using the **original** field. For BibTeX↔BibLaTeX alias pairs, this can add a deprecated/non-canonical field in the current database mode (e.g., adding `StandardField.JOURNAL` in BibLaTeX mode where `StandardField.JOURNALTITLE` is the required canonical field).
### Issue Context
- Aliases are explicitly defined as BibTeX→BibLaTeX (`JOURNAL -> JOURNALTITLE`) and inverted.
- BibLaTeX article requires `JOURNALTITLE`, BibTeX article requires `JOURNAL`.
- In BibLaTeX mode, BibTeX-source fields are treated as deprecated.
### Fix Focus Areas
- jabgui/src/main/java/org/jabref/gui/entryeditor/EntryEditorFocusUtils.java[70-102]
- jablib/src/main/java/org/jabref/model/entry/EntryConverter.java[20-39]
### Suggested fix
- Decide which field to add based on active `BibDatabaseMode`:
- If mode is BibLaTeX and `field` is a key in `FIELD_ALIASES_BIBTEX_TO_BIBLATEX`, add the mapped BibLaTeX field.
- If mode is BibTeX and `field` is a key in `FIELD_ALIASES_BIBLATEX_TO_BIBTEX`, add the mapped BibTeX field.
- Otherwise add `field`.
- This likely requires passing `BibDatabaseMode` (or a `StateManager`/context supplier) into `EntryEditorFocusUtils`, since it currently doesn’t know the mode.
- Keep existing behavior when the requested field is already shown (don’t remap in that case).

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


View review recommended (1)
4. Scroll-to-visible is fragile ✓ Resolved 🐞 Bug ☼ Reliability
Description
FieldEditorFX.scrollToVisible assumes the first ScrollPane ancestor has non-null content and
computes offsets by summing layoutY, which is brittle and can NPE if ScrollPane#getContent() is
null. The repo already contains a safer scroll-into-view implementation using scene/local bounds
transforms.
Code

jabgui/src/main/java/org/jabref/gui/fieldeditors/FieldEditorFX.java[R165-170]

+            if (currentNode instanceof ScrollPane scrollPane) {
+                double contentHeight = scrollPane.getContent().getLayoutBounds().getHeight();
+                double viewportHeight = scrollPane.getViewportBounds().getHeight();
+                if (contentHeight > viewportHeight) {
+                    double target = (offsetY - viewportHeight / 2) / (contentHeight - viewportHeight);
+                    scrollPane.setVvalue(Math.clamp(target, 0, 1));
Evidence
The new implementation dereferences scrollPane.getContent() without a null check and uses a
simpler geometry computation than an existing proven approach in WalkthroughScroller that
explicitly guards null content and uses coordinate transforms.

jabgui/src/main/java/org/jabref/gui/fieldeditors/FieldEditorFX.java[142-177]
jabgui/src/main/java/org/jabref/gui/walkthrough/utils/WalkthroughScroller.java[93-112]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
`FieldEditorFX.scrollToVisible` may throw an NPE (`scrollPane.getContent().getLayoutBounds()`) when encountering a `ScrollPane` with null content, and its `layoutY` accumulation is less correct across nested layouts/skins/transforms.
### Issue Context
There is already a robust implementation in `WalkthroughScroller#scrollIntoScrollPane` that:
- null-checks `scrollPane.getContent()`
- uses `localToScene`/`sceneToLocal` bounds transforms
- clamps vValue safely via `Math.max/min`
### Fix Focus Areas
- jabgui/src/main/java/org/jabref/gui/fieldeditors/FieldEditorFX.java[142-177]
- jabgui/src/main/java/org/jabref/gui/walkthrough/utils/WalkthroughScroller.java[93-112]
### Suggested fix
- Replace the `layoutY`-sum approach with the bounds-based approach used in `WalkthroughScroller#scrollIntoScrollPane` (or extract a shared utility).
- At minimum:
- guard `Node content = scrollPane.getContent(); if (content == null) return;`
- compute target position using `Bounds targetBounds = node.localToScene(node.getBoundsInLocal())` and `content.sceneToLocal(targetBounds)`
- clamp with `Math.max(0, Math.min(1, ...))`.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools



Informational

5. getFieldNames() uses Collectors ✓ Resolved 📘 Rule violation ⚙ Maintainability
Description
getFieldNames() uses .collect(Collectors.toList()) in new code where modern Java allows the
simpler .toList(). This introduces a less-preferred legacy pattern.
Code

jabgui/src/main/java/org/jabref/gui/entryeditor/JumpToFieldViewModel.java[R33-35]

+                           .distinct()
+                           .sorted()
+                           .collect(Collectors.toList());
Evidence
PR Compliance ID 2 requires preferring modern Java APIs where applicable. The modified method ends
the stream pipeline with .collect(Collectors.toList()) rather than toList().

AGENTS.md: Use Modern Java APIs and Data Structures: AGENTS.md: Use Modern Java APIs and Data Structures: AGENTS.md: Use Modern Java APIs and Data Structures: AGENTS.md: Use Modern Java APIs and Data Structures: AGENTS.md: Use Modern Java APIs and Data Structures: AGENTS.md: Use Modern Java APIs and Data Structures: AGENTS.md: Use Modern Java APIs and Data Structures: AGENTS.md: Use Modern Java APIs and Data Structures: AGENTS.md: Use Modern Java APIs and Data Structures: AGENTS.md: Use Modern Java APIs and Data Structures: AGENTS.md: Use Modern Java APIs and Data Structures: AGENTS.md: Use Modern Java APIs and Data Structures: AGENTS.md: Use Modern Java APIs and Data Structures: AGENTS.md: Use Modern Java APIs and Data Structures: AGENTS.md: Use Modern Java APIs and Data Structures: AGENTS.md: Use Modern Java APIs and Data Structures: AGENTS.md: Use Modern Java APIs and Data Structures: AGENTS.md: Use Modern Java APIs and Data Structures: AGENTS.md: Use Modern Java APIs and Data Structures: AGENTS.md: Use Modern Java APIs and Data Structures: AGENTS.md: Use Modern Java APIs and Data Structures: AGENTS.md: Use Modern Java APIs and Data Structures: AGENTS.md: Use Modern Java APIs and Data Structures: AGENTS.md: Use Modern Java APIs and Data Structures: AGENTS.md: Use Modern Java APIs and Data Structures: AGENTS.md: Use Modern Java APIs and Data Structures: AGENTS.md: Use Modern Java APIs and Data Structures: AGENTS.md: Use Modern Java APIs and Data Structures: AGENTS.md: Use Modern Java APIs and Data Structures: AGENTS.md: Use Modern Java APIs and Data Structures: AGENTS.md: Use Modern Java APIs and Data Structures: AGENTS.md: Use Modern Java APIs and Data Structures: AGENTS.md: Use Modern Java APIs and Data Structures: AGENTS.md: Use Modern Java APIs and Data Structures: AGENTS.md: Use Modern Java APIs and Data Structures: AGENTS.md: Use Modern Java APIs and Data Structures: AGENTS.md: Use Modern Java APIs and Data Structures: AGENTS.md: Use Modern Java APIs and Data Structures: AGENTS.md: Use Modern Java APIs and Data Structures: AGENTS.md: Use Modern Java APIs and Data Structures: AGENTS.md: Use Modern Java APIs and Data Structures: AGENTS.md: Use Modern Java APIs and Data Structures: AGENTS.md: Use Modern Java APIs and Data Structures: AGENTS.md: Use Modern Java APIs and Data Structures: AGENTS.md: Use Modern Java APIs and Data Structures: AGENTS.md: Use Modern Java APIs and Data Structures: AGENTS.md: Use Modern Java APIs and Data Structures: AGENTS.md: Use Modern Java APIs and Data Structures: AGENTS.md: Use Modern Java APIs and Data Structures: AGENTS.md: Use Modern Java APIs and Data Structures: AGENTS.md: Use Modern Java APIs and Data Structures: AGENTS.md: Use Modern Java APIs and Data Structures: AGENTS.md: Use Modern Java APIs and Data Structures: AGENTS.md: Use Modern Java APIs and Data Structures: AGENTS.md: Use Modern Java APIs and Data Structures: AGENTS.md: Use Modern Java APIs and Data Structures: AGENTS.md: Use Modern Java APIs and Data Structures: AGENTS.md: Use Modern Java APIs and Data Structures: AGENTS.md: Use Modern Java APIs and Data Structures: AGENTS.md: Use Modern Java APIs and Data Structures: AGENTS.md: Use Modern Java APIs and Data Structures: AGENTS.md: Use Modern Java APIs and Data Structures: AGENTS.md: Use Modern Java APIs and Data Structures: AGENTS.md: Use Modern Java APIs and Data Structures: AGENTS.md: Use Modern Java APIs and Data Structures: AGENTS.md: Use Modern Java APIs and Data Structures: AGENTS.md: Use Modern Java APIs and Data Structures: AGENTS.md: Use Modern Java APIs and Data Structures: AGENTS.md: Use Modern Java APIs and Data Structures: AGENTS.md: Use Modern Java APIs and Data Structures: AGENTS.md: Use Modern Java APIs and Data Structures: AGENTS.md: Use Modern Java APIs and Data Structures: AGENTS.md: Use Modern Java APIs and Data Structures: AGENTS.md: Use Modern Java APIs and Data Structures: AGENTS.md: Use Modern Java APIs and Data Structures: AGENTS.md: Use Modern Java APIs and Data Structures: AGENTS.md: Use Modern Java APIs and Data Structures: AGENTS.md: Use Modern Java APIs and Data Structures: AGENTS.md: Use Modern Java APIs and Data Structures: AGENTS.md: Use Modern Java APIs and Data Structures: AGENTS.md: Use Modern Java APIs and Data Structures: AGENTS.md: Use Modern Java APIs and Data Structures: AGENTS.md: Use Modern Java APIs and Data Structures: AGENTS.md: Use Modern Java APIs and Data Structures: AGENTS.md: Use Modern Java APIs and Data Structures: AGENTS.md: Use Modern Java APIs and Data Structures: AGENTS.md: Use Modern Java APIs and Data Structures: AGENTS.md: Use Modern Java APIs and Data Structures: AGENTS.md: Use Modern Java APIs and Data Structures: AGENTS.md: Use Modern Java APIs and Data Structures: AGENTS.md: Use Modern Java APIs and Data Structures: AGENTS.md: Use Modern Java APIs and Data Structures: AGENTS.md: Use Modern Java APIs and Data Structures: AGENTS.md: Use Modern Java APIs and Data Structures: AGENTS.md: Use Modern Java APIs and Data Structures: AGENTS.md: Use Modern Java APIs and Data Structures: AGENTS.md: Use Modern Java APIs and Data Structures: AGENTS.md: Use Modern Java APIs and Data Structures: AGENTS.md: Use Modern Java APIs and Data Structures: AGENTS.md: Use Modern Java APIs and Data Structures: AGENTS.md: Use Modern Java APIs and Data Structures: AGENTS.md: Use Modern Java APIs and Data Structures: AGENTS.md: Use Modern Java APIs and Data Structures: AGENTS.md: Use Modern Java APIs and Data Structures: AGENTS.md: Use Modern Java APIs and Data Structures: AGENTS.md: Use Modern Java APIs and Data Structures: AGENTS.md: Use Modern Java APIs and Data Structures: AGENTS.md: Use Modern Java APIs and Data Structures: AGENTS.md: Use Modern Java APIs and Data Structures: AGENTS.md: Use Modern Java APIs and Data Structures: AGENTS.md: Use Modern Java APIs and Data Structures: AGENTS.md: Use Modern Java APIs and Data Structures: AGENTS.md: Use Modern Java APIs and Data Structures: AGENTS.md: Use Modern Java APIs and Data Structures: AGENTS.md: Use Modern Java APIs and Data Structures: AGENTS.md: Use Modern Java APIs and Data Structures: AGENTS.md: Use Modern Java APIs and Data Structures: AGENTS.md: Use Modern Java APIs and Data Structures: AGENTS.md: Use Modern Java APIs and Data Structures: AGENTS.md: Use Modern Java APIs and Data Structures: AGENTS.md: Use Modern Java APIs and Data Structures: AGENTS.md: Use Modern Java APIs and Data Structures: AGENTS.md: Use Modern Java APIs and Data Structures: AGENTS.md: Use Modern Java APIs and Data Structures: AGENTS.md: Use Modern Java APIs and Data Structures: AGENTS.md: Use Modern Java APIs and Data Structures: AGENTS.md: Use Modern Java APIs and Data Structures: AGENTS.md: Use Modern Java APIs and Data Structures: AGENTS.md: Use Modern Java APIs and Data Structures: AGENTS.md: Use Modern Java APIs and Data Structures: AGENTS.md: Use Modern Java APIs and Data Structures: AGENTS.md: Use Modern Java APIs and Data Structures: AGENTS.md: Use Modern Java APIs and Data Structures: AGENTS.md: Use Modern Java APIs and Data Structures: AGENTS.md: Use Modern Java APIs and Data Structures: AGENTS.md: Use Modern Java APIs and Data Structures: AGENTS.md: Use Modern Java APIs and Data Structures: AGENTS.md: Use Modern Java APIs and Data Structures: AGENTS.md: Use Modern Java APIs and Data Structures: AGENTS.md: Use Modern Java APIs and Data Structures: AGENTS.md: Use Modern Java APIs and Data Structures: AGENTS.md: Use Modern Java APIs and Data Structures: AGENTS.md: Use Modern Java APIs and Data Structures: AGENTS.md: Use Modern Java APIs and Data Structures: AGENTS.md: Use Modern Java APIs and Data Structures: AGENTS.md: Use Modern Java APIs and Data Structures: AGENTS.md: Use Modern Java APIs and Data Structures: AGENTS.md: Use Modern Java APIs and Data Structures: AGENTS.md: Use Modern Java APIs and Data Structures: AGENTS.md: Use Modern Java APIs and Data Structures: AGENTS.md: Use Modern Java APIs and Data Structures: AGENTS.md: Use Modern Java APIs and Data Structures: AGENTS.md: Use Modern Java APIs and Data Structures: AGENTS.md: Use Modern Java APIs and Data Structures: AGENTS.md: Use Modern Java APIs and Data Structures: AGENTS.md: Use Modern Java APIs and Data Structures: AGENTS.md: Use Modern Java APIs and Data Structures: AGENTS.md: Use Modern Java APIs and Data Structures: AGENTS.md: Use Modern Java APIs and Data Structures: AGENTS.md: Use Modern Java APIs and Data Structures: AGENTS.md: Use Modern Java APIs and Data Structures: AGENTS.md: Use Modern Java APIs and Data Structures: AGENTS.md: Use Modern Java APIs and Data Structures: AGENTS.md: Use Modern Java APIs and Data Structures: AGENTS.md: Use Modern Java APIs and Data Structures: AGENTS.md: Use Modern Java APIs and Data Structures: AGENTS.md: Use Modern Java APIs and Data Structures: AGENTS.md: Use Modern Java APIs and Data Structures: AGENTS.md: Use Modern Java APIs and Data Structures: AGENTS.md: Use Modern Java APIs and Data Structures: AGENTS.md: Use Modern Java APIs and Data Structures: AGENTS.md: Use Modern Java APIs and Data Structures: AGENTS.md: Use Modern Java APIs and Data Structures: AGENTS.md: Use Modern Java APIs and Data Structures: AGENTS.md: Use Modern Java APIs and Data Structures: AGENTS.md: Use Modern Java APIs and Data Structures: AGENTS.md: Use Modern Java APIs and Data Structures: AGENTS.md: Use Modern Java APIs and Data Structures: AGENTS.md: Use Modern Java APIs and Data Structures: AGENTS.md: Use Modern Java APIs and Data Structures: AGENTS.md: Use Modern Java APIs and Data Structures: AGENTS.md: Use Modern Java APIs and Data Structures: AGENTS.md: Use Modern Java APIs and Data Structures: AGENTS.md: Use Modern Java APIs and Data Structures: AGENTS.md: Use Modern Java APIs and Data Structures: AGENTS.md: Use Modern Java APIs and Data Structures: AGENTS.md: Use Modern Java APIs and Data Structures: AGENTS.md: Use Modern Java APIs and Data Structures: AGENTS.md: Use Modern Java APIs and Data Structures: AGENTS.md: Use Modern Java APIs and Data Structures: AGENTS.md: Use Modern Java APIs and Data Structures: AGENTS.md: Use Modern Java APIs and Data Structures: AGENTS.md: Use Modern Java APIs and Data Structures: AGENTS.md: Use Modern Java APIs and Data Structures: AGENTS.md: Use Modern Java APIs and Data Structures: AGENTS.md: Use Modern Java APIs and Data Structures: AGENTS.md: Use Modern Java APIs and Data Structures: AGENTS.md: Use Modern Java APIs and Data Structures: AGENTS.md: Use Modern Java APIs and Data Structures: AGENTS.md: Use Modern Java APIs and Data Structures: AGENTS.md: Use Modern Java APIs and Data Structures: AGENTS.md: Use Modern Java APIs and Data Structures: AGENTS.md: Use Modern Java APIs and Data Structures: AGENTS.md: Use Modern Java APIs and Data Structures: AGENTS.md: Use Modern Java APIs and Data Structures: AGENTS.md: Use Modern Java APIs and Data Structures: AGENTS.md: Use Modern Java APIs and Data Structures: AGENTS.md: Use Modern Java APIs and Data Structures: AGENTS.md: Use Modern Java APIs and Data Structures: AGENTS.md: Use Modern Java APIs and Data Structures: AGENTS.md: Use Modern Java APIs and Data Structures: AGENTS.md: Use Modern Java APIs and Data Structures: AGENTS.md: Use Modern Java APIs and Data Structures: AGENTS.md: Use Modern Java APIs and Data Structures: AGENTS.md: Use Modern Java APIs and Data Structures: AGENTS.md: Use Modern Java APIs and Data Structures: AGENTS.md: Use Modern Java APIs and Data Structures: AGENTS.md: Use Modern Java APIs and Data Structures: AGENTS.md: Use Modern Java APIs and Data Structures: AGENTS.md: Use Modern Java APIs and Data Structures: AGENTS.md: Use Modern Java APIs and Data Structures: AGENTS.md: Use Modern Java APIs and Data Structures: AGENTS.md: Use Modern Java APIs and Data Structures: AGENTS.md: Use Modern Java APIs and Data Structures: AGENTS.md: Use Modern Java APIs and Data Structures: AGENTS.md: Use Modern Java APIs and Data Structures: AGENTS.md: Use Modern Java APIs and Data Structures: AGENTS.md: Use Modern Java APIs and Data Structures: AGENTS.md: Use Modern Java APIs and Data Structures: AGENTS.md: Use Modern Java APIs and Data Structures: AGENTS.md: Use Modern Java APIs and Data Structures: AGENTS.md: Use Modern Java APIs and Data Structures: AGENTS.md: Use Modern Java APIs and Data Structures: AGENTS.md: Use Modern Java APIs and Data Structures: AGENTS.md: Use Modern Java APIs and Data Structures: AGENTS.md: Use Modern Java APIs and Data Structures: AGENTS.md: Use Modern Java APIs and Data Structures: AGENTS.md: Use Modern Java APIs and Data Structures: AGENTS.md: Use Modern Java APIs and Data Structures: AGENTS.md: Use Modern Java APIs and Data Structures: AGENTS.md: Use Modern Java APIs and Data Structures: AGENTS.md: Use Modern Java APIs and Data Structures: AGENTS.md: Use Modern Java APIs and Data Structures: AGENTS.md: Use Modern Java APIs and Data Structures: AGENTS.md: Use Modern Java APIs and Data Structures: AGENTS.md: Use Modern Java APIs and Data Structures: AGENTS.md: Use Modern Java APIs and Data Structures: AGENTS.md: Use Modern Java APIs and Data Structures: AGENTS.md: Use Modern Java APIs and Data Structures: AGENTS.md: Use Modern Java APIs and Data Structures: AGENTS.md: Use Modern Java APIs and Data Structures: AGENTS.md: Use Modern Java APIs and Data Structures: AGENTS.md: Use Modern Java APIs and Data Structures: AGENTS.md: Use Modern Java APIs and Data Structures: AGENTS.md: Use Modern Java APIs and Data Structures: AGENTS.md: Use Modern Java APIs and Data Structures
jabgui/src/main/java/org/jabref/gui/entryeditor/JumpToFieldViewModel.java[31-35]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
New stream code uses `.collect(Collectors.toList())` instead of the modern `.toList()`.
## Issue Context
The project targets modern Java (toolchain/release), so prefer `Stream.toList()` for readability and consistency.
## Fix Focus Areas
- jabgui/src/main/java/org/jabref/gui/entryeditor/JumpToFieldViewModel.java[26-36]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


Grey Divider

Tip of the day
💡 Did you know, you can hide the parts of a finding you never read, like the evidence or the agent prompt

More tips ↗ | Customize Qodo ↗ | Qodo docs ↗

Grey Divider

Qodo Logo

Comment thread jabgui/src/main/java/org/jabref/gui/entryeditor/AllFieldsTab.java
Comment thread jabgui/src/main/java/org/jabref/gui/fieldeditors/FieldEditorFX.java Outdated
Comment thread jabgui/src/main/java/org/jabref/gui/entryeditor/JumpToFieldViewModel.java Outdated
Comment thread jabgui/src/main/java/org/jabref/gui/entryeditor/EntryEditorFocusUtils.java Outdated
Comment thread jabgui/src/main/java/org/jabref/gui/fieldeditors/FieldEditorFX.java Outdated
@github-actions github-actions Bot added the status: changes-required Pull requests that are not yet complete label Aug 20, 2026
@github-actions github-actions Bot added status: no-bot-comments and removed status: changes-required Pull requests that are not yet complete labels Aug 20, 2026
@subhramit

Copy link
Copy Markdown
Member

Thank you for the clean PR, the video, and the honest writeups. We will review this soon.

@ThiloteE

ThiloteE commented Aug 21, 2026

Copy link
Copy Markdown
Member

Tried this PR on my machine. Mostly works.

If users have custom entry-editor tabs with duplicated fields in the main tab, it will jump to the custom tab first, which I like.

I found one problem: ctrl+j only works, if an entry editor tab is actually selected (e.g. by left-click). Maybe this was also the reason why I thought it was broken.

How to reproduce:

  1. Start JabRef and open a library containing an entry
  2. Double click on an entry
  3. Press ctrl + j
  4. See that the dialog opens (good). Cancel with ESC
  5. Left-click on another entry in the main entry table
  6. Press ctrl + j
  7. See that the dialog does NOT open (bad).

The keybinding doesn't seem to be global or maybe this is a listener / sync issue between currently opened editor tab.

@adeifv

adeifv commented Aug 22, 2026

Copy link
Copy Markdown
Contributor Author

Tried this PR on my machine. Mostly works.

If users have custom entry-editor tabs with duplicated fields in the main tab, it will jump to the custom tab first, which I like.

I found one problem: ctrl+j only works, if an entry editor tab is actually selected (e.g. by left-click). Maybe this was also the reason why I thought it was broken.
...

@ThiloteE , Thanks for the feedback.
This issue is inherited from main too.
After double-clicking an entry, then left-clicking another entry or moving with the arrow keys, it moves keyboard focus into the main table. As the ctrl+j handler was registered locally, the shortcut silently stops working whenever focus sits outside the editor.
also the next/previous-entry shortcuts (alt+up/alt+down) fail for the same reason. this is barely noticeable, as in practice for navigating entries one mostly uses the plain up/down arrows anyway.
and the only way to use ctrl+j again is to double-click the entry once more, which isn't practical during normal browsing.

After the fix, the handler now lives at the frame level. It stays a no-op while the entry editor is hidden, so behavior is otherwise unchanged.

Could you give it another try?

@LoayTarek5 LoayTarek5 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Solid work @adeifv.
just small things, also i see that no requirement exists for jump-to-field, so i think it worth adding

Comment thread jabgui/src/main/java/org/jabref/gui/entryeditor/EntryEditorFocusUtils.java Outdated
Comment thread jabgui/src/main/java/org/jabref/gui/entryeditor/EntryEditor.java
Comment thread jabgui/src/main/java/org/jabref/gui/entryeditor/AllFieldsTab.java
Comment thread jabgui/src/main/java/org/jabref/gui/fieldeditors/FieldEditorFX.java Outdated
Comment thread jabgui/src/main/java/org/jabref/gui/fieldeditors/FieldEditorFX.java Outdated
Comment thread jabgui/src/main/java/org/jabref/gui/entryeditor/JumpToFieldViewModel.java Outdated
Comment thread jabgui/src/main/java/org/jabref/gui/entryeditor/AllFieldsTab.java
@github-actions github-actions Bot added status: changes-required Pull requests that are not yet complete and removed status: no-bot-comments labels Aug 23, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Do not request reviews if changes are required.
Address the changes first.

@koppor
koppor removed the request for review from LoayTarek5 August 24, 2026 06:59
@github-actions github-actions Bot added status: no-bot-comments and removed status: changes-required Pull requests that are not yet complete labels Aug 24, 2026
@adeifv
adeifv requested a review from LoayTarek5 August 24, 2026 07:01
@koppor koppor added status: ready-for-review Pull Requests that are ready to be reviewed by the maintainers and removed status: no-bot-comments labels Aug 24, 2026
@koppor
koppor requested a review from Siedlerchr August 24, 2026 21:27
@koppor koppor added the status: awaiting-second-review For non-trivial changes label Aug 24, 2026

@LoayTarek5 LoayTarek5 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good so far @adeifv, just small things, and i think it is good to go

Comment thread jabgui/src/main/java/org/jabref/gui/entryeditor/EntryEditorFocusUtils.java Outdated
.findFirst();
}

private void addFieldViaAllFieldsTab(Field field) {

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If the main tab is hidden in preferences, findFirst is empty and ctrl+j silently does nothing

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Now it checks whether the All Fields tab is present before opening the dialog and shows a notification if it's disabled. what do u think?
Screenshot from 2026-08-25 15-04-26

Comment thread jabgui/src/main/java/org/jabref/gui/entryeditor/AllFieldsTab.java
@github-actions github-actions Bot added status: changes-required Pull requests that are not yet complete and removed status: ready-for-review Pull Requests that are ready to be reviewed by the maintainers status: awaiting-second-review For non-trivial changes labels Aug 25, 2026
@github-actions github-actions Bot added status: no-bot-comments and removed status: changes-required Pull requests that are not yet complete labels Aug 25, 2026
@adeifv
adeifv requested a review from LoayTarek5 August 25, 2026 12:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Jump to field (ctrl + j) in the entry editor doesn't work

5 participants