Add characterization tests for jump-to-field and field-focus scroll behavior - #2
Draft
jaipilot[bot] wants to merge 1 commit into
Draft
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Related PR
Companion evaluation of JabRef#16639 (mirrored here as skrcode/jabref PR #1, head a178cfb).
What this does
This is a test-only companion: it adds two focused JUnit test classes that lock the observable behavior this PR introduces. No production code is changed.
jabgui/src/test/java/org/jabref/gui/entryeditor/JumpToFieldViewModelTest.java: provesJumpToFieldViewModel#getFieldNames()now returns every known field (sorted, distinct), not just fields already shown in the entry editor, and returns an empty list when no entry is being edited.jabgui/src/test/java/org/jabref/gui/fieldeditors/FieldEditorFXFocusTest.java: provesFieldEditorFX#focus()requests focus on the actual nestedTextInputControl(not just the editor's first child), scrolls an ancestorScrollPaneto reveal a field that is below the viewport, and leaves the scroll position untouched when the field already fits in the viewport.Why no production change
The changed production files (AllFieldsTab, EntryEditor, EntryEditorFocusUtils, JumpToFieldViewModel, FieldEditorFX, JabRefFrame) were reviewed for cleanup, performance, and modernization opportunities. The diff is small and already clean: Checkstyle, the
modernizertask, and an OpenRewrite dry-run report no findings, and no unused code, duplication, or measurable hot path exists in the changed paths. The one non-obvious pattern (a double-nestedPlatform.runLaterinAllFieldsTab#showFieldEditor) is a deliberate fix for a real layout-timing bug (see commitadecf23, 'Fix runLater guards') introduced by this same PR's scroll-into-view feature, so it was intentionally left unchanged. No dependency/build version used by the PR's own changed files needed an upgrade.Verification
xvfb-run -a ./gradlew :jabgui:test --tests "org.jabref.gui.entryeditor.JumpToFieldViewModelTest" --tests "org.jabref.gui.fieldeditors.FieldEditorFXFocusTest" --tests "org.jabref.gui.fieldeditors.FieldEditorFXTest"— 8/8 passed, run identically before and after the (empty) production-edit pass../gradlew :jabgui:compileJava :jabgui:compileTestJava :jabgui:checkstyleMain :jabgui:checkstyleTest— clean.xvfb-run -a ./gradlew :jabgui:test --tests "org.jabref.gui.JabGuiArchitectureTest"— passed.:jabgui:testrun shows 11 pre-existing failures unrelated to this PR (live-network download tests such asLinkedFileViewModelTest/DownloadLinkedFileActionTest/BookCoverFetcherTest, and a platform-specific keybinding-label expectation inKeyBindingViewModelTest); confirmed these failures are present on the unmodified PR-head checkout too (e.g.KeyBindingViewModelTestfails identically with our new files removed), so they are pre-existing environment/network issues, not regressions from this companion.AI usage
JAIPilot (automated review/companion-drafting agent). Test-only companion; no production behavior was changed.
Limitations
AllFieldsTab's section-auto-expand-on-focus and theJabRefFrame/EntryEditorJUMP_TO_FIELD routing change were not independently unit-tested: exercising them faithfully requires constructing the full entry-editor tab graph (GuiPreferences, StateManager, JournalAbbreviationRepository, PreviewPanel, etc.), which is disproportionate to this bounded companion and was left to the existing manual/integration test coverage.Generated by JAIPilot Cloud for #1 from Anthropic session
sesn_01Cq7UzDtiytnKR8EjYKpxQs.