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 search results when active database changes #11268

Merged
merged 1 commit into from
Apr 30, 2024

Conversation

LoayGhreeb
Copy link
Collaborator

Closes #11267

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.

Merged origin/update-search-results into update-search-results
Copy link
Member

@calixtus calixtus left a comment

Choose a reason for hiding this comment

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

I think this won't work. Now you update when changing the database, but not if the search query itself is altered.
Maybe a new string binding with multiple observables will work here.

@LoayGhreeb
Copy link
Collaborator Author

I think this won't work. Now you update when changing the database, but not if the search query itself is altered.

the search query has a listener too.

this.searchQueryProperty.addListener((obs, oldValue, newValue) -> newValue.ifPresent(this::updateSearchResultsForQuery));

@Siedlerchr Siedlerchr added this pull request to the merge queue Apr 30, 2024
@Siedlerchr
Copy link
Member

Thanks for the quick fix

Merged via the queue into JabRef:main with commit 4f87740 Apr 30, 2024
21 checks passed
@LoayGhreeb LoayGhreeb deleted the update-search-results branch April 30, 2024 06:18
@calixtus
Copy link
Member

so this line was just duplicated?

@LoayGhreeb
Copy link
Collaborator Author

so this line was just duplicated?

yes, I accidentally did this in #11032.

- this.stateManager.activeDatabaseProperty().addListener((obs, oldValue, newValue) -> stateManager.activeSearchQueryProperty().get().ifPresent(this::updateSearchResultsForQuery));

+ this.searchQueryProperty.addListener((obs, oldValue, newValue) -> searchQueryProperty.get().ifPresent(this::updateSearchResultsForQuery));

@calixtus
Copy link
Member

Ah ok. Forgiven and forgotten. 😄

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.

Keep search string across library shows "No results found" even there are entries in the other library
3 participants