Skip to content

Commit 2a819aa

Browse files
committed
Merge remote-tracking branch 'upstream/main'
* upstream/main: Fix NoSuchElementException in ThreeWayMerge dialog (#13838) Keep global search bar open when keep on top pin is selected (#13846) Spell "BibDesk" with capital "D" (#13847) fix: Improper icon sizing with respect to font size (#13841) Ensure latest JDK veriant (#13843)
2 parents 511549f + 577bbb6 commit 2a819aa

File tree

12 files changed

+105
-31
lines changed

12 files changed

+105
-31
lines changed

.github/workflows/binaries.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,7 @@ jobs:
197197
with:
198198
java-version: '24'
199199
distribution: 'corretto'
200-
java-package: 'jdk'
200+
check-latest: true
201201
- name: Setup Gradle
202202
uses: gradle/actions/setup-gradle@v4
203203
- name: Generate JBang cache key

.github/workflows/publish.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ jobs:
9494
with:
9595
java-version: '24'
9696
distribution: 'corretto'
97-
java-package: 'jdk'
97+
check-latest: true
9898
- name: Setup Gradle
9999
uses: gradle/actions/setup-gradle@v4
100100
- name: Generate JBang cache key

.github/workflows/run-openrewrite.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ jobs:
3535
with:
3636
java-version: 24
3737
distribution: 'corretto'
38+
check-latest: true
3839
- name: Setup Gradle
3940
uses: gradle/actions/setup-gradle@v4
4041
- name: Generate JBang cache key

.github/workflows/tests-code-fetchers.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ jobs:
5757
with:
5858
java-version: 24
5959
distribution: 'corretto'
60+
check-latest: true
6061
- name: Setup Gradle
6162
uses: gradle/actions/setup-gradle@v4
6263
- name: Run fetcher tests

.github/workflows/tests-code.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ jobs:
5252
with:
5353
java-version: 24
5454
distribution: 'corretto'
55+
check-latest: true
5556
- name: Run checkstyle reporter
5657
uses: dbelyaev/action-checkstyle@master
5758
with:
@@ -91,6 +92,7 @@ jobs:
9192
with:
9293
java-version: 24
9394
distribution: 'corretto'
95+
check-latest: true
9496
- name: Setup Gradle
9597
uses: gradle/actions/setup-gradle@v4
9698
- name: Generate JBang cache key
@@ -125,6 +127,7 @@ jobs:
125127
with:
126128
java-version: 24
127129
distribution: 'corretto'
130+
check-latest: true
128131
- name: Setup Gradle
129132
uses: gradle/actions/setup-gradle@v4
130133
- name: Generate JBang cache key
@@ -242,6 +245,7 @@ jobs:
242245
with:
243246
java-version: 24
244247
distribution: 'corretto'
248+
check-latest: true
245249
- name: Setup Gradle
246250
uses: gradle/actions/setup-gradle@v4
247251
- name: Generate JBang cache key
@@ -277,6 +281,7 @@ jobs:
277281
with:
278282
java-version: 24
279283
distribution: 'corretto'
284+
check-latest: true
280285
- name: Generate JBang cache key
281286
id: cache-key
282287
shell: bash
@@ -325,6 +330,7 @@ jobs:
325330
with:
326331
java-version: 24
327332
distribution: 'corretto'
333+
check-latest: true
328334
- name: Setup Gradle
329335
uses: gradle/actions/setup-gradle@v4
330336
- name: Generate JBang cache key
@@ -374,6 +380,7 @@ jobs:
374380
with:
375381
java-version: 24
376382
distribution: 'corretto'
383+
check-latest: true
377384
- name: Setup Gradle
378385
uses: gradle/actions/setup-gradle@v4
379386
- name: Generate JBang cache key
@@ -422,6 +429,7 @@ jobs:
422429
with:
423430
java-version: 24
424431
distribution: 'corretto'
432+
check-latest: true
425433
- name: Generate JBang cache key
426434
id: cache-key
427435
shell: bash
@@ -462,6 +470,7 @@ jobs:
462470
with:
463471
java-version: 24
464472
distribution: 'corretto'
473+
check-latest: true
465474
- name: Generate JBang cache key
466475
id: cache-key
467476
shell: bash
@@ -538,6 +547,7 @@ jobs:
538547
with:
539548
java-version: 24
540549
distribution: 'corretto'
550+
check-latest: true
541551
- name: Setup Gradle
542552
uses: gradle/actions/setup-gradle@v4
543553
- name: Generate JBang cache key
@@ -583,6 +593,7 @@ jobs:
583593
with:
584594
java-version: 24
585595
distribution: 'corretto'
596+
check-latest: true
586597
- name: Setup Gradle
587598
uses: gradle/actions/setup-gradle@v4
588599
- run: ./gradlew traceRequirements

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,7 @@ Note that this project **does not** adhere to [Semantic Versioning](https://semv
9191
- We improved nested scrolling for the web search tab in the preferences dialog [#13791](https://github.com/JabRef/jabref/pull/13791)
9292
- We improved the event viewer for debugging [#13783](https://github.com/JabRef/jabref/pull/13783).
9393
- We improved "REDACTED" replacement of API key value in web fetcher search URL [#13796](https://github.com/JabRef/jabref/issues/13796)
94+
- When the pin "Keep dialog always on top" in the global search dialog is selected, the search window stays open when double-clicking on an entry. [#13840](https://github.com/JabRef/jabref/issues/13840)
9495

9596
### Fixed
9697

@@ -125,6 +126,7 @@ Note that this project **does not** adhere to [Semantic Versioning](https://semv
125126
- We fixed an issue where "Copy to" was enabled even if no other library was opened. [#13280](https://github.com/JabRef/jabref/pull/13280)
126127
- We fixed an issue where the groups were still displayed after closing all libraries. [#13382](https://github.com/JabRef/jabref/issues/13382)
127128
- Enhanced field selection logic in the Merge Entries dialog when fetching from DOI to prefer valid years and entry types. [#12549](https://github.com/JabRef/jabref/issues/12549)
129+
- We fixed an issue where opening the Three Way Merge dialog would throw an exception when year field contains an invalid year value. [#13673](https://github.com/JabRef/jabref/issues/13673)
128130
- We improved consistency in the Add Buttons. [#13791](https://github.com/JabRef/jabref/pull/13791)
129131
- We fixed an issue where theme or font size are not respected for all dialogs [#13558](https://github.com/JabRef/jabref/issues/13558)
130132
- We removed unnecessary spacing and margin in the AutomaticFieldEditor. [#13792](https://github.com/JabRef/jabref/pull/13792)

jabgui/src/main/java/org/jabref/gui/search/GlobalSearchResultDialog.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,9 @@ private void initialize() {
9797

9898
stateManager.activeSearchQuery(SearchType.NORMAL_SEARCH).set(stateManager.activeSearchQuery(SearchType.GLOBAL_SEARCH).get());
9999
stateManager.activeTabProperty().get().ifPresent(tab -> tab.clearAndSelect(selectedEntry.getEntry()));
100-
stage.close();
100+
if (!keepOnTop.isSelected()) {
101+
stage.hide();
102+
}
101103
}
102104
});
103105

jabgui/src/main/resources/org/jabref/gui/Base.css

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1097,14 +1097,28 @@ TextFlow > .tooltip-text-monospaced {
10971097
-fx-border-width: 0;
10981098
}
10991099

1100+
.mainToolbar .icon-button {
1101+
-fx-padding: 0.5em;
1102+
}
1103+
1104+
/*
1105+
* -fx-icon-size is intentionally omitted to prevent a rendering loop. The library sets font size
1106+
* based on the computed icon size, which is itself relative to the font size.
1107+
*/
11001108
.mainToolbar .glyph-icon,
11011109
.mainToolbar .ikonli-font-icon {
1102-
-fx-font-size: 1.7em;
1110+
/* `!important` is override library's default font size */
1111+
-fx-font-size: 1.7em!important;
11031112
-fx-fill: -jr-theme-text;
11041113
-fx-text-fill: -jr-theme-text;
11051114
-fx-icon-color: -jr-theme-text;
11061115
}
11071116

1117+
.mainToolbar .progress-indicator {
1118+
-fx-min-width: 2.8em;
1119+
-fx-max-width: 2.8em;
1120+
}
1121+
11081122
.search-field {
11091123
-fx-background-color: -jr-search-background;
11101124
-fx-border-width: 1;
@@ -3207,7 +3221,7 @@ journalInfo .grid-cell-b {
32073221
-fx-hgap: 1.5em;
32083222
-fx-vgap: 0.8em;
32093223
}
3210-
3224+
32113225
/* Automatic Field Editor */
32123226
.edit-field-content-pane {
32133227
-fx-padding: 0em 1em;

jabgui/src/test/java/org/jabref/gui/mergeentries/FieldRowViewModelTest.java

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -224,14 +224,23 @@ void newYearShouldBeSelectedForYearsWithLargeValueGap() {
224224
}
225225

226226
@Test
227-
void yearInRangeShouldBeSelected() {
227+
void selectRightYearWhenInRange() {
228228
BibEntry leftEntry = new BibEntry().withField(StandardField.YEAR, "1700");
229229
BibEntry rightEntry = new BibEntry().withField(StandardField.YEAR, "2000");
230230
FieldRowViewModel yearField = new FieldRowViewModel(StandardField.YEAR, leftEntry, rightEntry, mergedEntry, fieldMergerFactory);
231231
yearField.autoSelectBetterValue();
232232
assertEquals(FieldRowViewModel.Selection.RIGHT, yearField.getSelection());
233233
}
234234

235+
@Test
236+
void selectLeftYearWhenInRange() {
237+
BibEntry leftEntry = new BibEntry().withField(StandardField.YEAR, "2005");
238+
BibEntry rightEntry = new BibEntry().withField(StandardField.YEAR, "1700");
239+
FieldRowViewModel yearField = new FieldRowViewModel(StandardField.YEAR, leftEntry, rightEntry, mergedEntry, fieldMergerFactory);
240+
yearField.autoSelectBetterValue();
241+
assertEquals(FieldRowViewModel.Selection.LEFT, yearField.getSelection());
242+
}
243+
235244
public FieldRowViewModel createViewModelForField(Field field) {
236245
return new FieldRowViewModel(field, leftEntry, rightEntry, mergedEntry, fieldMergerFactory);
237246
}

jablib/src/main/java/org/jabref/logic/bibtex/comparator/YearFieldValuePlausibilityComparator.java

Lines changed: 40 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
import java.util.regex.Pattern;
77

88
import org.jabref.logic.integrity.YearChecker;
9+
import org.jabref.model.strings.StringUtil;
910

1011
public class YearFieldValuePlausibilityComparator extends FieldValuePlausibilityComparator {
1112

@@ -21,28 +22,50 @@ public class YearFieldValuePlausibilityComparator extends FieldValuePlausibility
2122

2223
@Override
2324
public ComparisonResult compare(String leftValue, String rightValue) {
24-
YearChecker checker = new YearChecker();
25+
boolean isLeftBlank = StringUtil.isBlank(leftValue);
26+
boolean isRightBlank = StringUtil.isBlank(rightValue);
27+
if (isLeftBlank && !isRightBlank) {
28+
return ComparisonResult.RIGHT_BETTER;
29+
} else if (isRightBlank && !isLeftBlank) {
30+
return ComparisonResult.LEFT_BETTER;
31+
} else if (isLeftBlank && isRightBlank) {
32+
return ComparisonResult.UNDETERMINED;
33+
}
2534

26-
boolean leftValid = checker.checkValue(leftValue).isEmpty();
35+
// left and right values are not blank.
2736

28-
if (leftValid) {
29-
Optional<Integer> leftYear = extractYear(leftValue);
30-
Optional<Integer> rightYear = extractYear(rightValue);
37+
boolean leftValueCorrectlyFormatted = YearChecker.isValueCorrectlyFormatted(leftValue);
38+
boolean rightValueCorrectlyFormatted = YearChecker.isValueCorrectlyFormatted(rightValue);
39+
if (leftValueCorrectlyFormatted && !rightValueCorrectlyFormatted) {
40+
return ComparisonResult.LEFT_BETTER;
41+
} else if (rightValueCorrectlyFormatted && !leftValueCorrectlyFormatted) {
42+
return ComparisonResult.RIGHT_BETTER;
43+
} else if (!leftValueCorrectlyFormatted && !rightValueCorrectlyFormatted) {
44+
return ComparisonResult.UNDETERMINED;
45+
}
3146

32-
boolean leftYearInRange = (leftYear.get() >= 1800) && (leftYear.get() <= Year.now().getValue() + 2);
47+
// left and right values are correctly formatted.
3348

34-
if (leftYearInRange) {
35-
int diff = Math.abs(leftYear.get() - rightYear.get());
36-
if (diff > 10) {
37-
return rightYear.get() > leftYear.get()
38-
? ComparisonResult.RIGHT_BETTER
39-
: ComparisonResult.LEFT_BETTER;
40-
}
41-
return ComparisonResult.UNDETERMINED; // years are close, undetermined
42-
}
49+
int leftYear = extractYear(leftValue).get();
50+
int rightYear = extractYear(rightValue).get();
51+
boolean leftYearInRange = (leftYear >= 1800) && (leftYear <= Year.now().getValue() + 2);
52+
boolean rightYearInRange = (rightYear >= 1800) && (rightYear <= Year.now().getValue() + 2);
53+
if (leftYearInRange && !rightYearInRange) {
54+
return ComparisonResult.LEFT_BETTER;
55+
} else if (rightYearInRange && !leftYearInRange) {
4356
return ComparisonResult.RIGHT_BETTER;
44-
}
45-
return ComparisonResult.RIGHT_BETTER;
57+
} else if (!leftYearInRange && !rightYearInRange) {
58+
return ComparisonResult.UNDETERMINED;
59+
}
60+
61+
int diff = Math.abs(leftYear - rightYear);
62+
if (diff > 10) {
63+
return rightYear > leftYear
64+
? ComparisonResult.RIGHT_BETTER
65+
: ComparisonResult.LEFT_BETTER;
66+
}
67+
68+
return ComparisonResult.UNDETERMINED; // years are close, undetermined
4669
}
4770

4871
/**

0 commit comments

Comments
 (0)