Sort projects by start date (latest first) and then title since those are the most likely relevant projects.

This commit is contained in:
Andreas Svanberg 2025-03-04 10:49:41 +01:00
parent d68414947a
commit 5ae62e771f

@ -49,7 +49,10 @@ public class EditGroupPanel extends Panel {
// since they may not be included in the relevant projects if they're inactive or completed.
// To allow them to be removed from the group, it will not be possible to add them again.
projects.addAll(model.getObject().getProjects());
return projects.stream().toList();
return projects
.stream()
.sorted(Comparator.comparing(Project::getStartDate).reversed().thenComparing(Project::getTitle))
.toList();
});
add(
new ListView<>("available_projects", availableProjects) {