Skip to content
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ Note that this project **does not** adhere to [Semantic Versioning](https://semv
- We fixed an issue where keybindings could not be edited and saved. [#14237](https://github.com/JabRef/jabref/issues/14237)
- We readded the missing gui commands for importing and exporting preferences. [#14492](https://github.com/JabRef/jabref/pull/14492)
- We fixed an issue where reordering linked files via drag and drop was no longer possible. [#14627](https://github.com/JabRef/jabref/pull/14627)
- We fixed empty entries list when exporting AI chat from a group. [#14647](https://github.com/JabRef/jabref/issues/14647)

### Removed

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,9 @@ public AiChatComponent(AiService aiService,
TaskExecutor taskExecutor
) {
this.aiService = aiService;
this.entries = stateManager.getSelectedEntries();
this.entries = (entries != null && !entries.isEmpty())
? entries
: stateManager.getSelectedEntries();

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.

Strange code!

When is entries null? Is it a different mode? Is the caller doing something wrong?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I realized that while the previous code fixed the "chat with group" issue, it introduced a regression for standard multi-selection.
Specifically, when right-clicking a multi-selection to start a chat, the UI often passes only the single focused row, causing the multi-selection to be lost.
I have now modified the logic to handle both scenarios:

  1. It detects if the passed entry is just a subset of the current multi-selection (fixing the right-click issue).
  2. It correctly prioritizes the passed entries for Group Chat .
    I believe that if we don't add the option to directly chat with a group when creating a new library, the entries will be empty when exported. However, I think this might be permissible; otherwise, this option should be disabled.

this.bibDatabaseContext = bibDatabaseContext;
this.aiPreferences = aiPreferences;
this.entryTypesManager = entryTypesManager;
Expand Down
Loading