Skip to content

Fixed search result focus handling #13174

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

Merged
merged 7 commits into from
Jun 2, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ Note that this project **does not** adhere to [Semantic Versioning](https://semv
- We added "Hanging Indent" as the default selected bibliography body format for CSL styles that specify it (e.g. APA). [melting-pot#894](https://github.com/JabRef/jabref-issue-melting-pot/issues/894)
- We fixed an issue where bibliography entries generated from CSL styles had leading spaces. [#13074](https://github.com/JabRef/jabref/pull/13074)
- We fixed an issue where the preview area in the "Select Style" dialog of the LibreOffice integration was too small to display full content. [#13051](https://github.com/JabRef/jabref/issues/13051)
- We fixed an issue where the tab showing the fulltext search results was not displayed. [#12865](https://github.com/JabRef/jabref/issues/12865)

### Removed

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -336,7 +336,7 @@ private List<EntryEditorTab> createTabs() {
stateManager);
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));
tabs.add(new AiSummaryTab(aiService, dialogService, stateManager, this, preferences));
tabs.add(new AiChatTab(aiService, dialogService, preferences, stateManager, this, taskExecutor));

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import java.util.List;
import java.util.Map;

import javafx.application.Platform;
import javafx.geometry.Insets;
import javafx.geometry.Orientation;
import javafx.scene.control.ContextMenu;
Expand All @@ -21,6 +22,7 @@
import org.jabref.gui.actions.StandardActions;
import org.jabref.gui.desktop.os.NativeDesktop;
import org.jabref.gui.documentviewer.DocumentViewerView;
import org.jabref.gui.entryeditor.EntryEditor;
import org.jabref.gui.entryeditor.EntryEditorTab;
import org.jabref.gui.maintable.OpenExternalFileAction;
import org.jabref.gui.maintable.OpenFolderAction;
Expand Down Expand Up @@ -49,19 +51,23 @@ public class FulltextSearchResultsTab extends EntryEditorTab {
private final DialogService dialogService;
private final ActionFactory actionFactory;
private final TaskExecutor taskExecutor;
private final EntryEditor entryEditor;
private final TextFlow content;

private BibEntry entry;
private DocumentViewerView documentViewerView;

public FulltextSearchResultsTab(StateManager stateManager,
GuiPreferences preferences,
DialogService dialogService,
TaskExecutor taskExecutor) {
TaskExecutor taskExecutor,
EntryEditor entryEditor) {
this.stateManager = stateManager;
this.preferences = preferences;
this.dialogService = dialogService;
this.actionFactory = new ActionFactory();
this.taskExecutor = taskExecutor;
this.entryEditor = entryEditor;

content = new TextFlow();
ScrollPane scrollPane = new ScrollPane(content);
Expand Down Expand Up @@ -91,11 +97,11 @@ protected void bindToEntry(BibEntry entry) {
}

private void updateSearch() {
content.getChildren().clear();
stateManager.activeSearchQuery(SearchType.NORMAL_SEARCH).get().ifPresent(searchQuery -> {
SearchResults searchResults = searchQuery.getSearchResults();
if (searchResults != null && entry != null) {
Map<String, List<SearchResult>> searchResultsForEntry = searchResults.getFileSearchResultsForEntry(entry);
content.getChildren().clear();
if (searchResultsForEntry.isEmpty()) {
content.getChildren().add(new Text(Localization.lang("No search matches.")));
} else {
Expand Down Expand Up @@ -125,6 +131,7 @@ private void updateSearch() {
}
}
});
Platform.runLater(entryEditor::adaptVisibleTabs);
}

private Text createFileLink(LinkedFile linkedFile) {
Expand Down
Loading