Skip to content

Conversation

@ZachCraw
Copy link

@ZachCraw ZachCraw commented Oct 20, 2025

Closes #12276

Co-developed with @evealitaylor

This pull request introduces a "Jump to Field" feature within the entry editor, accessible via the Ctrl+J shortcut. It enhances navigation by allowing users to quickly search for and jump to any field across all tabs. The implementation addresses previous issues with autocomplete by ensuring all possible fields are suggested, and it correctly manages focus to highlight the selected field and allow immediate editing.

Steps to test

  1. Open any library and double-click an entry to open the entry editor.
  2. Press Ctrl+J to open the "Jump to Field" dialog.
  3. Begin typing a field name (e.g., "author" or "journal").
  4. Select a field from the list and press Enter (or click "OK").
  5. Confirm that the dialog closes, the entry editor switches to the correct tab, and the cursor is now focused on the selected field, ready for you to type.
  6. Select a different entry in the main table.
  7. Press Ctrl+J again. The "Jump to Field" dialog should successfully reappear.
  8. Repeat the process to verify that the feature works consistently across different entries.

It should look like so:

2025-10-20.22-02-58.mp4

Mandatory checks

  • I own the copyright of the code submitted and I license it under the MIT license
  • 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 in a way that is understandable for the average user (if change is visible to the user)
  • 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.

Current Issue

  • I do not currently have the ability to do the localisation for languages other than English.
  • Due to the fields being loaded through lazy loading, I am not able to search and find a field until the user has visited the tab that includes that field.

@github-actions
Copy link
Contributor

Hey @ZachCraw!

Thank you for contributing to JabRef! Your help is truly appreciated ❤️.

We have automatic checks in place, based on which you will soon get automated feedback if any of them are failing. We also use TragBot with custom rules that scans your changes and provides some preliminary comments, before a maintainer takes a look. TragBot is still learning, and may not always be accurate. In the "Files changed" tab, you can go through its comments and just click on "Resolve conversation" if you are sure that it is incorrect, or comment on the conversation if you are doubtful.

Please re-check our contribution guide in case of any other doubts related to our contribution workflow.


stateManager.getSelectedEntries().addListener((InvalidationListener) _ -> {
if (stateManager.getSelectedEntries().isEmpty()) {
// [impl->req~entry-editor.keep-showing~1]
Copy link
Member

Choose a reason for hiding this comment

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

please keep this as it referes to implementation spec

);
if (!stateManager.getSelectedEntries().isEmpty()) {
setCurrentlyEditedEntry(stateManager.getSelectedEntries().getFirst());
Platform.runLater(() -> tabbed.requestFocus());
Copy link
Member

Choose a reason for hiding this comment

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

Why do you need Platform.runLater here?

Copy link
Author

@ZachCraw ZachCraw Oct 20, 2025

Choose a reason for hiding this comment

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

I found that this was required to solve a focus-handling issue. Without it, a "race condition" occurs when switching entries: the main table gains focus from the click, and the EntryEditor's simultaneous requestFocus() call is lost. This prevents the EntryEditor from receiving the Ctrl+J key event. Using Platform.runLater defers the focus request until after the table's selection event is processed, ensuring the EntryEditor reliably regains keyboard focus.

Copy link
Member

Choose a reason for hiding this comment

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

So now you are always stealing the focus from the maintable and force it to the entry editor every time the user selects a different entry in the main table? I dont think that this is a desired behaviour.

Copy link
Author

Choose a reason for hiding this comment

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

Yes. If this is not the desired behaviour, what would be? The ability to interact back with the other entries and main window while having the search box open?

Copy link
Member

Choose a reason for hiding this comment

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

No, leaving the focus in the maintable. Think of a user navigating with the arrowkeys in the maintable.

Comment on lines +13 to +15
record JumpToField() implements UiCommand {
}

Copy link
Member

Choose a reason for hiding this comment

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

Is this used anywhere?

Comment on lines +264 to +267
case JUMP_TO_FIELD:
showJumpToFieldDialog();
event.consume();
break;
Copy link
Member

Choose a reason for hiding this comment

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

Maybe this should go in the scene hierarchy more up, if you want it to be callable from the entry editor and from the maintable alike.

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.

Add Ctrl+J to jump to a field

3 participants