Meldungsbereich: leeren bei Neu/Öffnen und Button zum manuellen Leeren

- pendingMessages wird in applyEditorState() geleert, bevor die neue
  Konfiguration angezeigt wird (gilt für Neu und Öffnen)
- Neuer Button "Meldungen leeren" unterhalb des Meldungsbereichs;
  ruft clearMessages() auf, das pendingMessages leert und die Ansicht
  aktualisiert
- Dokumentation in docs/gui-bedienanleitung.md ergänzt
- Zwei neue Smoke-Tests: Neu löscht bisherige Meldungen,
  clearMessages() leert den Bereich vollständig

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-04-22 11:33:13 +02:00
parent e07b460cdd
commit 1996f31f43
3 changed files with 105 additions and 0 deletions
@@ -150,6 +150,12 @@ public final class GuiConfigurationEditorWorkspace {
*/
final Button technicalTestsButton = new Button("Technische Tests ausführen");
/**
* The "Meldungen leeren" button below the central message area.
* Package-private to allow state assertions in smoke tests.
*/
final Button clearMessagesButton = new Button("Meldungen leeren");
private static final Path DEFAULT_SAVE_PATH = Paths.get("config/application.properties");
private final GuiConfigurationFileLoader configurationFileLoader;
@@ -896,6 +902,7 @@ public final class GuiConfigurationEditorWorkspace {
this.welcomeGuidanceVisible = false;
statusLabel.setVisible(false);
statusLabel.setManaged(false);
pendingMessages.clear();
refreshView();
runEditorValidation();
}
@@ -1560,6 +1567,11 @@ public final class GuiConfigurationEditorWorkspace {
card.getChildren().add(messagesListView);
clearMessagesButton.setOnAction(e -> clearMessages());
HBox clearButtonRow = new HBox(clearMessagesButton);
clearButtonRow.setAlignment(Pos.CENTER_RIGHT);
card.getChildren().add(clearButtonRow);
// Populate immediately so the area is not blank before the first validation run.
refreshMessagesArea();
return card;
@@ -1832,6 +1844,17 @@ public final class GuiConfigurationEditorWorkspace {
}
}
/**
* Removes all entries from the central message area.
* <p>
* Clears {@link #pendingMessages} and refreshes the visible message area.
* Must be called on the JavaFX Application Thread.
*/
void clearMessages() {
pendingMessages.clear();
refreshMessagesArea();
}
/**
* Formats a message timestamp as {@code [HH:mm:ss]} in the system default zone.
*