-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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 context menu of the search bar #11446
base: main
Are you sure you want to change the base?
Conversation
Remove constructor
Human testing for tab (library) switching:
|
Test with the different modes, global search and search across libraries |
regexValidator = new FunctionBasedValidator<>( | ||
searchField.textProperty(), | ||
query -> !(regularExpressionButton.isSelected() && !validRegex()), | ||
ValidationMessage.error(Localization.lang("Invalid regular expression"))); | ||
ControlsFxVisualizer visualizer = new ControlsFxVisualizer(); | ||
visualizer.setDecoration(new IconValidationDecorator(Pos.CENTER_LEFT)); | ||
Platform.runLater(() -> visualizer.initVisualization(regexValidator.getValidationStatus(), searchField)); | ||
|
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.
I've removed this validator because it is not listening for changes of the modifier buttons, an exception will be thrown in this case: write an invalid regex in the search bar, with the regex modifier disabled, then enable the regex button. will throw java.util.regex.PatternSyntaxException: Unclosed group near index 4 (k\)
Also, this visualizer throws an exception in the global search window. (Open the window, enable regex modifier, write an invalid query, close the window, and open it again will throw java.lang.IllegalArgumentException: DialogPane@30d0220[styleClass=dialog-pane]is already inside a scene-graph and cannot be set as root
.
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.
Have you tried EasyBind#combine
to combine listening for searchField text property and change of selection of the modifier button? Overall, I think we should stick to one pattern to display errors to users, unless it is necessary to implement a workaround.
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.
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.
Okay, I see. If it's necessary then let's keep it.
jabref/src/main/java/org/jabref/gui/preview/PreviewViewer.java Lines 171 to 176 in e6b5470
This class is used in multiple locations, most of which don't have access to the LibraryTab to retrieve the SearchQueryProperty (maybe most of the PreviewViewer instances don't need to highlight the search pattern. Highlighting is needed only in the entry editor and the global search window). |
I noticed you make several changes and fixes to the ui. Please don't forget to create screenshots before and after the change. |
maybe a preference migration must be added to test if there is already a shortcut registered, and if not, do so? |
Exactly. Clearing preferences works because when you pass an empty list of bindings to We should have a migration strategy that would merge the bindings loaded from preferences and key bindings from The migration can be added to We should also consider versioning preferences because doing the migration could cause problems when running an older version of JabRef. |
Note that the current impl of the preferences default map will change soon |
Should I make any changes to the preferences in this PR? This issue is related to the preference design, and it's not ideal to add a preference migration for every new shortcut. |
I think we should postpone it until the default map change is completed to avoid any conflicts. Plus I have noticed other keybindings are not present in preferences, so the issue goes beyond this PR. I created an issue to track it https://github.com/JabRef/jabref-issue-melting-pot/issues/471 |
EditAction
that sometimes copy/paste/cut the selected entries instead of the text of the search bar).Mandatory checks
CHANGELOG.md
described in a way that is understandable for the average user (if applicable)