Fixed search result focus handling#13174
Conversation
…r a fulltext search; fixed also an issue where sometimes the search results tab would be empty after a successful search
…ltext search; fixed also an issue where sometimes the search results tab would be empty after a successful search
|
@koppor determine issue number check failed https://github.com/JabRef/jabref/actions/runs/15281990665/job/42983040404?pr=13174 |
Contributor used NOTE THAT THE LINK POINTS TO ANOITHER ISSUE
Update I needed to fix the job name - 5b5cba8 |
| } | ||
| this.entry = entry; | ||
| updateSearch(); | ||
| notifyAboutFocus(entry); |
There was a problem hiding this comment.
Are you sure that this is needed? - I think, Platform.runLater(entryEditor::adaptVisibleTabs) could be directly called - or another method adaptVisisbleTabs() containing this call could be used. focus is wrong IMHO.
There was a problem hiding this comment.
Actually is not needed, just tested it. Sorry I'm just starting to get familiar with JavaFX.
None, 1 out of 10 is a bearable edge case. I think this is rarer than 1 out of 10. |
…abs; fixed incorrect spacing
|
@ZodGaz please fix your issue link - |
done, thank you |
koppor
left a comment
There was a problem hiding this comment.
Besides minor formatting comments, looksgood
koppor
left a comment
There was a problem hiding this comment.
As usual? CHANGELOG.md entry missing.
Done, let me know if everything else is needed |
Co-authored-by: Oliver Kopp <kopp.dev@gmail.com>
|
@trag-bot didn't find any issues in the code! ✅✨ |
|
I think, this solves the issue. I am wondering if the tab "fulltext search results" should be shown if search was triggered. However, this is more hard and we need to discuss internally @Siedlerchr |
…or-test * upstream/main: (102 commits) Try to fix output Improve AI preferences UI and templates (JabRef#13202) Bump jablib/src/main/abbrv.jabref.org from `6926b83` to `333c2f1` (JabRef#13216) Bump jablib/src/main/resources/csl-styles from `8a2317a` to `c3df987` (JabRef#13215) Fixed search result focus handling (JabRef#13174) New Crowdin updates (JabRef#13214) Add Pseudonymization to CLI (JabRef#13158) Try parallel gource build Update gource.yml Fix position of checkout Preapre: Enable gradle configuration cache (JabRef#13212) Add yml as YAML extension (JabRef#13213) Fix wrong detection of issue numbers (JabRef#13211) Miscellaneous refactoring - II (JabRef#13197) Run Windows tests only on main (and on demand) (JabRef#13210) Fix porcelain for consistency check (JabRef#13209) Use setup-jbang action (instead of custom call of .sh script) (JabRef#13208) Add link to JabRef guru (JabRef#13207) Switch to gradlex for modularity (JabRef#13112) feat(ci-cd): change issue URL pattern (JabRef#13206) ...
| tabs.add(sourceTab); | ||
| tabs.add(new LatexCitationsTab(preferences, dialogService, stateManager, directoryMonitor)); | ||
| tabs.add(new FulltextSearchResultsTab(stateManager, preferences, dialogService, taskExecutor)); | ||
| tabs.add(new FulltextSearchResultsTab(stateManager, preferences, dialogService, taskExecutor, this)); |
There was a problem hiding this comment.
This seems like the flaw - there is only one entry editor, so the state needs to refresh in each tab
There was a problem hiding this comment.
Still happens before my PR, tested just now
| content.getChildren().clear(); | ||
| stateManager.activeSearchQuery(SearchType.NORMAL_SEARCH).get().ifPresent(searchQuery -> { | ||
| SearchResults searchResults = searchQuery.getSearchResults(); | ||
| if (searchResults != null && entry != null) { |
There was a problem hiding this comment.
Maybe add a breakpoint here and see when it is called?
There was a problem hiding this comment.
This is the moment I come back from the switched library to where I do the fulltext search:

This is every-time I try to open a search results tab (that happens to be blank)

If I reset the fulltext search flag straight after coming back from the switched library this does not happens. So basically entry is null when I come back from the switched one and then searchResults is always null while I'm in the library where I do the search (after coming back) .
| content.getChildren().clear(); | ||
| stateManager.activeSearchQuery(SearchType.NORMAL_SEARCH).get().ifPresent(searchQuery -> { | ||
| SearchResults searchResults = searchQuery.getSearchResults(); | ||
| if (searchResults != null && entry != null) { |
There was a problem hiding this comment.
I think after coming back from the switched tab one of these is always null for some reason until toggling the search flag off and on again. (line 97-102)
| content.getChildren().clear(); | ||
| stateManager.activeSearchQuery(SearchType.NORMAL_SEARCH).get().ifPresent(searchQuery -> { | ||
| SearchResults searchResults = searchQuery.getSearchResults(); | ||
| if (searchResults != null && entry != null) { |
There was a problem hiding this comment.
This is the moment I come back from the switched library to where I do the fulltext search:

This is every-time I try to open a search results tab (that happens to be blank)

If I reset the fulltext search flag straight after coming back from the switched library this does not happens. So basically entry is null when I come back from the switched one and then searchResults is always null while I'm in the library where I do the search (after coming back) .
Closes #12865
Implemented handleFocus() in FulltextSearchResultsTab , now search results tab shows correctly after a fulltext search, and disappear after the fulltextsearch flag is disabled; fixed also an issue where sometimes the search results tab would be empty after a successful search.
Mandatory checks
CHANGELOG.mddescribed in a way that is understandable for the average user (if change is visible to the user)