Private chat info UI + backend implemented.

This commit is contained in:
Asal Lotfi
2025-09-05 15:31:01 +03:30
parent e112ae1308
commit 63b201b697
20 changed files with 716 additions and 12 deletions
@@ -41,9 +41,6 @@ public class MainController {
private boolean blockedByMeFlag = false;
private boolean blockedMeFlag = false;
private enum SearchMode {
GLOBAL,
CHAT
@@ -635,6 +632,37 @@ public class MainController {
}
}
public void closeCurrentChat() {
// 1. Clear the chat area
chatDisplayArea.getChildren().clear();
// 2. Re-add the placeholder label
placeholderLabel.setVisible(true);
placeholderLabel.setManaged(true);
placeholderLabel.setText("Select a chat to start messaging");
chatDisplayArea.getChildren().add(placeholderLabel);
// 3. Ask the chat list to refresh
MainController.getInstance().refreshChatListUI();
}
public void showAlert(String title, String message, Alert.AlertType type) {
Platform.runLater(() -> {
Alert alert = new Alert(type);
alert.setTitle(title);
alert.setHeaderText(null);
alert.setContentText(message);
// Tie it to the main window so it centers nicely
if (mainRoot.getScene() != null && mainRoot.getScene().getWindow() != null) {
alert.initOwner(mainRoot.getScene().getWindow());
}
alert.showAndWait();
});
}
// ===== Search UI state =====
private final java.util.List<SearchResult> searchBacking = new java.util.ArrayList<>();