Skip to content

Pressing TAB in last field in entry editor moves focus to the next tab's first field #13870

Merged
calixtus merged 18 commits into
JabRef:mainfrom
tejjgv:fix-issue-11937
Sep 14, 2025
Merged

Pressing TAB in last field in entry editor moves focus to the next tab's first field #13870
calixtus merged 18 commits into
JabRef:mainfrom
tejjgv:fix-issue-11937

Conversation

@tejjgv

@tejjgv tejjgv commented Sep 13, 2025

Copy link
Copy Markdown
Contributor

Closes #11937

Description

  • Pressing TAB on the last field of a tab now correctly moves the focus to the first field of the next tab in the EntryEditor.

  • The navigation is limited to fields within the EntryEditor and does not move focus to unrelated UI components outside the editor.

  • Added static helper methods in EditorTextField to manage the TAB navigation logic.

  • All TextField instances within SimpleEditor, CitationKeyEditor, PersonsEditor, and MarkdownEditor now have their id set correctly, enabling proper identification as the last field in a tab.

  • Co Contributor: Noah-Martin1

Steps to test

  1. Open JabRef and load any entry in the Entry Editor.
  2. Navigate through the fields in a tab using the TAB key.
  3. When the focus reaches the last field of the current tab, press TAB again.
  4. Verify that the focus moves directly to the first field of the next tab in the Entry Editor.
  5. Repeat the process for multiple tabs to ensure that the focus does not jump to any fields outside the Entry Editor.
  6. Test both single-line and multi-line fields (e.g., SimpleEditor, PersonsEditor, MarkdownEditor) to ensure TAB navigation works consistently.

Mandatory checks

Screen.Recording.2025-09-13.155910.mp4

tejjgv and others added 5 commits September 13, 2025 01:11
# Conflicts:
#	jabgui/src/main/java/org/jabref/gui/entryeditor/EntryEditor.java
#	jabgui/src/main/java/org/jabref/gui/fieldeditors/EditorTextField.java

protected TextInputControl createTextInputControl() {
return isMultiLine ? new EditorTextArea() : new EditorTextField();
protected TextInputControl createTextInputControl(Field field) {

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Method lacks @nonnull annotation for the field parameter. When using nullable parameters, JSpecify annotations should be used to clearly indicate nullability constraints.

Comment thread jabgui/src/main/java/org/jabref/gui/entryeditor/EntryEditor.java Outdated
Comment thread jabgui/src/main/java/org/jabref/gui/entryeditor/EntryEditor.java Outdated
Comment thread jabgui/src/main/java/org/jabref/gui/entryeditor/EntryEditor.java Outdated
Comment thread jabgui/src/main/java/org/jabref/gui/entryeditor/EntryEditor.java Outdated
Comment thread jabgui/src/main/java/org/jabref/gui/entryeditor/EntryEditor.java Outdated
tejjgv and others added 2 commits September 13, 2025 16:33
Co-authored-by: Carl Christian Snethlage <50491877+calixtus@users.noreply.github.com>
@tejjgv tejjgv requested a review from calixtus September 13, 2025 11:28
calixtus
calixtus previously approved these changes Sep 13, 2025
@tejjgv

tejjgv commented Sep 13, 2025

Copy link
Copy Markdown
Contributor Author

@calixtus auto merge check is failing, due to some automayion script issue, and due to that I cant merge

@koppor koppor dismissed calixtus’s stale review September 13, 2025 16:33

The merge-base changed after approval.

Comment thread jabgui/src/main/java/org/jabref/gui/fieldeditors/EditorTextField.java Outdated
@koppor koppor added the status: ready-for-review Pull Requests that are ready to be reviewed by the maintainers label Sep 14, 2025
calixtus
calixtus previously approved these changes Sep 14, 2025
@calixtus calixtus enabled auto-merge September 14, 2025 19:43
Siedlerchr
Siedlerchr previously approved these changes Sep 14, 2025
@calixtus calixtus changed the title Fixed TAB navigation in the EntryEditor so that pressing TAB moves focus to the next tab's first field Pressing TAB in last field in entry editor moves focus to the next tab's first field Sep 14, 2025
Comment thread CHANGELOG.md Outdated
@koppor koppor dismissed stale reviews from Siedlerchr and calixtus via 54d51e2 September 14, 2025 19:49
koppor
koppor previously approved these changes Sep 14, 2025
Comment thread jabgui/src/main/java/org/jabref/gui/entryeditor/EntryEditor.java Outdated
@koppor

koppor commented Sep 14, 2025

Copy link
Copy Markdown
Member

Follow-up (in a new contribution as soon as this is merged): Have Shift+Tab working - jumping from the first field of a tab to the last field of the previous tab 😅. Sorry for not writing this into the issue description.

@trag-bot

trag-bot Bot commented Sep 14, 2025

Copy link
Copy Markdown

@trag-bot didn't find any issues in the code! ✅✨

1 similar comment
@trag-bot

trag-bot Bot commented Sep 14, 2025

Copy link
Copy Markdown

@trag-bot didn't find any issues in the code! ✅✨

@calixtus calixtus added this pull request to the merge queue Sep 14, 2025
auto-merge was automatically disabled September 14, 2025 20:21

Pull Request is not mergeable

Merged via the queue into JabRef:main with commit b11d102 Sep 14, 2025
36 checks passed
@calixtus

Copy link
Copy Markdown
Member

We somewhat prematurely integrated your PR. I'm sorry. When working with it, we encountered some problems there needs to be put some more work into your PR. Just reopen another PR with your branch.

Problems I encountered:

  • Not every editor has an id, so in some cases, JabRef did not select the first editor in the tab or any at all.
  • If the last control in a tab is a button, JabRef selects in the currently visible view the next focusable control instead of switching to the next tab.
  • Actually i was wrong about Platform.runLater and UiThreadExecutor. In this special case, it needs to be runLater to make sure the instructions are put to the end of the execution queue in the Ui Thread after the other tab and the fields are initialized.

@koppor

koppor commented Sep 14, 2025

Copy link
Copy Markdown
Member

Next step: re-open a new PR.

Siedlerchr added a commit that referenced this pull request Sep 17, 2025
* upstream/main:
  Add new check for format (#13909)
  Consistent casing in fieldnames (#13867)
  Revert "Pressing TAB in last field in entry editor moves focus to the next ta…" (#13912)
  Fix YAML
  Fix on-pr-opened-updated.yml syntax
  Pressing TAB in last field in entry editor moves focus to the next tab's first field  (#13870)
  Modularize JabSrv (#13908)
  New translations jabref_en.properties (Italian) (#13907)
  Remove wrong `assert` statement (#13906)
  Add .git-blame-ignore-revs (#13884)
  Do not show transprot info messages (#13904)
  Pubmed api key support (#13899)
  Fix warnings for native access
  Fix automerge workflow (#13903)
  Add comment on issue on binary (#13902)
  Have checkstyle and VCS configuration distributed (#13900)
  Add unknown field to lsp consistency check (#13880)
  Put config for general tab if missing (#13901)
  Fix autosave manager exception on shutdown (#13882)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

component: entry-editor component: ui status: ready-for-review Pull Requests that are ready to be reviewed by the maintainers

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Tab in the last text field in a tab should focus the next tab in the tabs of the entry editor.

4 participants