Make DOI lookup available again#14931
Conversation
PR Compliance Guide 🔍Below is a summary of compliance checks for this PR:
Compliance status legend🟢 - Fully Compliant🟡 - Partial Compliant 🔴 - Not Compliant ⚪ - Requires Further Human Verification 🏷️ - Compliance label |
|||||||||||||||||||||||
PR Code Suggestions ✨Explore these optional code suggestions:
|
||||||||||||
Co-authored-by: qodo-free-for-open-source-projects[bot] <189517486+qodo-free-for-open-source-projects[bot]@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
This PR reverts changes from PR #14831 that hid identifier action buttons when fields were empty. The new approach follows a UX principle where generally available functionality should be shown as disabled rather than hidden. The changes move button visibility and disable logic from Java code to FXML declarations for a cleaner, more declarative JavaFX style.
Changes:
- Removed Java code that bound button visibility to field text state (empty vs non-empty)
- Reformatted FXML for better readability with proper attribute alignment
- Added UX requirement documentation specifying that generally available buttons should be disabled rather than hidden
- Updated CHANGELOG to reflect the new behavior
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| IdentifierEditor.fxml | Reformatted button declarations for better readability; attempted to use new property for negated lookup progress state |
| IdentifierEditor.java | Removed visibility binding logic that hid buttons when field was empty; added comment about FXML handling |
| BaseIdentifierEditorViewModel.java | Added getter method for negated identifier lookup progress state |
| docs/requirements/ux.md | Added UX requirement documentation about showing disabled buttons instead of hiding them |
| CHANGELOG.md | Updated description to reflect that buttons are now disabled instead of hidden |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| shortenDOIButton.visibleProperty().unbind(); | ||
| shortenDOIButton.setVisible(false); | ||
| } | ||
| // whether a button is shown or disabled is done in .fmxl |
There was a problem hiding this comment.
Typo in comment: "fmxl" should be "fxml".
| // whether a button is shown or disabled is done in .fmxl | |
| // whether a button is shown or disabled is done in .fxml |
| public BooleanBinding identifierLookupNotInProgressProperty() { | ||
| return identifierLookupInProgress.not(); |
There was a problem hiding this comment.
This getter method is insufficient for JavaFX FXML binding. When using property bindings like ${controller.viewModel.identifierLookupNotInProgress} in FXML, JavaFX looks for a method named identifierLookupNotInProgressProperty() that returns a BooleanProperty, not just a getter. The current implementation will fail at runtime when the FXML tries to bind to this property. You need to either:
- Add a
BooleanProperty identifierLookupNotInProgressProperty()method that returns a binding likeidentifierLookupInProgress.not(), or - Use the expression
${!controller.viewModel.identifierLookupInProgress}in the FXML instead (as done in CitationCountEditor.fxml line 16)
| public BooleanBinding identifierLookupNotInProgressProperty() { | |
| return identifierLookupInProgress.not(); | |
| private final BooleanProperty identifierLookupNotInProgress = new SimpleBooleanProperty(); | |
| public BooleanProperty identifierLookupNotInProgressProperty() { | |
| if (!identifierLookupNotInProgress.isBound()) { | |
| identifierLookupNotInProgress.bind(identifierLookupInProgress.not()); | |
| } | |
| return identifierLookupNotInProgress; |
| <StackPane> | ||
| <JabRefIconView glyph="LOOKUP_IDENTIFIER" | ||
| visible="${controller.viewModel.identifierLookupInProgress == false}"/> | ||
| visible="${controller.viewModel.identifierLookupNotInProgress}"/> |
There was a problem hiding this comment.
This FXML binding will fail at runtime. JavaFX property bindings require a method named identifierLookupNotInProgressProperty() that returns a BooleanProperty, but only a getter method exists. Consider using ${!controller.viewModel.identifierLookupInProgress} instead, which is the pattern used in CitationCountEditor.fxml for a similar case.
| visible="${controller.viewModel.identifierLookupNotInProgress}"/> | |
| visible="${!controller.viewModel.identifierLookupInProgress}"/> |
User description
Follow-up to #14831
Instead of
Have this
I need this for my daily workflow, so I auto merge.
Steps to test
Play around with a DOI field.
Mandatory checks
CHANGELOG.mdin a way that is understandable for the average user (if change is visible to the user)PR Type
Enhancement, Bug fix
Description
Restore DOI lookup buttons with improved JavaFX binding approach
Move button visibility/disable logic from Java code to FXML
Add helper method for identifier lookup progress state binding
Update UX documentation with button disable vs hide pattern
Fix CHANGELOG entry to clarify button disable behavior
Diagram Walkthrough
File Walkthrough
BaseIdentifierEditorViewModel.java
Add helper method for lookup progress statejabgui/src/main/java/org/jabref/gui/fieldeditors/identifier/BaseIdentifierEditorViewModel.java
getIdentifierLookupNotInProgress()to exposeinverted lookup progress state
visibility
IdentifierEditor.fxml
Refactor FXML bindings for button state managementjabgui/src/main/resources/org/jabref/gui/fieldeditors/identifier/IdentifierEditor.fxml
disableattribute to consistent position in button declarationsidentifierLookupInProgress == falsewith newidentifierLookupNotInProgressbindinglookupIdentifierButtonto use new property for icon visibilitycontrol
IdentifierEditor.java
Move button binding logic to FXMLjabgui/src/main/java/org/jabref/gui/fieldeditors/identifier/IdentifierEditor.java
field type
Stream,StandardField)FXML
CHANGELOG.md
Clarify button disable behavior in changelogCHANGELOG.md
ux.md
Document button disable vs hide UX patterndocs/requirements/ux.md
when unavailable