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

Update PreviewView to listen for library search queries #11659

Merged
merged 6 commits into from
Aug 21, 2024
Merged

Conversation

LoayGhreeb
Copy link
Collaborator

  • Update PreviewView to listen for library search queries instead of the StateManager property.
  • Follow-up to Add tooltip for cell content and entries' preview in Main Table #11176. The preview was updating in the background when hovering over entries, even when shouldShowPreviewEntryTableTooltip was disabled.
  • The highlighting was not working when searching before opening the entry editor.

Mandatory checks

  • Change in CHANGELOG.md described in a way that is understandable for the average user (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 developer's documentation: Is the information available and up to date? If not, I outlined it in this pull request.
  • Checked 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 to the documentation repository.

Copy link
Member

@koppor koppor left a comment

Choose a reason for hiding this comment

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

Just a small comment

vBox.getChildren().add(label);
vBox.getChildren().add(preview);
this.setGraphic(vBox);
fieldValueLabel.setText(fieldValue + "\n");
Copy link
Member

Choose a reason for hiding this comment

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

This can be moved to the if block

Please swap the conditions - typically, one should have the positive case first. Alternatively, "fail fast". Keep the negative thing, but then do "return this;" and then without else do the rest.

The indent of line 37 "this.setGraphic" is off

Copy link
Collaborator Author

@LoayGhreeb LoayGhreeb Aug 21, 2024

Choose a reason for hiding this comment

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

This can be moved to the if block

In both cases it should be updated, as it is also used in the tooltipContent line 27.

Copy link
Member

Choose a reason for hiding this comment

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

Oh, wow, something which is not directly seeable while browsing through the github diff 😅

if (!registered) {
stateManager.activeSearchQuery(SearchType.NORMAL_SEARCH).addListener(listener);
Copy link
Member

Choose a reason for hiding this comment

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

Can we also remove the activeSearchQuery completely from the state manager?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

It is still used by GlobalSearchBar because there is only one bar shared between the open libraries.

@koppor koppor enabled auto-merge August 21, 2024 01:59
@koppor koppor added this pull request to the merge queue Aug 21, 2024
Copy link
Contributor

github-actions bot commented Aug 21, 2024

The build for this PR is no longer available. Please visit https://builds.jabref.org/main/ for the latest build.

Merged via the queue into main with commit 8c51e7a Aug 21, 2024
21 checks passed
@koppor koppor deleted the previewViewer branch August 21, 2024 02:12
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.

2 participants