Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/generate-ai-actions' into genera…
Browse files Browse the repository at this point in the history
…te-ai-actions
  • Loading branch information
InAnYan committed Oct 6, 2024
2 parents 7a8399a + 76e0053 commit 7ec5b7a
Show file tree
Hide file tree
Showing 16 changed files with 349 additions and 245 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ Note that this project **does not** adhere to [Semantic Versioning](https://semv

### Added

- We added a "view as BibTeX" option before importing an entry from the citation relation tab. [#11826](https://github.com/JabRef/jabref/issues/11826)
- We added probable search hits instead of exact matches. Sorting by hit score can be done by the new score table column. [#11542](https://github.com/JabRef/jabref/pull/11542)
- We added support finding LaTeX-encoded special characters based on plain Unicode and vice versa. [#11542](https://github.com/JabRef/jabref/pull/11542)
- When a search hits a file, the file icon of that entry is changed accordingly. [#11542](https://github.com/JabRef/jabref/pull/11542)
Expand Down Expand Up @@ -54,6 +55,7 @@ Note that this project **does not** adhere to [Semantic Versioning](https://semv
- We improved the performance when pasting and importing entries in an existing library. [#11843](https://github.com/JabRef/jabref/pull/11843)
- When fulltext search is selected but indexing is deactivated, a dialog is now shown asking if the user wants to enable indexing now [#9491](https://github.com/JabRef/jabref/issues/9491)
- We changed instances of 'Search Selected' to 'Search Pre-configured' in Web Search Preferences UI. [#11871](https://github.com/JabRef/jabref/pull/11871)
- We added a new CSS style class `main-table` for the main table. [#11881](https://github.com/JabRef/jabref/pull/11881)

### Fixed

Expand Down Expand Up @@ -81,6 +83,7 @@ Note that this project **does not** adhere to [Semantic Versioning](https://semv
- We fixed an issue where unescaped braces in the arXiv fetcher were not treated. [#11704](https://github.com/JabRef/jabref/issues/11704)
- We fixed an issue where HTML instead of the fulltext pdf was downloaded when importing arXiv entries. [#4913](https://github.com/JabRef/jabref/issues/4913)
- We fixed an issue where the keywords and crossref fields were not properly focused. [#11177](https://github.com/JabRef/jabref/issues/11177)
- We fixed an issue where the Undo/Redo buttons were active even when all libraries are closed. [#11837](https://github.com/JabRef/jabref/issues/11837)
- We fixed an issue where recently opened files were not displayed in the main menu properly. [#9042](https://github.com/JabRef/jabref/issues/9042)
- 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)

Expand Down
5 changes: 5 additions & 0 deletions docs/code-howtos/faq.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,11 @@ More information on the architecture can be found at [../getting-into-the-code/h

This test is triggered when any kind of documentation is touched (be it the JabRef docs, or JavaDoc in code). If you changed something in the documentation, and particularly added/changed any links (to external files or websites), check if the links are correct and working. If you didn't change/add any link, or added correct links, the test is most probably failing due to any of the existing links being broken, and thus can be ignored (in the context of your contribution).

### Failing <b>Fetcher</b> tests

Fetcher tests are run when any file in the `.../fetcher` directory has been touched. If you have changed any fetcher logic, check if the changes are correct. You can look for more details on how to locally run fetcher tests [here](https://devdocs.jabref.org/code-howtos/testing.html#fetchers-in-tests).
Otherwise, since these tests depend on remote services, their failure can also be caused by the network or an external server, and thus can be ignored in the context of your contribution. For more information, you can look [here](https://devdocs.jabref.org/code-howtos/fetchers.html#committing-and-pushing-changes-to-fetcher-files).

## Gradle outputs

### `ANTLR Tool version 4.12.0 used for code generation does not match the current runtime version 4.13.1`
Expand Down
7 changes: 7 additions & 0 deletions docs/code-howtos/fetchers.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,3 +83,10 @@ new BuildInfo().springerNatureAPIKey
```

When executing `./gradlew run`, gradle executes `processResources` and populates `build/build.properties` accordingly. However, when working directly in the IDE, Eclipse keeps reading `build.properties` from `src/main/resources`. In IntelliJ, the task `JabRef Main` is executing `./gradlew processResources` before running JabRef from the IDE to ensure the `build.properties` is properly populated.

## Committing and pushing changes to fetcher files

Fetcher tests are run when a PR contains changes touching any file in the `src/main/java/org/jabref/logic/importer/fetcher/` directory.
Since these tests rely on remote services, some of them may fail due to the network or the external server.

To learn more about doing fetcher tests locally, see Fetchers in tests in [Testing](https://devdocs.jabref.org/code-howtos/testing.html).
10 changes: 10 additions & 0 deletions docs/code-howtos/testing.md
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,16 @@ docker run -e MYSQL_ROOT_PASSWORD=root -e MYSQL_DATABASE=jabref -p 3800:3307 mys

Set the environment variable `DBMS` to `mysql`.

## Fetchers in tests

Fetcher tests can be run locally by executing the Gradle task `fetcherTest`. This can be done by running the following command in the command line:

```shell
./gradlew fetcherTest
```

Alternatively, if one is using IntelliJ, this can also be done by double-clicking the `fetcherTest` task under the `other` group in the Gradle Tool window (`JabRef > Tasks > other > fetcherTest`).

## Advanced testing and further reading

On top of basic unit testing, there are more ways to test a software:
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/module-info.java
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,7 @@
requires jvm.openai;
requires langchain4j;
requires langchain4j.core;
requires langchain4j.google.ai.gemini;
requires langchain4j.hugging.face;
requires langchain4j.mistral.ai;
requires langchain4j.open.ai;
Expand Down Expand Up @@ -188,6 +189,5 @@
requires mslinks;
requires org.antlr.antlr4.runtime;
requires org.libreoffice.uno;
requires langchain4j.google.ai.gemini;
// endregion
}
218 changes: 217 additions & 1 deletion src/main/java/org/jabref/gui/Base.css
Original file line number Diff line number Diff line change
Expand Up @@ -340,7 +340,6 @@ TextFlow > .hyperlink:visited,
-fx-underline: true;
}


.glyph-icon {
/* This adjusts text alignment within the bounds of text nodes so that
the text is always vertically centered within the bounds. Based on
Expand Down Expand Up @@ -1517,4 +1516,221 @@ We want to have a look that matches our icons in the tool-bar */
-fx-background-color: transparent;
}

/* endregion */

/* region: maintable css */


.main-table .column-icon {
-fx-alignment: baseline-center;
-fx-padding: 0;
}

.main-table .column-header.column-icon > .label {
-fx-padding: 0;
-fx-alignment: baseline-center;
}

.main-table .empty-special-field {
visibility: hidden;
}

.main-table .table-row-cell:hover .empty-special-field {
visibility: visible;
-fx-icon-color: -jr-gray-2;
-fx-fill: -jr-gray-2;
}

.main-table .table-row-cell:dragOver-bottom {
-fx-border-color: -jr-drag-target;
-fx-border-width: 0 0 2 0;
-fx-padding: 0 0 -2 0;
}

.main-table .table-row-cell:dragOver-center {
-fx-border-color: -jr-drag-target;
-fx-border-width: 1 1 1 1;
-fx-padding: -1 -1 -1 -1;
-fx-background-color: -jr-drag-target-hover;
}

.main-table .table-row-cell:dragOver-top {
-fx-border-color: -jr-drag-target;
-fx-border-width: 2 0 0 0;
-fx-padding: -2 0 0 0;
}

/** even and odd are swapped around somehow. Below "odd" matches lines 2, 4, ... **/

.main-table .table-row-cell:matching-search-and-groups {
-fx-background-color: -jr-match-1-even;
}
.main-table .table-row-cell:matching-search-and-groups > .table-cell {
-fx-text-fill: -jr-match-1-text-color;
}
.main-table .table-row-cell:matching-search-and-groups:focused > .table-cell {
-fx-text-fill: -fx-focused-text-base-color;
}
.main-table .table-row-cell:matching-search-and-groups:focused:hover > .table-cell {
-fx-text-fill: -jr-maintable-focused-hover-text;
}
.main-table .table-row-cell:matching-search-and-groups:focused:hover > .table-cell > .ikonli-font-icon {
-fx-icon-color: -jr-maintable-focused-hover-text;
}
.main-table .table-row-cell:matching-search-and-groups:hover > .table-cell {
-fx-text-fill: -jr-hover-text;
}
.main-table .table-row-cell:matching-search-and-groups > .table-cell > .ikonli-font-icon {
-fx-icon-color: -jr-match-1-text-color;
}
.main-table .table-row-cell:matching-search-and-groups:hover > .table-cell > .ikonli-font-icon {
-fx-icon-color: -jr-hover-text;
}
.main-table .table-row-cell:matching-search-and-groups:odd {
-fx-background-color: -jr-match-1-odd;
}
.main-table .table-row-cell:matching-search-and-groups:odd:selected,
.main-table .table-row-cell:matching-search-and-groups:odd:focused,
.main-table .table-row-cell:matching-search-and-groups:odd:focused:hover,
.main-table .table-row-cell:matching-search-and-groups:focused:hover {
-fx-background-color: -jr-selected;
}
.main-table .table-row-cell:matching-search-and-groups:odd:hover {
-fx-background-color: -jr-hover;
}

.main-table .table-row-cell:matching-search-not-groups {
-fx-background-color: -jr-match-2-even;
}
.main-table .table-row-cell:matching-search-not-groups > .table-cell {
-fx-text-fill: -jr-match-2-text-color;
}
.main-table .table-row-cell:matching-search-not-groups:focused > .table-cell {
-fx-text-fill: -fx-focused-text-base-color;
}
.main-table .table-row-cell:matching-search-not-groups:focused:hover > .table-cell {
-fx-text-fill: -jr-maintable-focused-hover-text;
}
.main-table .table-row-cell:matching-search-not-groups:focused:hover > .table-cell > .ikonli-font-icon {
-fx-icon-color: -jr-maintable-focused-hover-text;
}
.main-table .table-row-cell:matching-search-not-groups:hover > .table-cell {
-fx-text-fill: -jr-hover-text;
}
.main-table .table-row-cell:matching-search-not-groups > .table-cell > .ikonli-font-icon {
-fx-icon-color: -jr-match-2-text-color;
}
.main-table .table-row-cell:matching-search-not-groups:hover > .table-cell > .ikonli-font-icon {
-fx-icon-color: -jr-hover-text;
}
.main-table .table-row-cell:matching-search-not-groups:odd {
-fx-background-color: -jr-match-2-odd;
}
.main-table .table-row-cell:matching-search-not-groups:odd:selected,
.main-table .table-row-cell:matching-search-not-groups:odd:focused,
.main-table .table-row-cell:matching-search-not-groups:odd:focused:hover,
.main-table .table-row-cell:matching-search-not-groups:focused:hover {
-fx-background-color: -jr-selected;
}
.main-table .table-row-cell:matching-search-not-groups:odd:hover {
-fx-background-color: -jr-hover;
}

.main-table .table-row-cell:matching-groups-not-search {
-fx-background-color: -jr-match-3-even;
}
.main-table .table-row-cell:matching-groups-not-search > .table-cell {
-fx-text-fill: -jr-match-3-text-color;
}
.main-table .table-row-cell:matching-groups-not-search:focused > .table-cell {
-fx-text-fill: -fx-focused-text-base-color;
}
.main-table .table-row-cell:matching-groups-not-search:focused:hover > .table-cell {
-fx-text-fill: -jr-maintable-focused-hover-text;
}
.main-table .table-row-cell:matching-groups-not-search:focused:hover > .table-cell > .ikonli-font-icon {
-fx-icon-color: -jr-maintable-focused-hover-text;
}
.main-table .table-row-cell:matching-groups-not-search:hover > .table-cell {
-fx-text-fill: -jr-hover-text;
}
.main-table .table-row-cell:matching-groups-not-search > .table-cell > .ikonli-font-icon {
-fx-icon-color: -jr-match-3-text-color;
}
.main-table .table-row-cell:matching-groups-not-search:hover > .table-cell > .ikonli-font-icon {
-fx-icon-color: -jr-hover-text;
}
.main-table .table-row-cell:matching-groups-not-search:odd {
-fx-background-color: -jr-match-3-odd;
}
.main-table .table-row-cell:matching-groups-not-search:odd:selected,
.main-table .table-row-cell:matching-groups-not-search:odd:focused,
.main-table .table-row-cell:matching-groups-not-search:odd:focused:hover,
.main-table .table-row-cell:matching-groups-not-search:focused:hover {
-fx-background-color: -jr-selected;
}
.main-table .table-row-cell:matching-groups-not-search:odd:hover {
-fx-background-color: -jr-hover;
}

.main-table .table-row-cell:not-matching-search-and-groups {
-fx-background-color: -jr-match-4-even;
}
.main-table .table-row-cell:not-matching-search-and-groups > .table-cell {
-fx-text-fill: -jr-match-4-text-color;
}
.main-table .table-row-cell:not-matching-search-and-groups:focused > .table-cell {
-fx-text-fill: -fx-focused-text-base-color;
}
.main-table .table-row-cell:not-matching-search-and-groups:focused:hover > .table-cell {
-fx-text-fill: -jr-maintable-focused-hover-text;
}
.main-table .table-row-cell:not-matching-search-and-groups:focused:hover > .table-cell > .ikonli-font-icon {
-fx-icon-color: -jr-maintable-focused-hover-text;
}
.main-table .table-row-cell:not-matching-search-and-groups:hover > .table-cell {
-fx-text-fill: -jr-hover-text;
}
.main-table .table-row-cell:not-matching-search-and-groups > .table-cell > .ikonli-font-icon {
-fx-icon-color: -jr-match-4-text-color;
}
.main-table.table-row-cell:not-matching-search-and-groups:hover > .table-cell > .ikonli-font-icon {
-fx-icon-color: -jr-hover-text;
}
.main-table .table-row-cell:not-matching-search-and-groups:odd {
-fx-background-color: -jr-match-4-odd;
}
.main-table .table-row-cell:not-matching-search-and-groups:odd:selected,
.main-table .table-row-cell:not-matching-search-and-groups:odd:focused,
.main-table .table-row-cell:not-matching-search-and-groups:odd:focused:hover,
.main-table .table-row-cell:not-matching-search-and-groups:focused:hover {
-fx-background-color: -jr-selected;
}
.main-table .table-row-cell:not-matching-search-and-groups:odd:hover {
-fx-background-color: -jr-hover;
}

.rating > .container {
-fx-spacing: 2;
}

.rating > .container > .button {
-fx-pref-width: 16;
-fx-pref-height: 10;
-fx-background-repeat: no-repeat no-repeat;
-fx-background-size: 16 16;
-fx-border-style: none;
-fx-border-width: 0;
-fx-padding: 0;
}

.rating > .container > .button.strong {

}

.rating > .container > .button:hover {
-fx-effect: dropshadow(three-pass-box, rgba(0, 0, 0, 0.6), 8, 0.0, 0, 0);
}


/* endregion */
4 changes: 2 additions & 2 deletions src/main/java/org/jabref/gui/LibraryTab.java
Original file line number Diff line number Diff line change
Expand Up @@ -260,8 +260,8 @@ private EntryEditor createEntryEditor() {
Supplier<LibraryTab> tabSupplier = () -> this;
return new EntryEditor(this,
// Actions are recreated here since this avoids passing more parameters and the amount of additional memory consumption is neglegtable.
new UndoAction(tabSupplier, dialogService, stateManager),
new RedoAction(tabSupplier, dialogService, stateManager));
new UndoAction(tabSupplier, undoManager, dialogService, stateManager),
new RedoAction(tabSupplier, undoManager, dialogService, stateManager));
}

private static void addChangedInformation(StringBuilder text, String fileName) {
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/org/jabref/gui/entryeditor/EntryEditor.java
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,7 @@ private List<EntryEditorTab> createTabs() {
tabs.add(new FileAnnotationTab(libraryTab.getAnnotationCache()));
tabs.add(new SciteTab(preferences, taskExecutor, dialogService));
tabs.add(new CitationRelationsTab(dialogService, databaseContext,
undoManager, stateManager, fileMonitor, preferences, libraryTab, taskExecutor));
undoManager, stateManager, fileMonitor, preferences, libraryTab, taskExecutor, bibEntryTypesManager));
tabs.add(new RelatedArticlesTab(buildInfo, databaseContext, preferences, dialogService, taskExecutor));
sourceTab = new SourceTab(
databaseContext,
Expand Down
Loading

0 comments on commit 7ec5b7a

Please sign in to comment.