Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ Note that this project **does not** adhere to [Semantic Versioning](https://semv
- We fixed an issue where back navigation selected a deleted entry instead of skipping it. [#17353](https://github.com/JabRef/jabref/issues/17353)
- We fixed the linked file tooltip showing the old file name after renaming or moving the file. [#9277](https://github.com/JabRef/jabref/issues/9277)
- We fixed an issue where citationcount, day, and dayfiled columns were sorted alphabetically instead of numerically. [#17459](https://github.com/JabRef/jabref/issues/17459)
- We fixed subgroups disappearing after adding them from the "All entries" context menu in a new library. [#17764](https://github.com/JabRef/jabref/issues/17764)

## [6.0-beta.1] - 2026-09-21

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -247,11 +247,17 @@ public void addNewSubgroup(GroupNodeViewModel parent, GroupDialogHeader groupDia
null,
groupDialogHeader));

if (currentDatabase.filter(active -> active == database).isEmpty()) {
return;
}

// A context menu can still refer to the old "All entries" node after the tree is rebuilt.
GroupNodeViewModel currentParent = parent.isAllEntriesGroup() ? rootGroup.get() : parent;
newGroup.ifPresent(group -> recordTreeChange(Localization.lang("Add group"), _ -> {
GroupTreeNode newSubgroup = parent.addSubgroup(group);
GroupTreeNode newSubgroup = currentParent.addSubgroup(group);
// [impl->req~ux.groups.create-explicit-from-selection~1]
GroupNodeViewModel newViewModel = parent.findGroupNodeViewModel(newSubgroup)
.orElseGet(() -> new GroupNodeViewModel(database, stateManager, taskExecutor, newSubgroup, localDragboard, preferences));
GroupNodeViewModel newViewModel = currentParent.findGroupNodeViewModel(newSubgroup)
.orElseGet(() -> new GroupNodeViewModel(database, stateManager, taskExecutor, newSubgroup, localDragboard, preferences));
selectedGroups.setAll(newViewModel);

// TODO: expand the parent so the new group is visible
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,24 @@
groupTree = new GroupTreeViewModel(stateManager, mock(BibEntryTypesManager.class), preferences, dialogService, mock(AiService.class), new CustomLocalDragboard(), taskExecutor);
}

@Test
void addSubgroupFromPreviousRootPersistsInCurrentTree() {
JavaFxExtension.invokeAndWait(() -> {
GroupNodeViewModel previousRoot = groupTree.rootGroupProperty().get();
databaseContext.getDatabase().insertEntry(new BibEntry());
activeDatabase.setValue(Optional.empty());
activeDatabase.setValue(Optional.of(databaseContext));

try (var ignored = mockConstruction(GroupDialogView.class)) {

Check failure on line 116 in jabgui/src/test/java/org/jabref/gui/groups/GroupTreeViewModelTest.java

View workflow job for this annotation

GitHub Actions / Unit tests – jabgui

cannot find symbol

Check failure on line 116 in jabgui/src/test/java/org/jabref/gui/groups/GroupTreeViewModelTest.java

View workflow job for this annotation

GitHub Actions / Modernizer

cannot find symbol

Check failure on line 116 in jabgui/src/test/java/org/jabref/gui/groups/GroupTreeViewModelTest.java

View workflow job for this annotation

GitHub Actions / Dependency Scopes

cannot find symbol

Check failure on line 116 in jabgui/src/test/java/org/jabref/gui/groups/GroupTreeViewModelTest.java

View workflow job for this annotation

GitHub Actions / Checkstyle

cannot find symbol
when(dialogService.showCustomDialogAndWait(any(GroupDialogView.class)))

Check failure on line 117 in jabgui/src/test/java/org/jabref/gui/groups/GroupTreeViewModelTest.java

View workflow job for this annotation

GitHub Actions / Unit tests – jabgui

cannot find symbol

Check failure on line 117 in jabgui/src/test/java/org/jabref/gui/groups/GroupTreeViewModelTest.java

View workflow job for this annotation

GitHub Actions / Modernizer

cannot find symbol

Check failure on line 117 in jabgui/src/test/java/org/jabref/gui/groups/GroupTreeViewModelTest.java

View workflow job for this annotation

GitHub Actions / Dependency Scopes

cannot find symbol

Check failure on line 117 in jabgui/src/test/java/org/jabref/gui/groups/GroupTreeViewModelTest.java

View workflow job for this annotation

GitHub Actions / Checkstyle

cannot find symbol
.thenReturn(Optional.of(new ExplicitGroup("a", GroupHierarchyType.INDEPENDENT, ',')));
groupTree.addNewSubgroup(previousRoot, GroupDialogHeader.SUBGROUP);
}
});

assertEquals(List.of("a"), childNames());
}

@Test
void rootGroupIsAllEntriesByDefault() {
AllEntriesGroup allEntriesGroup = new AllEntriesGroup("All entries");
Expand Down
Loading