Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/main' into extract-entry-editor
Browse files Browse the repository at this point in the history
  • Loading branch information
calixtus committed Dec 10, 2024
2 parents 21075bf + d7191c5 commit d477fcc
Show file tree
Hide file tree
Showing 69 changed files with 1,585 additions and 1,051 deletions.
3 changes: 3 additions & 0 deletions .github/ghprcomment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@
We use [Checkstyle](https://checkstyle.sourceforge.io/) to identify issues.
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).
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.
In case of issues with the import order, double check that you [activated Auto Import](https://devdocs.jabref.org/getting-into-the-code/guidelines-for-setting-up-a-local-workspace/intellij-13-code-style.html#enable-proper-import-cleanup).
You can trigger fixing imports by pressing <kbd>Ctrl</kbd>+<kbd>Alt</kbd>+<kbd>O</kbd> to trigger [Optimize Imports](https://www.jetbrains.com/guide/tips/optimize-imports/).
- jobName: OpenRewrite
message: |
Your code currently does not meet JabRef's code guidelines.
Expand Down
3 changes: 3 additions & 0 deletions .moderne/moderne.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
specs: specs.moderne.ai/v1/cli
java:
selectedJdk: '23'
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ Note that this project **does not** adhere to [Semantic Versioning](https://semv
- We added a different background color to the search bar to indicate when the search syntax is wrong. [#11658](https://github.com/JabRef/jabref/pull/11658)
- We added a setting which always adds the literal "Cited on pages" text before each JStyle citation. [#11691](https://github.com/JabRef/jabref/pull/11732)
- We added a new plain citation parser that uses LLMs. [#11825](https://github.com/JabRef/jabref/issues/11825)
- We added support for `langid` field for biblatex libraries. [#10868](https://github.com/JabRef/jabref/issues/10868)
- We added support for modifier keys when dropping a file on an entry in the main table. [#12001](https://github.com/JabRef/jabref/pull/12001)
- We added an importer for SSRN URLs. [#12021](https://github.com/JabRef/jabref/pull/12021)
- We added a compare button to the duplicates in the citation relations tab to open the "Possible duplicate entries" window. [#11192](https://github.com/JabRef/jabref/issues/11192)
Expand Down Expand Up @@ -123,6 +124,8 @@ Note that this project **does not** adhere to [Semantic Versioning](https://semv
- We fixed an issue where trying to open a library from a failed mounted directory on Mac would cause an error. [#10548](https://github.com/JabRef/jabref/issues/10548)
- We fixed an issue when the preview was out of sync. [#9172](https://github.com/JabRef/jabref/issues/9172)
- We fixed an issue where identifier paste couldn't work with Unicode REPLACEMENT CHARACTER. [#11986](https://github.com/JabRef/jabref/issues/11986)
- We fixed an issue when click on entry at "Check Integrity" wasn't properly focusing the entry and field. [#11997](https://github.com/JabRef/jabref/issues/11997)
- We fixed an issue with the ui not scaling when changing the font size [#11219](https://github.com/JabRef/jabref/issues/11219)

### Removed

Expand Down
27 changes: 27 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,33 @@ We will discuss improvements with you and agree to merge them once the [develope
Please also remember to discuss bigger changes early with the core developers to ensure properly spend time and work.
Some fundamental design decisions can be found within our list of [Architectural Decision Records](https://devdocs.jabref.org/decisions/).

## Research and Education

JabRef welcomes research applied to it.
The current list of papers where JabRef helped to enhance science is maintained at <https://github.com/JabRef/jabref/wiki/JabRef-in-the-Media>.

The JabRef team also fosters to use JabRef in Software Engineering training.
We offer guidelines for this at <https://devdocs.jabref.org/teaching.html>.

When citing JabRef, please use following citation:

```bibtex
@Article{jabref,
author = {Oliver Kopp and Carl Christian Snethlage and Christoph Schwentker},
title = {JabRef: BibTeX-based literature management software},
journal = {TUGboat},
volume = {44},
number = {3},
pages = {441--447},
doi = {10.47397/tb/44-3/tb138kopp-jabref},
issn = {0896-3207},
issue = {138},
year = {2023},
}
```

DOI (also includes [full text](https://tug.org/TUGboat/tb44-3/tb138kopp-jabref.pdf)): [10.47397/tb/44-3/tb138kopp-jabref](https://doi.org/10.47397/tb/44-3/tb138kopp-jabref).

## Sponsoring

JabRef development is powered by YourKit Java Profiler
Expand Down
23 changes: 12 additions & 11 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -54,13 +54,14 @@ java {

toolchain {
// If this is updated, also update
// - .gitpod.Dockerfile
// - build.gradle -> jacoco -> toolVersion (because JaCoCo does not support newest JDK out of the box. Check versions at https://www.jacoco.org/jacoco/trunk/doc/changes.html)
// - .devcontainer/devcontainer.json#L34 and
// - .gitpod.Dockerfile
// - .moderne/moderne.yml
// - .github/workflows/deployment*.yml
// - .github/workflows/tests*.yml
// - .github/workflows/update-gradle-wrapper.yml
// - docs/getting-into-the-code/guidelines-for-setting-up-a-local-workspace/intellij-12-build.md
// - build.gradle -> jacoco -> toolVersion (because JaCoCo does not support newest JDK out of the box. Check versions at https://www.jacoco.org/jacoco/trunk/doc/changes.html)
languageVersion = JavaLanguageVersion.of(23)
// See https://docs.gradle.org/current/javadoc/org/gradle/jvm/toolchain/JvmVendorSpec.html for a full list
// vendor = JvmVendorSpec.AMAZON
Expand Down Expand Up @@ -196,7 +197,7 @@ dependencies {
implementation 'io.github.thibaultmeyer:cuid:2.0.3'
// endregion

implementation 'io.github.java-diff-utils:java-diff-utils:4.12'
implementation 'io.github.java-diff-utils:java-diff-utils:4.15'
implementation 'info.debatty:java-string-similarity:2.0.0'
implementation 'com.github.javakeyring:java-keyring:1.0.4'

Expand Down Expand Up @@ -255,7 +256,7 @@ dependencies {
exclude group: 'tech.units'
}
// Required by gemsfx
implementation 'tech.units:indriya:2.2'
implementation 'tech.units:indriya:2.2.1'
// Required by gemsfx and langchain4j
implementation ('com.squareup.retrofit2:retrofit:2.11.0') {
exclude group: 'com.squareup.okhttp3'
Expand All @@ -267,7 +268,7 @@ dependencies {
implementation 'org.jsoup:jsoup:1.18.1'
implementation 'com.konghq:unirest-java-core:4.4.5'
implementation 'com.konghq:unirest-modules-gson:4.4.5'
implementation 'org.apache.httpcomponents.client5:httpclient5:5.4'
implementation 'org.apache.httpcomponents.client5:httpclient5:5.4.1'
// endregion

implementation 'org.slf4j:slf4j-api:2.0.16'
Expand Down Expand Up @@ -336,7 +337,7 @@ dependencies {
// region AI
implementation 'dev.langchain4j:langchain4j:0.36.0'
// Even though we use jvm-openai for LLM connection, we still need this package for tokenization.
implementation('dev.langchain4j:langchain4j-open-ai:0.36.0') {
implementation('dev.langchain4j:langchain4j-open-ai:0.36.2') {
exclude group: 'com.squareup.okhttp3'
exclude group: 'com.squareup.retrofit2', module: 'retrofit'
exclude group: 'org.jetbrains.kotlin'
Expand All @@ -346,11 +347,11 @@ dependencies {
exclude group: 'com.squareup.retrofit2', module: 'retrofit'
exclude group: 'org.jetbrains.kotlin'
}
implementation('dev.langchain4j:langchain4j-google-ai-gemini:0.36.0') {
implementation('dev.langchain4j:langchain4j-google-ai-gemini:0.36.2') {
exclude group: 'com.squareup.okhttp3'
exclude group: 'com.squareup.retrofit2', module: 'retrofit'
}
implementation('dev.langchain4j:langchain4j-hugging-face:0.36.0') {
implementation('dev.langchain4j:langchain4j-hugging-face:0.36.2') {
exclude group: 'com.squareup.okhttp3'
exclude group: 'com.squareup.retrofit2', module: 'retrofit'
exclude group: 'org.jetbrains.kotlin'
Expand All @@ -367,7 +368,7 @@ dependencies {
exclude group: 'org.jetbrains.kotlin', module: 'kotlin-stdlib-jdk8'
}
// GemxFX also (transitively) depends on kotlin
implementation 'org.jetbrains.kotlin:kotlin-stdlib-jdk8:2.0.21'
implementation 'org.jetbrains.kotlin:kotlin-stdlib-jdk8:2.1.0'
// endregion

implementation 'commons-io:commons-io:2.18.0'
Expand All @@ -376,9 +377,9 @@ dependencies {
implementation 'io.github.adr:e-adr:2.0.0-SNAPSHOT'

implementation 'io.zonky.test:embedded-postgres:2.1.0'
implementation enforcedPlatform('io.zonky.test.postgres:embedded-postgres-binaries-bom:17.0.0')
implementation enforcedPlatform('io.zonky.test.postgres:embedded-postgres-binaries-bom:17.2.0')

testImplementation 'io.github.classgraph:classgraph:4.8.177'
testImplementation 'io.github.classgraph:classgraph:4.8.179'
testImplementation 'org.junit.jupiter:junit-jupiter:5.11.3'
testImplementation 'org.junit.platform:junit-platform-launcher:1.11.3'

Expand Down
71 changes: 55 additions & 16 deletions buildres/linux/jabref.spec
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,17 @@ Version: APPLICATION_VERSION
Release: APPLICATION_RELEASE
License: APPLICATION_LICENSE_TYPE
Vendor: APPLICATION_VENDOR
Prefix: %{dirname:APPLICATION_DIRECTORY}

%if "xAPPLICATION_URL" != "x"
URL: APPLICATION_URL
%endif

%if "xAPPLICATION_PREFIX" != "x"
Prefix: APPLICATION_PREFIX
%endif

Provides: APPLICATION_PACKAGE

%if "xAPPLICATION_GROUP" != "x"
Group: APPLICATION_GROUP
%endif
Expand All @@ -16,14 +25,20 @@ Autoreq: 0
Requires: PACKAGE_DEFAULT_DEPENDENCIES PACKAGE_CUSTOM_DEPENDENCIES
%endif

#avoid ARCH subfolder
%define _rpmfilename %%{NAME}-%%{VERSION}-%%{RELEASE}.%%{ARCH}.rpm

#comment line below to enable effective jar compression
#it could easily get your package size from 40 to 15Mb but
#build time will substantially increase and it may require unpack200/system java to install
%define __jar_repack %{nil}

# on RHEL we got unwanted improved debugging enhancements
%define _build_id_links none

%define package_filelist %{_builddir}/%{name}.files
%define app_filelist %{_builddir}/%{name}.app.files
%define filesystem_filelist %{_builddir}/%{name}.filesystem.files

%define default_filesystem / /opt /usr /usr/bin /usr/lib /usr/local /usr/local/bin /usr/local/lib

%description
APPLICATION_DESCRIPTION

Expand All @@ -37,33 +52,58 @@ APPLICATION_DESCRIPTION
rm -rf %{buildroot}
install -d -m 755 %{buildroot}APPLICATION_DIRECTORY
cp -r %{_sourcedir}APPLICATION_DIRECTORY/* %{buildroot}APPLICATION_DIRECTORY
if [ "$(echo %{_sourcedir}/lib/systemd/system/*.service)" != '%{_sourcedir}/lib/systemd/system/*.service' ]; then
install -d -m 755 %{buildroot}/lib/systemd/system
cp %{_sourcedir}/lib/systemd/system/*.service %{buildroot}/lib/systemd/system
fi
%if "xAPPLICATION_LICENSE_FILE" != "x"
%define license_install_file %{_defaultlicensedir}/%{name}-%{version}/%{basename:APPLICATION_LICENSE_FILE}
install -d -m 755 %{buildroot}%{dirname:%{license_install_file}}
install -m 644 APPLICATION_LICENSE_FILE %{buildroot}%{license_install_file}
install -d -m 755 "%{buildroot}%{dirname:%{license_install_file}}"
install -m 644 "APPLICATION_LICENSE_FILE" "%{buildroot}%{license_install_file}"
%endif
(cd %{buildroot} && find . -path ./lib/systemd -prune -o -type d -print) | sed -e 's/^\.//' -e '/^$/d' | sort > %{app_filelist}
{ rpm -ql filesystem || echo %{default_filesystem}; } | sort > %{filesystem_filelist}
comm -23 %{app_filelist} %{filesystem_filelist} > %{package_filelist}
sed -i -e 's/.*/%dir "&"/' %{package_filelist}
(cd %{buildroot} && find . -not -type d) | sed -e 's/^\.//' -e 's/.*/"&"/' >> %{package_filelist}
%if "xAPPLICATION_LICENSE_FILE" != "x"
sed -i -e 's|"%{license_install_file}"||' -e '/^$/d' %{package_filelist}
%endif

%files
%files -f %{package_filelist}
%if "xAPPLICATION_LICENSE_FILE" != "x"
%license %{license_install_file}
%{dirname:%{license_install_file}}
%license "%{license_install_file}"
%endif
# If installation directory for the application is /a/b/c, we want only root
# component of the path (/a) in the spec file to make sure all subdirectories
# are owned by the package.
%(echo APPLICATION_DIRECTORY | sed -e "s|\(^/[^/]\{1,\}\).*$|\1|")

%post
package_type=rpm
LAUNCHER_AS_SERVICE_SCRIPTS
DESKTOP_COMMANDS_INSTALL
LAUNCHER_AS_SERVICE_COMMANDS_INSTALL
# Install the native-messaging host script for firefox/chrome/chromium
install -D -m0755 /opt/jabref/lib/native-messaging-host/firefox/org.jabref.jabref.json /usr/lib/mozilla/native-messaging-hosts/org.jabref.jabref.json
install -D -m0755 /opt/jabref/lib/native-messaging-host/chromium/org.jabref.jabref.json /etc/chromium/native-messaging-hosts/org.jabref.jabref.json
install -D -m0755 /opt/jabref/lib/native-messaging-host/chromium/org.jabref.jabref.json /etc/opt/chrome/native-messaging-hosts/org.jabref.jabref.json
# Trigger an auto-install of the browser addon for chrome/chromium browsers
install -D -m0644 /opt/jabref/lib/native-messaging-host/chromium/bifehkofibaamoeaopjglfkddgkijdlh.json /opt/google/chrome/extensions/bifehkofibaamoeaopjglfkddgkijdlh.json
install -D -m0644 /opt/jabref/lib/native-messaging-host/chromium/bifehkofibaamoeaopjglfkddgkijdlh.json /usr/share/google-chrome/extensions/bifehkofibaamoeaopjglfkddgkijdlh.json
DESKTOP_COMMANDS_INSTALL


%pre
package_type=rpm
COMMON_SCRIPTS
LAUNCHER_AS_SERVICE_SCRIPTS
if [ "$1" -gt 1 ]; then
:; LAUNCHER_AS_SERVICE_COMMANDS_UNINSTALL
fi

%preun
package_type=rpm
COMMON_SCRIPTS
DESKTOP_SCRIPTS
LAUNCHER_AS_SERVICE_SCRIPTS
DESKTOP_COMMANDS_UNINSTALL
LAUNCHER_AS_SERVICE_COMMANDS_UNINSTALL
# Remove the native-messaging hosts script only if relative to the deb package
for NATIVE_MESSAGING_JSON in "/usr/lib/mozilla/native-messaging-hosts/org.jabref.jabref.json"\
"/etc/chromium/native-messaging-hosts/org.jabref.jabref.json"\
Expand All @@ -75,7 +115,6 @@ done
# Remove the auto-install triggers of the browser addon for chrom/chromium
rm -f /opt/google/chrome/extensions/bifehkofibaamoeaopjglfkddgkijdlh.json || true
rm -f /usr/share/google-chrome/extensions/bifehkofibaamoeaopjglfkddgkijdlh.json || true
DESKTOP_SCRIPTS
DESKTOP_COMMANDS_UNINSTALL


%clean
20 changes: 11 additions & 9 deletions docs/decisions/0034-use-citation-key-for-grouping-chat-messages.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,25 +7,25 @@ parent: Decision Records

## Context and Problem Statement

Because we store chat messages not inside a BIB entry in `.bib` filecc, the chats file is represented as a map to
BIB entry and a list of messages. We need to specify the key of this map. Turns out, it is not that easy.
As we store chat messages not inside a BibTeX entry in `.bib` file, the chats file is represented as a map to
BibTeX entry and a list of messages. We need to specify the key of this map. Turns out, it is not that easy.

## Decision Drivers

* The key should exist for every BIB entry
* The key should be unique along other BIB entries in one library file
* The key should not change at run-time, between launches of JabRef, and should be cross-platform (most important)
* The key should exist for every BibTeX entry
* The key should be unique along other BibTeX entries in one library file
* It is assumed that the key does not change at run-time, between launches of JabRef, and should be cross-platform (most important)

## Considered Options

* `BibEntry` Java object
* `BibEntry`'s `id`
* `BibEntry`'s Citation key
* `BibEntry`'s citation key
* `BibEntry`'s `ShareId`

## Decision Outcome

Chosen option: "`BibEntry`'s Citation key", because this is the only choice that complains to the third point in Decision Drivers.
Chosen option: "`BibEntry`'s citation key", because this is the only choice that complies to the third point in Decision Drivers.

### Positive Consequences

Expand All @@ -50,11 +50,11 @@ This identifier is created on each load of a library (and not stored permanently

Very bad, for the same reasons as `BibEntry` Java object.

### `BibEntry`'s Citation key
### `BibEntry`'s citation key

* Good, because it is cross-platform, stable (meaning stays the same across launches of JabRef)
* Bad, because it is not guaranteed that citation key exists on `BibEntry`, and that it is unique across other
`BibEntriy`'s' in the library
BibTeX entries in the library

### `BibEntry`'s `ShareId`

Expand All @@ -67,3 +67,5 @@ This approach cannot be used here, because there is no server running which we c
## More Information

Refer to [issue #160](https://github.com/JabRef/jabref/issues/160) in JabRef main repository

[ADR-038](0038-use-entryId-for-bibentries.md) takes another option, because it re-generates the index at each start of JabRef.
8 changes: 5 additions & 3 deletions docs/decisions/0036-use-textarea-for-chat-content.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ nav_order: 0036
parent: Decision Records
---

# Use TextArea for Chat Message Content
# Use `TextArea` for Chat Message Content

## Context and Problem Statement

Expand Down Expand Up @@ -41,7 +41,7 @@ which for now we value more than Markdown rendering.

### Use a third-party package

There seems to be only one package for JavaFX that provides a ready-to-use UI node for Markdown rendering.
There seems to be [only one package](https://github.com/JPro-one/markdown-javafx-renderer) for JavaFX that provides a ready-to-use UI node for Markdown rendering.

* Good, because it is easy to implement
* Good, because it renders Markdown
Expand Down Expand Up @@ -77,8 +77,10 @@ There seems to be only one package for JavaFX that provides a ready-to-use UI no

## More Information

This ADR is highly linked to [ADR-0042](./0042-use-webview-for-summarization-content.md).

Actually we used an `ExpandingTextArea` from `GemsFX` package so the content can occupy
as much space as it needs in the `ScrollPane`.

About the selection and copying, this goes down to fundamental issue from JavaFX.
`Text` and `Label` cannot be selected by any means.
`Text` and `Label` as a whole or a part [cannot be selected and/or copied](https://bugs.openjdk.org/browse/JDK-8091644).
37 changes: 37 additions & 0 deletions docs/decisions/0042-use-webview-for-summarization-content.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
---
nav_order: 0042
parent: Decision Records
---

# Use `WebView` for Chat Message Content

## Context and Problem Statement

This decision record concerns the UI component that is used for rendering the content of AI summaries.

## Decision Drivers

Same as in [ADR-0036](./0036-use-textarea-for-chat-content.md).

## Considered Options

Same as in [ADR-0036](./0036-use-textarea-for-chat-content.md).

## Decision Outcome

Chosen option: "Use `WebView`".

Some of the options does not support selecting and copying of text. Some options do not render Markdown.

However, in contrary to [ADR-0036](./0036-use-textarea-for-chat-content.md), we chose here a `WebView`, instead of `TextArea`, because there is only one summary content in UI (when user switches entries, no new components are added, rather old ones are *rebinding* to new entry). It would hurt the performance if we used `WebView` for messages, as there could be a lot of messages in one chat.

## Pros and Cons of the Options

Same as in [ADR-0036](./0036-use-textarea-for-chat-content.md).

## More Information

This ADR is highly linked to [ADR-0036](./0036-use-textarea-for-chat-content.md).

About the selection and copying, this goes down to fundamental issue from JavaFX.
`Text` and `Label` as a whole or a part [cannot be selected and/or copied](https://bugs.openjdk.org/browse/JDK-8091644).
Loading

0 comments on commit d477fcc

Please sign in to comment.