Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix GroupTreeView not updating when generating groups dynamically #7153

Closed
wants to merge 2 commits into from
Closed

Fix GroupTreeView not updating when generating groups dynamically #7153

wants to merge 2 commits into from

Conversation

HoussemNasri
Copy link
Member

@HoussemNasri HoussemNasri commented Dec 3, 2020

Fixes #7129

Video Demonstration :
Alt text

  • Change in CHANGELOG.md described (if applicable)
  • Tests created for changes (if applicable)
  • Manually tested changed features in running JabRef (always required)
  • Screenshots added in PR description (for UI changes)
  • Checked documentation: Is the information available and up to date? If not created an issue at https://github.com/JabRef/user-documentation/issues or, even better, submitted a pull request to the documentation repository.

@Siedlerchr Siedlerchr added the status: ready-for-review Pull Requests that are ready to be reviewed by the maintainers label Dec 3, 2020
@tobiasdiez
Copy link
Member

Thanks for working on this!
Your current solution sadly doesn't scale to huge databases with a lot of groups. Some users have 10k entries with many groups, and creating the groups tree in such a situation takes some time. Since you are essentially recreating the whole groups tree on every field change, this would sadly freeze JabRef (ok at least make typing very very sluggish).

Since the AutomaticGroup already gets the list of entries, it can listen for changes on the entries in principle without the need to reconstruct the whole groups tree. However, I was not able to make that work (but also didn't tried to hard):

public ObservableList<GroupTreeNode> createSubgroups(ObservableList<BibEntry> entries) {
// TODO: Propagate changes to entry list (however: there is no flatMap and collect as TransformationList)
return entries.stream()
.flatMap(entry -> createSubgroups(entry).stream())
.collect(TreeCollector.mergeIntoTree(GroupTreeNode::isSameGroupAs));
}

@HoussemNasri
Copy link
Member Author

HoussemNasri commented Dec 3, 2020

Thanks for your fast feedback.
I didn't think about scale, the problem turns out to be harder than I thought. I am closing this since it can't be merged

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: ready-for-review Pull Requests that are ready to be reviewed by the maintainers
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Automatic keyword groups do not update in group list when keywords change
3 participants