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

Use a separate search bar in the global search window #11032

Merged
merged 5 commits into from
Mar 19, 2024

Conversation

LoayGhreeb
Copy link
Collaborator

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.

@@ -53,6 +57,10 @@ public GlobalSearchResultDialog(UndoManager undoManager) {
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
Collaborator 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
Collaborator 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
Collaborator 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.

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

@Siedlerchr Siedlerchr added this pull request to the merge queue Mar 19, 2024
Merged via the queue into JabRef:main with commit 9ced996 Mar 19, 2024
20 checks passed
@LoayGhreeb LoayGhreeb deleted the fix-issue-11024 branch March 19, 2024 19:51
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