Skip to content

Fix: Disable AI Export button when chat history is empty#14667

Merged
calixtus merged 5 commits into
JabRef:mainfrom
TimeTriggerx:fix-ai-export-button-state
Dec 21, 2025
Merged

Fix: Disable AI Export button when chat history is empty#14667
calixtus merged 5 commits into
JabRef:mainfrom
TimeTriggerx:fix-ai-export-button-state

Conversation

@TimeTriggerx

@TimeTriggerx TimeTriggerx commented Dec 20, 2025

Copy link
Copy Markdown
Contributor

Closes #14640

This PR ensures that the AI Export button is dynamically disabled when the chat history is empty.
A JavaFX binding was implemented in the AiChatComponent controller to bind the MenuButton.disableProperty() to the empty state of the chat history observable list.
This guarantees consistent behavior across both the Entry Editor AI tab and the "Chat with groups" window, as they share the same underlying component.

Steps to test

  1. Initial State

    • Open JabRef and navigate to an entry with an attached PDF.
    • Open the AI chat tab.
    • Verify that the Export button is disabled by default when no chat messages are present.
  2. Enabled State

    • Send a message in the AI chat.
    • Once the message appears in the chat history, verify that the Export button becomes enabled immediately.
  3. Reset State

    • Click the Clear chat history (trash icon) at the bottom of the chat.
    • Confirm the action.
    • Verify that the Export button returns to a disabled state.
  4. Group Chat

    • Right-click a group and select Chat with group.
    • Verify that the Export button behavior matches the entry editor AI tab:
      • Disabled when the chat is empty
      • Enabled after sending a message
      • Disabled again after clearing the chat

Screenshots of the issue being fixed

  • AI Tab View (Empty Chat)
entry ai chat
  • Group Chat Window (Empty Chat)
group

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.

@github-actions github-actions Bot added good first issue An issue intended for project-newcomers. Varies in difficulty. status: changes-required Pull requests that are not yet complete labels Dec 20, 2025
@github-actions github-actions Bot removed the status: changes-required Pull requests that are not yet complete label Dec 20, 2025

@calixtus calixtus left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

asserts instead dialog message.
Everything else looks good.

@github-actions github-actions Bot added the status: changes-required Pull requests that are not yet complete label Dec 21, 2025
@calixtus calixtus enabled auto-merge December 21, 2025 19:46
@github-actions github-actions Bot removed the status: changes-required Pull requests that are not yet complete label Dec 21, 2025
@calixtus calixtus added this pull request to the merge queue Dec 21, 2025
Merged via the queue into JabRef:main with commit 3ff883f Dec 21, 2025
48 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

component: ai component: entry-editor good first issue An issue intended for project-newcomers. Varies in difficulty.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Disable Export button if no AI Chat is there

2 participants