From 82094019096f3a4c87c2fd57efe4d26c1687b49b Mon Sep 17 00:00:00 2001 From: Arthur Poiret Date: Mon, 27 Apr 2026 22:48:21 +0200 Subject: [PATCH] fix(#456): improve crash report display --- .../CrashRecoveryDialogController.java | 12 +++--- .../plugin/ui/RecoveredPluginView.java | 19 +++++---- .../fxml/dialogs/CrashRecoveryView.fxml | 39 ++++++++++--------- .../fxml/dialogs/ListDirectoryView.fxml | 12 +++--- owlplug-client/src/main/resources/owlplug.css | 5 --- .../main/resources/css/owlplug-controls.css | 4 +- 6 files changed, 41 insertions(+), 50 deletions(-) diff --git a/owlplug-client/src/main/java/com/owlplug/core/controllers/dialogs/CrashRecoveryDialogController.java b/owlplug-client/src/main/java/com/owlplug/core/controllers/dialogs/CrashRecoveryDialogController.java index 1c859137..ac177866 100644 --- a/owlplug-client/src/main/java/com/owlplug/core/controllers/dialogs/CrashRecoveryDialogController.java +++ b/owlplug-client/src/main/java/com/owlplug/core/controllers/dialogs/CrashRecoveryDialogController.java @@ -37,6 +37,7 @@ import javafx.scene.control.ComboBox; import javafx.scene.control.Hyperlink; import javafx.scene.control.Label; +import javafx.scene.control.ListView; import javafx.scene.layout.Pane; import javafx.scene.layout.VBox; import org.slf4j.Logger; @@ -73,13 +74,12 @@ public class CrashRecoveryDialogController extends AbstractDialogController { @FXML protected Hyperlink issuesLink; @FXML - protected VBox pluginListContainer; - @FXML protected Pane incompleteSyncPane; - + @FXML + protected ListView pluginListContainer; CrashRecoveryDialogController() { - super(600, 550); + super(600, 650); this.setOverlayClose(false); } @@ -135,7 +135,7 @@ public void initialize() { for (Plugin plugin : incompleteSyncPlugins) { log.info("Last scan for plugin {} is incomplete", plugin.getName()); RecoveredPluginView pluginView = new RecoveredPluginView(plugin, pluginService, this.getApplicationDefaults()); - pluginListContainer.getChildren().add(pluginView); + pluginListContainer.getItems().add(pluginView); this.getTelemetryService().event("/Error/PluginScanIncomplete", p -> { p.put("nativeDiscoveryLoader", this.getPreferences().get( @@ -154,7 +154,7 @@ protected DialogLayout getLayout() { DialogLayout layout = new DialogLayout(); - Label title = new Label("Ooh, something wrong happens :("); + Label title = new Label("Ooh, something wrong happened :("); title.getStyleClass().add("heading-3"); layout.setHeading(title); layout.setBody(lazyViewRegistry.get(LazyViewRegistry.CRASH_RECOVERY_VIEW)); diff --git a/owlplug-client/src/main/java/com/owlplug/plugin/ui/RecoveredPluginView.java b/owlplug-client/src/main/java/com/owlplug/plugin/ui/RecoveredPluginView.java index 2b5f135b..25d5548f 100644 --- a/owlplug-client/src/main/java/com/owlplug/plugin/ui/RecoveredPluginView.java +++ b/owlplug-client/src/main/java/com/owlplug/plugin/ui/RecoveredPluginView.java @@ -23,11 +23,11 @@ import com.owlplug.plugin.services.PluginService; import javafx.geometry.Pos; import javafx.scene.control.Label; -import javafx.scene.control.ToggleButton; import javafx.scene.image.ImageView; import javafx.scene.layout.HBox; import javafx.scene.layout.Pane; import javafx.scene.layout.Priority; +import org.controlsfx.control.ToggleSwitch; public class RecoveredPluginView extends HBox { @@ -42,8 +42,7 @@ public RecoveredPluginView(Plugin plugin, PluginService pluginService, Applicati super(); this.setAlignment(Pos.BASELINE_LEFT); - this.getStyleClass().add("recovered-plugin-view"); - + Label label = new Label(plugin.getName()); ImageView imageView = new ImageView(); imageView.setImage(applicationDefaults.getPluginFormatIcon(plugin.getFormat())); @@ -54,17 +53,17 @@ public RecoveredPluginView(Plugin plugin, PluginService pluginService, Applicati Pane transparentPane = new Pane(); HBox.setHgrow(transparentPane, Priority.ALWAYS); this.getChildren().add(transparentPane); - - ToggleButton toggleButton = new ToggleButton(); - toggleButton.setText("Native Discovery"); - toggleButton.setSelected(plugin.getFootprint().isNativeDiscoveryEnabled()); - - toggleButton.selectedProperty().addListener((observable, oldValue, newValue) -> { + + ToggleSwitch toggleSwitch = new ToggleSwitch("Native Discovery"); + toggleSwitch.setScaleX(0.8); + toggleSwitch.setScaleY(0.8); + toggleSwitch.setSelected(plugin.getFootprint().isNativeDiscoveryEnabled()); + toggleSwitch.selectedProperty().addListener((observable, oldValue, newValue) -> { plugin.getFootprint().setNativeDiscoveryEnabled(newValue); pluginService.save(plugin.getFootprint()); }); - this.getChildren().add(toggleButton); + this.getChildren().add(toggleSwitch); } diff --git a/owlplug-client/src/main/resources/fxml/dialogs/CrashRecoveryView.fxml b/owlplug-client/src/main/resources/fxml/dialogs/CrashRecoveryView.fxml index a19bd7a5..545908b9 100644 --- a/owlplug-client/src/main/resources/fxml/dialogs/CrashRecoveryView.fxml +++ b/owlplug-client/src/main/resources/fxml/dialogs/CrashRecoveryView.fxml @@ -6,39 +6,40 @@ - + - + - - -