Skip to content

Commit ae55866

Browse files
authored
Merge branch 'main' into auto-relativize-file-paths
2 parents 098c713 + 28fb91e commit ae55866

36 files changed

+555
-67
lines changed

.github/ghprcomment.yml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,8 @@
22
message: |
33
Your code currently does not meet [JabRef's code guidelines](https://devdocs.jabref.org/getting-into-the-code/guidelines-for-setting-up-a-local-workspace/intellij-13-code-style.html).
44
We use [Checkstyle](https://checkstyle.sourceforge.io/) to identify issues.
5-
The tool reviewdog already placed comments on GitHub to indicate the places. See the tab "Files" in you PR.
65
Please carefully follow [the setup guide for the codestyle](https://devdocs.jabref.org/getting-into-the-code/guidelines-for-setting-up-a-local-workspace/intellij-13-code-style.html).
76
Afterwards, please [run checkstyle locally](https://devdocs.jabref.org/getting-into-the-code/guidelines-for-setting-up-a-local-workspace/intellij-13-code-style.html#run-checkstyle) and fix the issues.
8-
9-
10-
You can check review dog's comments at the tab "Files changed" of your pull request.
117
- jobName: OpenRewrite
128
message: |
139
Your code currently does not meet JabRef's code guidelines.

CHANGELOG.md

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,11 @@ Note that this project **does not** adhere to [Semantic Versioning](https://semv
1616
- When a search hits a file, the file icon of that entry is changed accordingly. [#11542](https://github.com/JabRef/jabref/pull/11542)
1717
- We added an AI-based chat for entries with linked PDF files. [#11430](https://github.com/JabRef/jabref/pull/11430)
1818
- We added an AI-based summarization possibility for entries with linked PDF files. [#11430](https://github.com/JabRef/jabref/pull/11430)
19+
- We added an AI section in JabRef's [preferences](https://docs.jabref.org/ai/preferences). [#11430](https://github.com/JabRef/jabref/pull/11430)
20+
- We added AI providers: OpenAI, Mistral AI, Hugging Face and Google. [#11430](https://github.com/JabRef/jabref/pull/11430), [#11736](https://github.com/JabRef/jabref/pull/11736)
21+
- We added AI providers: [Ollama](https://docs.jabref.org/ai/local-llm#step-by-step-guide-for-ollama) and GPT4All, which add the possibility to use local LLMs privately on your own device. [#11430](https://github.com/JabRef/jabref/pull/11430), [#11870](https://github.com/JabRef/jabref/issues/11870)
1922
- We added support for selecting and using CSL Styles in JabRef's OpenOffice/LibreOffice integration for inserting bibliographic and in-text citations into a document. [#2146](https://github.com/JabRef/jabref/issues/2146), [#8893](https://github.com/JabRef/jabref/issues/8893)
20-
- We added Tools > New library based on references in PDF file... to create a new library based on the references section in a PDF file. [#11522](https://github.com/JabRef/jabref/pull/11522)
23+
- We added "Tools > New library based on references in PDF file" ... to create a new library based on the references section in a PDF file. [#11522](https://github.com/JabRef/jabref/pull/11522)
2124
- When converting the references section of a paper (PDF file), more than the last page is treated. [#11522](https://github.com/JabRef/jabref/pull/11522)
2225
- Added the functionality to invoke offline reference parsing explicitly. [#11565](https://github.com/JabRef/jabref/pull/11565)
2326
- The dialog for [adding an entry using reference text](https://docs.jabref.org/collect/newentryfromplaintext) is now filled with the clipboard contents as default. [#11565](https://github.com/JabRef/jabref/pull/11565)
@@ -67,7 +70,8 @@ Note that this project **does not** adhere to [Semantic Versioning](https://semv
6770
- We added a new CSS style class `main-table` for the main table. [#11881](https://github.com/JabRef/jabref/pull/11881)
6871
- When renaming a file, the old extension is now used if there is none provided in the new name. [#11903](https://github.com/JabRef/jabref/issues/11903)
6972
- When importing a file using "Find Unlinked Files", when one or more file directories are available, the file path will be relativized where possible [koppor#549](https://github.com/koppor/jabref/issues/549)
70-
- We changed the name of the library-based file directory from 'General File Directory' to 'Library-specific File Directory' per issue [#571](https://github.com/koppor/jabref/issues/571)
73+
- We added minimum window sizing for windows dedicated to creating new entries [#11944](https://github.com/JabRef/jabref/issues/11944)
74+
- We changed the name of the library-based file directory from 'General File Directory' to 'Library-specific File Directory' per issue. [#571](https://github.com/koppor/jabref/issues/571)
7175
- The CitationKey column is now a default shown column for the entry table. [#10510](https://github.com/JabRef/jabref/issues/10510)
7276

7377
### Fixed
@@ -102,6 +106,7 @@ Note that this project **does not** adhere to [Semantic Versioning](https://semv
102106
- We fixed an issue where recently opened files were not displayed in the main menu properly. [#9042](https://github.com/JabRef/jabref/issues/9042)
103107
- We fixed an issue where the DOI lookup would show an error when a DOI was found for an entry. [#11850](https://github.com/JabRef/jabref/issues/11850)
104108
- We fixed an issue where <kbd>Tab</kbd> cannot be used to jump to next field in some single-line fields. [#11785](https://github.com/JabRef/jabref/issues/11785)
109+
- We fixed an issue where the "Do not ask again" checkbox was not working, when asking for permission to use Grobid [koppor#556](https://github.com/koppor/jabref/issues/566).
105110
- We fixed an issue where we display warning message for moving attached open files. [#10121](https://github.com/JabRef/jabref/issues/10121)
106111
- We fixed an issue where it was not possible to select selecting content of other user's comments.[#11106](https://github.com/JabRef/jabref/issues/11106)
107112
- We fixed an issue where web search preferences "Custom API key" table modifications not discarded. [#11925](https://github.com/JabRef/jabref/issues/11925)

build.gradle

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -385,6 +385,7 @@ dependencies {
385385
testImplementation "org.testfx:testfx-core:4.0.16-alpha"
386386
testImplementation "org.testfx:testfx-junit5:4.0.16-alpha"
387387
testImplementation "org.hamcrest:hamcrest-library:3.0"
388+
testImplementation "com.github.javaparser:javaparser-symbol-solver-core:3.26.2"
388389

389390
// recommended by https://github.com/wiremock/wiremock/issues/2149#issuecomment-1835775954
390391
testImplementation 'org.wiremock:wiremock-standalone:3.3.1'

src/main/java/org/jabref/gui/ai/components/privacynotice/PrivacyNoticeComponent.fxml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,15 @@
6666
</Text>
6767
</children>
6868
</TextFlow>
69+
<TextFlow fx:id="gpt4AllTextFlow">
70+
<children>
71+
<Text text="%If you have chosen %0 as an AI provider, the privacy policy of %0 applies. You find it at %1.">
72+
<font>
73+
<Font size="14.0" />
74+
</font>
75+
</Text>
76+
</children>
77+
</TextFlow>
6978
<TextFlow>
7079
<Text fx:id="embeddingModelText" text="%Additionally, we use Deep Java Library (DJL) embedding models for both chatting and summarization. The embedding model will be downloaded in background (size %0) from Deep Java Library servers anonymously.">
7180
<font>

src/main/java/org/jabref/gui/ai/components/privacynotice/PrivacyNoticeComponent.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ public class PrivacyNoticeComponent extends ScrollPane {
2525
@FXML private TextFlow mistralAiPrivacyTextFlow;
2626
@FXML private TextFlow geminiPrivacyTextFlow;
2727
@FXML private TextFlow huggingFacePrivacyTextFlow;
28+
@FXML private TextFlow gpt4AllTextFlow;
2829
@FXML private Text embeddingModelText;
2930

3031
private final AiPreferences aiPreferences;
@@ -49,6 +50,7 @@ private void initialize() {
4950
initPrivacyHyperlink(mistralAiPrivacyTextFlow, AiProvider.MISTRAL_AI);
5051
initPrivacyHyperlink(geminiPrivacyTextFlow, AiProvider.GEMINI);
5152
initPrivacyHyperlink(huggingFacePrivacyTextFlow, AiProvider.HUGGING_FACE);
53+
initPrivacyHyperlink(gpt4AllTextFlow, AiProvider.GPT4ALL);
5254

5355
String newEmbeddingModelText = embeddingModelText.getText().replaceAll("%0", aiPreferences.getEmbeddingModel().sizeInfo());
5456
embeddingModelText.setText(newEmbeddingModelText);

src/main/java/org/jabref/gui/entryeditor/EntryEditor.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
import org.jabref.gui.entryeditor.fileannotationtab.FulltextSearchResultsTab;
3838
import org.jabref.gui.externalfiles.ExternalFilesEntryLinker;
3939
import org.jabref.gui.help.HelpAction;
40-
import org.jabref.gui.importer.GrobidOptInDialogHelper;
40+
import org.jabref.gui.importer.GrobidUseDialogHelper;
4141
import org.jabref.gui.keyboard.KeyBinding;
4242
import org.jabref.gui.keyboard.KeyBindingRepository;
4343
import org.jabref.gui.menus.ChangeEntryTypeMenu;
@@ -423,7 +423,7 @@ private void setupToolBar() {
423423
if (fetcher instanceof PdfMergeMetadataImporter.EntryBasedFetcherWrapper) {
424424
// Handle Grobid Opt-In in case of the PdfMergeMetadataImporter
425425
fetcherMenuItem.setOnAction(event -> {
426-
GrobidOptInDialogHelper.showAndWaitIfUserIsUndecided(dialogService, preferences.getGrobidPreferences());
426+
GrobidUseDialogHelper.showAndWaitIfUserIsUndecided(dialogService, preferences.getGrobidPreferences());
427427
PdfMergeMetadataImporter.EntryBasedFetcherWrapper pdfMergeMetadataImporter =
428428
new PdfMergeMetadataImporter.EntryBasedFetcherWrapper(
429429
preferences.getImportFormatPreferences(),

src/main/java/org/jabref/gui/entrytype/EntryTypeView.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
import javafx.scene.control.Tooltip;
1717
import javafx.scene.layout.FlowPane;
1818
import javafx.stage.Screen;
19+
import javafx.stage.Stage;
1920

2021
import org.jabref.gui.DialogService;
2122
import org.jabref.gui.LibraryTab;
@@ -87,6 +88,10 @@ public EntryTypeView(LibraryTab libraryTab, DialogService dialogService, GuiPref
8788
.load()
8889
.setAsDialogPane(this);
8990

91+
Stage stage = (Stage) getDialogPane().getScene().getWindow();
92+
stage.setMinHeight(400);
93+
stage.setMinWidth(500);
94+
9095
ControlHelper.setAction(generateButton, this.getDialogPane(), event -> viewModel.runFetcherWorker());
9196
setOnCloseRequest(e -> viewModel.cancelFetcherWorker());
9297

src/main/java/org/jabref/gui/fieldeditors/LinkedFilesEditor.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141
import org.jabref.gui.copyfiles.CopySingleFileAction;
4242
import org.jabref.gui.icon.IconTheme;
4343
import org.jabref.gui.icon.JabRefIconView;
44-
import org.jabref.gui.importer.GrobidOptInDialogHelper;
44+
import org.jabref.gui.importer.GrobidUseDialogHelper;
4545
import org.jabref.gui.keyboard.KeyBinding;
4646
import org.jabref.gui.linkedfile.DeleteFileAction;
4747
import org.jabref.gui.linkedfile.LinkedFileEditDialog;
@@ -236,7 +236,7 @@ private Node createFileDisplay(LinkedFileViewModel linkedFile) {
236236
parsePdfMetadata.setTooltip(new Tooltip(Localization.lang("Parse Metadata from PDF.")));
237237
parsePdfMetadata.visibleProperty().bind(linkedFile.isOfflinePdfProperty());
238238
parsePdfMetadata.setOnAction(event -> {
239-
GrobidOptInDialogHelper.showAndWaitIfUserIsUndecided(dialogService, preferences.getGrobidPreferences());
239+
GrobidUseDialogHelper.showAndWaitIfUserIsUndecided(dialogService, preferences.getGrobidPreferences());
240240
linkedFile.parsePdfMetadataAndShowMergeDialog();
241241
});
242242
parsePdfMetadata.getStyleClass().setAll("icon-button");

src/main/java/org/jabref/gui/importer/GrobidOptInDialogHelper.java renamed to src/main/java/org/jabref/gui/importer/GrobidUseDialogHelper.java

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -7,29 +7,31 @@
77
/**
88
* Metadata extraction from PDFs and plaintext works very well using Grobid, but we do not want to enable it by default
99
* due to data privacy concerns.
10-
* To make users aware of the feature, we ask each time before querying Grobid, giving the option to opt-out.
10+
* To make users aware of the feature, we ask before querying for the first time Grobid, saving the users' preference
1111
*/
12-
public class GrobidOptInDialogHelper {
12+
public class GrobidUseDialogHelper {
1313

1414
/**
15-
* If Grobid is not enabled but the user has not explicitly opted-out of Grobid, we ask for permission to send data
16-
* to Grobid using a dialog and giving an opt-out option.
15+
* If the user has not explicitly opted-in/out of Grobid, we ask for permission to send data to Grobid by using
16+
* a dialog. The users' preference is saved.
1717
*
1818
* @param dialogService the DialogService to use
1919
* @return if the user enabled Grobid, either in the past or after being asked by the dialog.
2020
*/
2121
public static boolean showAndWaitIfUserIsUndecided(DialogService dialogService, GrobidPreferences preferences) {
22+
if (preferences.isGrobidUseAsked()) {
23+
return preferences.isGrobidEnabled();
24+
}
2225
if (preferences.isGrobidEnabled()) {
26+
preferences.setGrobidUseAsked(true);
2327
return true;
2428
}
25-
if (preferences.isGrobidOptOut()) {
26-
return false;
27-
}
28-
boolean grobidEnabled = dialogService.showConfirmationDialogWithOptOutAndWait(
29+
boolean grobidEnabled = dialogService.showConfirmationDialogAndWait(
2930
Localization.lang("Remote services"),
3031
Localization.lang("Allow sending PDF files and raw citation strings to a JabRef online service (Grobid) to determine Metadata. This produces better results."),
31-
Localization.lang("Do not ask again"),
32-
optOut -> preferences.setGrobidOptOut(optOut));
32+
Localization.lang("Send to Grobid"),
33+
Localization.lang("Do not send"));
34+
preferences.setGrobidUseAsked(true);
3335
preferences.setGrobidEnabled(grobidEnabled);
3436
return grobidEnabled;
3537
}

src/main/java/org/jabref/gui/importer/ImportCommand.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ private ParserResult doImport(List<Path> files, Importer importFormat) throws IO
144144
if (importer.isEmpty()) {
145145
// Unknown format
146146
UiTaskExecutor.runAndWaitInJavaFXThread(() -> {
147-
if (FileUtil.isPDFFile(filename) && GrobidOptInDialogHelper.showAndWaitIfUserIsUndecided(dialogService, preferences.getGrobidPreferences())) {
147+
if (FileUtil.isPDFFile(filename) && GrobidUseDialogHelper.showAndWaitIfUserIsUndecided(dialogService, preferences.getGrobidPreferences())) {
148148
importFormatReader.reset();
149149
}
150150
dialogService.notify(Localization.lang("Importing file %0 as unknown format", filename.getFileName().toString()));
@@ -155,7 +155,7 @@ private ParserResult doImport(List<Path> files, Importer importFormat) throws IO
155155
UiTaskExecutor.runAndWaitInJavaFXThread(() -> {
156156
if (((importer.get() instanceof PdfGrobidImporter)
157157
|| (importer.get() instanceof PdfMergeMetadataImporter))
158-
&& GrobidOptInDialogHelper.showAndWaitIfUserIsUndecided(dialogService, preferences.getGrobidPreferences())) {
158+
&& GrobidUseDialogHelper.showAndWaitIfUserIsUndecided(dialogService, preferences.getGrobidPreferences())) {
159159
importFormatReader.reset();
160160
}
161161
dialogService.notify(Localization.lang("Importing in %0 format", importer.get().getName()) + "...");

0 commit comments

Comments
 (0)