Skip to content

Conversation

@InAnYan
Copy link
Member

@InAnYan InAnYan commented Nov 2, 2025

Closes https://github.com/JabRef/jabref-issue-melting-pot/issues/1091

Just a UI enhancement. Adds various labels that tell user what needs to be done to start SLR.

image

Steps to test

Go to the menu, start SLR, go to the tab finalize. Try to fulfill some of the requirements - some messages will be cleared.

Mandatory checks

  • I own the copyright of the code submitted and I license it under the MIT license
  • I manually tested my changes in running JabRef (always required)
  • [/] I added JUnit tests for changes (if applicable)
  • I added screenshots in the PR description (if change is visible to the user)
  • I described the change in CHANGELOG.md in a way that is understandable for the average user (if change is visible to the user)
  • I checked the user documentation: Is the information available and up to date? If not, I created an issue at https://github.com/JabRef/user-documentation/issues or, even better, I submitted a pull request updating file(s) in https://github.com/JabRef/user-documentation/tree/main/en.

@InAnYan
Copy link
Member Author

InAnYan commented Nov 2, 2025

IDK if a changelog entry is needed

@InAnYan
Copy link
Member Author

InAnYan commented Nov 2, 2025

Ah, sorry, I forgot about JabRef_en

@InAnYan InAnYan marked this pull request as draft November 2, 2025 18:19
@jabref-machine
Copy link
Collaborator

JUnit tests of jablib are failing. You can see which checks are failing by locating the box "Some checks were not successful" on the pull request page. To see the test output, locate "Source Code Tests / Unit tests (pull_request)" and click on it.

You can then run these tests in IntelliJ to reproduce the failing tests locally. We offer a quick test running howto in the section Final build system checks in our setup guide.

}

private void initializeValidationBindings() {
titleValidationMessage.bind(Bindings.when(title.isEmpty())
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please use our ValidationSatus approach with the controlsfx visualizer

private void setupValidation() {
validator = new CompositeValidator();
nameValidator = new FunctionBasedValidator<>(
nameProperty,
StringUtil::isNotBlank,
ValidationMessage.error(Localization.lang("Please enter a name for the group.")));
nameContainsDelimiterValidator = new FunctionBasedValidator<>(
nameProperty,
name -> !name.contains(Character.toString(preferences.getBibEntryPreferences().getKeywordSeparator())),
ValidationMessage.warning(
Localization.lang(
"The group name contains the keyword separator \"%0\" and thus probably does not work as expected.",
Character.toString(preferences.getBibEntryPreferences().getKeywordSeparator())
)));
sameNameValidator = new FunctionBasedValidator<>(
nameProperty,
name -> {
Optional<GroupTreeNode> rootGroup = currentDatabase.getMetaData().getGroups();
if (rootGroup.isPresent()) {
boolean groupsExistWithSameName = !rootGroup.get().findChildrenSatisfying(group -> group.getName().equals(name)).isEmpty();
if ((editedGroup == null) && groupsExistWithSameName) {
// New group but there is already one group with the same name
return false;
}
// Edit group, changed name to something that is already present
return (editedGroup == null) || editedGroup.getName().equals(name) || !groupsExistWithSameName;
}
return true;
},
ValidationMessage.warning(
Localization.lang("There already exists a group with the same name.\nIf you use it, it will inherit all entries from this other group.")
)
);

PS: Next time tell your AI tool to follow existing patterns in the codebase

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay, you got me

But I thought those things only work for fields

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants