Skip to content

Conversation

@abhishek9773
Copy link
Contributor

@abhishek9773 abhishek9773 commented Jan 11, 2026

User description

Closes #14821

Steps to test

  1. welcome screen -> in start section ->(click) new empty Library
  2. (JabRef Main menu bar) -> (click) Library -> Add entry .
  3. Observe Empty State: Navigate to the General tab; verify icons are hidden for empty DOI/Eprint fields .
  4. Trigger Icons: Type text; icons should appear immediately.
  5. Verify Layout: Clear text; icons should disappear and layout should expand.
  6. For one more field verify -> Step 3 switch to Optional fields -> ISBN (Observe step-4,5 behaviour )

Visual Verification

Screencast.from.11-01-26.03.01.55.PM.IST.webm

Mandatory checks

LLM USED: HELPED ME IN ARCHITECTURAL DECISION AND TEST CASE WRITING


PR Type

Enhancement


Description

  • Bind identifier action buttons visibility to text field state

  • Buttons automatically hide when field is empty, decluttering UI

  • Applies to Fetch, Lookup, and Shorten buttons for DOI, Eprint, ISBN fields

  • Managed property synced with visibility for proper layout expansion


Diagram Walkthrough

flowchart LR
  textField["Text Field"] -- "isNotEmpty()" --> visibility["Button Visibility"]
  visibility -- "bind" --> managed["Button Managed Property"]
  managed --> buttons["Fetch, Lookup, Shorten Buttons"]
Loading

File Walkthrough

Relevant files
Enhancement
IdentifierEditor.java
Bind identifier buttons visibility to text field state     

jabgui/src/main/java/org/jabref/gui/fieldeditors/identifier/IdentifierEditor.java

  • Added reactive property bindings for three identifier action buttons
  • Buttons' visibility property bound to
    viewModel.textProperty().isNotEmpty()
  • Buttons' managed property bound to their visibility property
  • Ensures buttons hide when field is empty and expand layout accordingly
+6/-0     

@qodo-free-for-open-source-projects
Copy link
Contributor

qodo-free-for-open-source-projects bot commented Jan 11, 2026

PR Compliance Guide 🔍

Below is a summary of compliance checks for this PR:

Security Compliance
🟢
No security concerns identified No security vulnerabilities detected by AI analysis. Human verification advised for critical code.
Ticket Compliance
🎫 No ticket provided
  • Create ticket/issue
Codebase Duplication Compliance
Codebase context is not defined

Follow the guide to enable codebase context checks.

Custom Compliance
🟢
Generic: Comprehensive Audit Trails

Objective: To create a detailed and reliable record of critical system actions for security analysis
and compliance.

Status: Passed

Learn more about managing compliance generic rules or creating your own custom rules

Generic: Meaningful Naming and Self-Documenting Code

Objective: Ensure all identifiers clearly express their purpose and intent, making code
self-documenting

Status: Passed

Learn more about managing compliance generic rules or creating your own custom rules

Generic: Robust Error Handling and Edge Case Management

Objective: Ensure comprehensive error handling that provides meaningful context and graceful
degradation

Status: Passed

Learn more about managing compliance generic rules or creating your own custom rules

Generic: Secure Error Handling

Objective: To prevent the leakage of sensitive system information through error messages while
providing sufficient detail for internal debugging.

Status: Passed

Learn more about managing compliance generic rules or creating your own custom rules

Generic: Secure Logging Practices

Objective: To ensure logs are useful for debugging and auditing without exposing sensitive
information like PII, PHI, or cardholder data.

Status: Passed

Learn more about managing compliance generic rules or creating your own custom rules

Generic: Security-First Input Validation and Data Handling

Objective: Ensure all data inputs are validated, sanitized, and handled securely to prevent
vulnerabilities

Status: Passed

Learn more about managing compliance generic rules or creating your own custom rules

  • Update
Compliance status legend 🟢 - Fully Compliant
🟡 - Partial Compliant
🔴 - Not Compliant
⚪ - Requires Further Human Verification
🏷️ - Compliance label

@qodo-free-for-open-source-projects
Copy link
Contributor

qodo-free-for-open-source-projects bot commented Jan 11, 2026

PR Code Suggestions ✨

Explore these optional code suggestions:

CategorySuggestion                                                                                                                                    Impact
Possible issue
Conditionally show button for specific field
Suggestion Impact:The commit directly implements the suggestion by removing shortenDOIButton from the stream of buttons that are shown for all identifier types, and adding conditional logic to only show it when the field is DOI. The implementation matches the suggested approach exactly, including binding the managed property and setting visibility based on whether the field is DOI.

code diff:

+        java.util.stream.Stream.of(fetchInformationByIdentifierButton, lookupIdentifierButton)
+                .forEach(button -> {
+                    button.visibleProperty().bind(viewModel.textProperty().isNotEmpty());
+                    button.managedProperty().bind(button.visibleProperty());
+                });
+
+        shortenDOIButton.managedProperty().bind(shortenDOIButton.visibleProperty());
+        if (StandardField.DOI.equals(field)) {
+            shortenDOIButton.visibleProperty().bind(viewModel.textProperty().isNotEmpty());
+        } else {
+            shortenDOIButton.setVisible(false);
+        }

Separate the visibility logic for the shortenDOIButton to ensure it only appears
for the DOI field, instead of for all identifier types.

jabgui/src/main/java/org/jabref/gui/fieldeditors/identifier/IdentifierEditor.java [95-99]

-java.util.stream.Stream.of(fetchInformationByIdentifierButton, lookupIdentifierButton, shortenDOIButton)
+java.util.stream.Stream.of(fetchInformationByIdentifierButton, lookupIdentifierButton)
     .forEach(button -> {
         button.visibleProperty().bind(viewModel.textProperty().isNotEmpty());
         button.managedProperty().bind(button.visibleProperty());
     });
 
+shortenDOIButton.managedProperty().bind(shortenDOIButton.visibleProperty());
+if (DOI.equals(field)) {
+    shortenDOIButton.visibleProperty().bind(viewModel.textProperty().isNotEmpty());
+} else {
+    shortenDOIButton.setVisible(false);
+}
+

[Suggestion processed]

Suggestion importance[1-10]: 8

__

Why: The suggestion correctly identifies a bug where the shortenDOIButton is incorrectly shown for all identifier types, not just for DOI. The proposed fix correctly restricts the button's visibility to only the DOI field, fixing a functional issue introduced by the PR.

Medium
  • Update

@abhishek9773 abhishek9773 force-pushed the fix-issue-14821-identifier-icons branch from 68b98a3 to 6d92a10 Compare January 11, 2026 10:10
@github-actions github-actions bot added the status: changes-required Pull requests that are not yet complete label Jan 11, 2026
@abhishek9773 abhishek9773 force-pushed the fix-issue-14821-identifier-icons branch from 478bf77 to 5a973f7 Compare January 11, 2026 17:44
@github-actions github-actions bot removed the status: changes-required Pull requests that are not yet complete label Jan 12, 2026
Siedlerchr
Siedlerchr previously approved these changes Jan 12, 2026
@Siedlerchr Siedlerchr added this pull request to the merge queue Jan 12, 2026
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Jan 12, 2026
@subhramit
Copy link
Member

subhramit commented Jan 12, 2026

@abhishek9773 thanks for the contribution.
Next time please also make necessary disclosures as per our AI usage policy - whatever you have used AI for.

koppor
koppor previously requested changes Jan 12, 2026
CHANGELOG.md Outdated

### Fixed

- Fixed redundant action icons showing in empty identifier fields (DOI, Eprint, ISBN) [#14831](https://github.com/JabRef/jabref/pull/14831)
Copy link
Member

Choose a reason for hiding this comment

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

@github-actions github-actions bot added the status: changes-required Pull requests that are not yet complete label Jan 12, 2026
@abhishek9773
Copy link
Contributor Author

abhishek9773 commented Jan 13, 2026

Hi @koppor, @subhramit,
​Thanks for the guidance on this. I’ve gone ahead and updated the CHANGELOG.md with the correct issue number (#14821) and fixed the Stream imports and indentation in IdentifierEditor.java to match the project standards.

​I also wanted to be fully transparent about my use of AI on this PR, as per the project policy. As a new contributor, I’ve been using AI as a tool to ensure my code and test cases actually reach the industry standards expected here. For example, in the IdentifierEditorTest, it helped me implement the proper interact() and clickOn() patterns for JavaFX rather than using less robust manual erasures. It's been a great way for me to learn the codebase faster.

​I sincerely apologize for the 'chaos' with the force-pushes. I was trying to keep the history clean as I learned, but I see now that it triggered the build failures and made your review harder.
​I’m not in a rush to merge- I just want to make sure I’m doing things the right way. Please let me know how I should handle the failing checks from the force-push, and I’ll get on it. Thanks again!

@subhramit
Copy link
Member

Hi @koppor, @subhramit,​Thanks for the guidance on this. I’ve gone ahead and updated the CHANGELOG.md with the correct issue number (#14821) and fixed the Stream imports and indentation in IdentifierEditor.java to match the project standards.

​I also wanted to be fully transparent about my use of AI on this PR, as per the project policy. As a new contributor, I’ve been using AI as a tool to ensure my code and test cases actually reach the industry standards expected here. For example, in the IdentifierEditorTest, it helped me implement the proper interact() and clickOn() patterns for JavaFX rather than using less robust manual erasures. It's been a great way for me to learn the codebase faster.

​I sincerely apologize for the 'chaos' with the force-pushes. I was trying to keep the history clean as I learned, but I see now that it triggered the build failures and made your review harder.​I’m not in a rush to merge- I just want to make sure I’m doing things the right way. Please let me know how I should handle the failing checks from the force-push, and I’ll get on it. Thanks again!

Usage of AI to refine code is alright, and thanks for being transparent. However, please try to communicate in your own terms rather than copy pasting LLM responses. Please look at these guidelines. Since you seem to have understood your changes, you are also expected to write the PR description yourself instead of generating it using an LLM.
As an avid open source community, we prefer to interact organically with people.

@abhishek9773
Copy link
Contributor Author

abhishek9773 commented Jan 13, 2026

@subhramit Thank you for pointing me out. from now onwards I will make sure that I am following all the points you have mentioned

Siedlerchr
Siedlerchr previously approved these changes Jan 14, 2026
@Siedlerchr Siedlerchr enabled auto-merge January 14, 2026 18:47
@Siedlerchr Siedlerchr added this pull request to the merge queue Jan 14, 2026
@subhramit subhramit removed this pull request from the merge queue due to a manual request Jan 14, 2026
@subhramit
Copy link
Member

@abhishek9773 not sure why you clicked on "resolve conversation" without acting on review changes

@subhramit subhramit enabled auto-merge January 14, 2026 19:03
@github-actions github-actions bot removed the status: changes-required Pull requests that are not yet complete label Jan 14, 2026
@subhramit subhramit added this pull request to the merge queue Jan 14, 2026
Merged via the queue into JabRef:main with commit 870414f Jan 14, 2026
50 checks passed
@abhishek9773
Copy link
Contributor Author

@abhishek9773 not sure why you clicked on "resolve conversation" without acting on review changes

it was mistake . i made changes to "changelog.md" file but forgot to add those changes during ">git add" and mistakenly assumed i had done so.
image (1)

image (3)

@subhramit
Copy link
Member

@abhishek9773 not sure why you clicked on "resolve conversation" without acting on review changes

it was mistake . i made changes to "changelog.md" file but forgot to add those changes during ">git add" and mistakenly assumed i had done so. image (1)

image (3)

look for this "outdated" label before resolving conversations:
image

Siedlerchr added a commit to st-rm-ng/jabref that referenced this pull request Jan 17, 2026
* upstream/main: (64 commits)
  New Crowdin updates (JabRef#14862)
  Make JDK25 available (JabRef#14861)
  Fix empty entries array when exporting group chat to JSON (JabRef#14814)
  feat: add right-click copy context menu to AI chat messages (JabRef#14722)
  FIX : generic error dialog and icon in Source Tab parsing (JabRef#14828)
  Factor out setup-* actions (JabRef#14859)
  Link .http files.
  Update dependency org.postgresql:postgresql to v42.7.9 (JabRef#14857)
  Add more commands to JabSrv (JabRef#14855)
  Fix JabRef#14821: Hide identifier action buttons when field is empty (JabRef#14831)
  Add GH_TOKEN to closed issues/PRs processing step
  New Crowdin updates (JabRef#14854)
  New Crowdin updates (JabRef#14849)
  Chore(deps): Bump jablib/src/main/resources/csl-styles from `0201999` to `f345aa8` (JabRef#14833)
  Add support for book front covers, again (JabRef#14777)
  Readd min width to button in new enty dialog (JabRef#14791)
  Replace plugin impl from jbang plugin (JabRef#14846)
  Revise AI policy wording
  Chore(deps): Bump jablib/src/main/resources/csl-locales (JabRef#14677)
  Update dependency com.konghq:unirest-modules-gson to v4.7.1 (JabRef#14845)
  ...
Copy link
Member

@koppor koppor left a comment

Choose a reason for hiding this comment

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

The concept of JabRef is to DISABLE buttons, not to hide.

This PR trashed the functionality to look up a DOI. Look up means: If there is no DOI, search the net for it.


Stream.of(fetchInformationByIdentifierButton, lookupIdentifierButton)
.forEach(button -> {
button.visibleProperty().bind(viewModel.textProperty().isNotEmpty());
Copy link
Member

Choose a reason for hiding this comment

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

Did someone understand what "lookup" means?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I misunderstood the behavior and took the word “hide” literally.
I also understand that “lookup” should work even when there is no DOI, by searching online.

I can change the code to disable instead of hide. Is this what you mean?

Copy link
Member

Choose a reason for hiding this comment

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

Thank you for the offer. Your past PR needed more than 10 comments of two different maintainers. Still the code did not work. Your code is just hacky - and did not build on existing (!) JavaFX code. Thus, we should save the time of both you and the team. -- In future, please first read around at the code base. The IdentifierEditor is a very nice example to learn about JavaFX bindings and general UI principles in JavaFX. You missed this opportunity.

I already fixed it at #14931.

button.managedProperty().bind(button.visibleProperty());
});

shortenDOIButton.managedProperty().bind(shortenDOIButton.visibleProperty());
Copy link
Member

Choose a reason for hiding this comment

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

The code totally overlooked org.jabref.gui.fieldeditors.identifier.BaseIdentifierEditorViewModel#canShortenIdentifier

@koppor koppor mentioned this pull request Jan 26, 2026
5 tasks
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.

Eprint field shows an additional action icon/control on the General tab even when no eprint/eprinttype is set

5 participants