Skip to content

Conversation

LoayGhreeb
Copy link
Member

Closes #11024
Added a search bar in the global search window.

image

  • 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.

private void initialize() {
viewModel = new GlobalSearchResultDialogViewModel(preferencesService);

SearchResultDialogSearchBar searchBar = new SearchResultDialogSearchBar(libraryTabContainer, stateManager, preferencesService, undoManager);
Copy link
Member

Choose a reason for hiding this comment

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

I like the idea of having this as a separate component, but inside you have bascially duplicate functionality/content to the normal "SearchBar". Can the normal search bar also be adapted to use this new component?
DRY (Don't Repeat Yourself) Principle

Copy link
Member Author

Choose a reason for hiding this comment

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

I tried to avoid these duplications, but I don't know how to handle them. Should I create a new class containing some static methods and call them? Or what do you suggest? The only difference between the two classes is the removal of two buttons (keepSearchString, openGlobalSearchButton) and a change in the listener to listen to the newly introduced property activeGlobalSearchQuery.

Copy link
Member

Choose a reason for hiding this comment

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

Pass the listener as Consumer parameter and maybe pass an enum e.g. NORMAL_SEARCH, GLOBAL_SEARCH and adapt the buttons accordingly

@LoayGhreeb
Copy link
Member Author

LoayGhreeb commented Mar 15, 2024

  • There is still one thing I can't handle: the full-text search only searches in the active tab, not all tabs. (This issue existed before this pull request).
  • I don't know why the tests failed for the SourceTab. I added a listener to the activeGlobalSearchQuery to be ready for this PR Selected entry in search window selects entry in the main table #11010 to select the entry, and the highlighting still works.

@calixtus
Copy link
Member

Uhh, wouldnt that make the global search Dialog be the some kind of a second instance of jabref without groups and entry editor?

@LoayGhreeb
Copy link
Member Author

LoayGhreeb commented Mar 15, 2024

Uhh, wouldnt that make the global search Dialog be the some kind of a second instance of jabref without groups and entry editor?

Maybe kind of, but I haven't changed of its functionality. We can consider it an instance of the main table containing all opened libraries.

@LoayGhreeb LoayGhreeb requested a review from Siedlerchr March 19, 2024 11:22
Copy link
Member

@Siedlerchr Siedlerchr left a comment

Choose a reason for hiding this comment

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

Thanks, lgtm! Changelog is missing

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.

Global search window issue

3 participants