diff --git a/src/main/java/org/jabref/gui/ai/components/summary/SummaryShowingComponent.java b/src/main/java/org/jabref/gui/ai/components/summary/SummaryShowingComponent.java index 456e5253650..06a417746cc 100644 --- a/src/main/java/org/jabref/gui/ai/components/summary/SummaryShowingComponent.java +++ b/src/main/java/org/jabref/gui/ai/components/summary/SummaryShowingComponent.java @@ -8,6 +8,7 @@ import javafx.fxml.FXML; import javafx.scene.control.CheckBox; import javafx.scene.control.TextArea; +import javafx.scene.layout.Priority; import javafx.scene.layout.VBox; import javafx.scene.text.Text; import javafx.scene.web.WebView; @@ -20,9 +21,10 @@ public class SummaryShowingComponent extends VBox { @FXML private TextArea summaryTextArea; @FXML private Text summaryInfoText; - @FXML private WebView markdownWebView; @FXML private CheckBox markdownCheckbox; + private WebView markdownWebView; + private final Summary summary; private final Runnable regenerateCallback; private final MarkdownFormatter markdownFormatter; @@ -39,10 +41,17 @@ public SummaryShowingComponent(Summary summary, Runnable regenerateCallback) { @FXML private void initialize() { - summaryTextArea.setText(summary.content()); + markdownWebView = new WebView(); markdownWebView.setVisible(false); markdownWebView.setManaged(false); + VBox.setVgrow(markdownWebView, Priority.ALWAYS); + + int indexOfTextArea = getChildren().indexOf(summaryTextArea); + getChildren().add(indexOfTextArea + 1, markdownWebView); + + summaryTextArea.setText(summary.content()); + String newInfo = summaryInfoText .getText() .replaceAll("%0", formatTimestamp(summary.timestamp()))