-
-
Notifications
You must be signed in to change notification settings - Fork 3.2k
Fix for group focus after removing the filter (14084) #14883
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
base: main
Are you sure you want to change the base?
Conversation
|
Hey @ZiadAbdElFatah! 👋 Thank you for contributing to JabRef! We have automated checks in place, based on which you will soon get feedback if any of them are failing. We also use Qodo for review assistance. It will update your pull request description with a review help and offer suggestions to improve the pull request. After all automated checks pass, a maintainer will also review your contribution. Once that happens, you can go through their comments in the "Files changed" tab and act on them, or reply to the conversation if you have further inputs. You can read about the whole pull request process in our contribution guide. Please ensure that your pull request is in line with our AI Usage Policy and make necessary disclosures. |
8730280 to
5c020ce
Compare
|
I need help here.
I tried to reformat my code but when typed |
|
This is my first pr with JabRef, i went with the docs step by step, in this step of checkstyle setup When i tried to restore the file to its original state the JavaDoc formatting is disabled. I din't know if this is a bug or what. |
PR Compliance Guide 🔍Below is a summary of compliance checks for this PR:
Compliance status legend🟢 - Fully Compliant🟡 - Partial Compliant 🔴 - Not Compliant ⚪ - Requires Further Human Verification 🏷️ - Compliance label |
||||||||||||||||||||||||||||||||
PR Code Suggestions ✨Explore these optional code suggestions:
|
|||||||||
PR Compliance Guide 🔍Below is a summary of compliance checks for this PR:
Compliance status legend🟢 - Fully Compliant🟡 - Partial Compliant 🔴 - Not Compliant ⚪ - Requires Further Human Verification 🏷️ - Compliance label |
||||||||||||||||||||||||||||
PR Code Suggestions ✨Explore these optional code suggestions:
|
|||||||||
|
Ignore the comments above, i saw this #14860 got merged, so i updated the branch and everything is fine now. |
| final String filterText = searchField.textProperty().getValue(); | ||
| if (filterText == null || filterText.isEmpty()) { | ||
| Platform.runLater(() -> { | ||
| viewModel.selectedGroupsProperty().setAll(previouslySelectedGroup); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this work even if the current group is not shown? -- Java comment needed
| final List<GroupNodeViewModel> previouslySelectedGroup = new ArrayList<>(viewModel.selectedGroupsProperty()); | ||
| viewModel.filterTextProperty().setValue(searchField.textProperty().getValue()); | ||
| final String filterText = searchField.textProperty().getValue(); | ||
| if (filterText == null || filterText.isEmpty()) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can filterText be null in some cases? I know that AI generates this code, but I want to add some confidence.
| LOGGER.debug("Run group search {}", searchField.getText()); | ||
|
|
||
| final List<GroupNodeViewModel> previouslySelectedGroup = new ArrayList<>(viewModel.selectedGroupsProperty()); | ||
| viewModel.filterTextProperty().setValue(searchField.textProperty().getValue()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Isn't the main reason at the listeners running when setValue is called?



User description
Closes 14084
I saved the group selected after applying a filter, and when the filter changes, I made sure that the new filter isn't empty to ensure the case of clearing, if it is empty I assign the group selected before as the current selected one.
Steps to test
1.


2.
3.
Mandatory checks
CHANGELOG.mdin a way that is understandable for the average user (if change is visible to the user)PR Type
Bug fix
Description
Preserves group selection when clearing filter text
Saves selected groups before filter change, restores if filter becomes empty
Uses Platform.runLater to ensure UI update after filter change
Removes unnecessary ENABLE_JAVADOC_FORMATTING configuration option
Diagram Walkthrough
File Walkthrough
GroupTreeView.java
Restore group selection on filter clearjabgui/src/main/java/org/jabref/gui/groups/GroupTreeView.java
Project.xml
Remove javadoc formatting configuration.idea/codeStyles/Project.xml