diff --git a/core/src/main/resources/i18n/displayStrings.properties b/core/src/main/resources/i18n/displayStrings.properties index 5f2bcbc31c..c121678e5c 100644 --- a/core/src/main/resources/i18n/displayStrings.properties +++ b/core/src/main/resources/i18n/displayStrings.properties @@ -709,7 +709,8 @@ portfolio.pending.step2_seller.f2fInfo.headline=Buyer's contact information portfolio.pending.step2_seller.waitPayment.msg=The deposit transaction has at least one blockchain confirmation.\nYou need to wait until the BTC buyer starts the {0} payment. portfolio.pending.step2_seller.warn=The BTC buyer still has not done the {0} payment.\nYou need to wait until they have started the payment.\nIf the trade has not been completed on {1} the arbitrator will investigate. portfolio.pending.step2_seller.openForDispute=The BTC buyer has not started their payment!\nThe max. allowed period for the trade has elapsed.\nYou can wait longer and give the trading peer more time or contact the mediator for assistance. -tradeChat.chatWindowTitle=Chat window for trade with ID ''{0}'' +disputeChat.chatWindowTitle=Dispute chat window for trade with ID ''{0}'' +tradeChat.chatWindowTitle=Trader Chat window for trade with ID ''{0}'' tradeChat.openChat=Open chat window tradeChat.rules=You can communicate with your trade peer to resolve potential problems with this trade.\n\ It is not mandatory to reply in the chat.\n\ diff --git a/desktop/src/main/java/bisq/desktop/bisq.css b/desktop/src/main/java/bisq/desktop/bisq.css index 69dddd84ef..dc97dfc84b 100644 --- a/desktop/src/main/java/bisq/desktop/bisq.css +++ b/desktop/src/main/java/bisq/desktop/bisq.css @@ -2003,6 +2003,10 @@ textfield */ -fx-font-size: 0.846em; } +.dispute-chat-border { + -fx-background-color: -bs-color-blue-5; +} + /******************************************************************************************************************** * * * DAO * diff --git a/desktop/src/main/java/bisq/desktop/main/support/dispute/DisputeChatPopup.java b/desktop/src/main/java/bisq/desktop/main/support/dispute/DisputeChatPopup.java index 796f86ecfe..8c597b5a35 100644 --- a/desktop/src/main/java/bisq/desktop/main/support/dispute/DisputeChatPopup.java +++ b/desktop/src/main/java/bisq/desktop/main/support/dispute/DisputeChatPopup.java @@ -46,6 +46,8 @@ import javafx.scene.layout.StackPane; import javafx.beans.value.ChangeListener; +import lombok.Getter; + public class DisputeChatPopup { public interface ChatCallback { void onCloseDisputeFromChatWindow(Dispute dispute); @@ -60,6 +62,7 @@ public class DisputeChatPopup { private double chatPopupStageYPosition = -1; private ChangeListener xPositionListener; private ChangeListener yPositionListener; + @Getter private Dispute selectedDispute; DisputeChatPopup(DisputeManager> disputeManager, CoinFormatter formatter, @@ -78,10 +81,12 @@ public class DisputeChatPopup { public void closeChat() { if (chatPopupStage != null) chatPopupStage.close(); + selectedDispute = null; } public void openChat(Dispute selectedDispute, DisputeSession concreteDisputeSession, String counterpartyName) { closeChat(); + this.selectedDispute = selectedDispute; selectedDispute.getChatMessages().forEach(m -> m.setWasDisplayed(true)); disputeManager.requestPersistence(); @@ -96,7 +101,7 @@ public class DisputeChatPopup { AnchorPane.setRightAnchor(chatView, 10d); AnchorPane.setTopAnchor(chatView, -20d); AnchorPane.setBottomAnchor(chatView, 10d); - + pane.getStyleClass().add("dispute-chat-border"); Button closeDisputeButton = null; if (!selectedDispute.isClosed() && !disputeManager.isTrader(selectedDispute)) { closeDisputeButton = new AutoTooltipButton(Res.get("support.closeTicket")); @@ -106,7 +111,7 @@ public class DisputeChatPopup { chatView.activate(); chatView.scrollToBottom(); chatPopupStage = new Stage(); - chatPopupStage.setTitle(Res.get("tradeChat.chatWindowTitle", selectedDispute.getShortTradeId()) + chatPopupStage.setTitle(Res.get("disputeChat.chatWindowTitle", selectedDispute.getShortTradeId()) + " " + selectedDispute.getRoleString()); StackPane owner = MainView.getRootContainer(); Scene rootScene = owner.getScene(); diff --git a/desktop/src/main/java/bisq/desktop/main/support/dispute/DisputeView.java b/desktop/src/main/java/bisq/desktop/main/support/dispute/DisputeView.java index 4e65a10e5e..3638b56c5c 100644 --- a/desktop/src/main/java/bisq/desktop/main/support/dispute/DisputeView.java +++ b/desktop/src/main/java/bisq/desktop/main/support/dispute/DisputeView.java @@ -350,7 +350,7 @@ public abstract class DisputeView extends ActivatableView { else if (sortedList.size() > 0) tableView.getSelectionModel().select(0); - GUIUtil.requestFocus(filterTextField); + GUIUtil.requestFocus(tableView); } @Override @@ -905,6 +905,7 @@ public abstract class DisputeView extends ActivatableView { tableView.getSelectionModel().clearSelection(); tableView.getColumns().add(getContractColumn()); + maybeAddProcessColumnsForAgent(); // agent view prefers action buttons on the left TableColumn dateColumn = getDateColumn(); tableView.getColumns().add(dateColumn); @@ -928,8 +929,8 @@ public abstract class DisputeView extends ActivatableView { stateColumn = getStateColumn(); tableView.getColumns().add(stateColumn); - maybeAddProcessColumn(); - tableView.getColumns().add(getChatColumn()); + // client view has the chat button to the right + maybeAddChatColumnForClient(); tradeIdColumn.setComparator(Comparator.comparing(Dispute::getTradeId)); dateColumn.setComparator(Comparator.comparing(Dispute::getOpeningDate)); @@ -941,7 +942,11 @@ public abstract class DisputeView extends ActivatableView { tableView.getSortOrder().add(dateColumn); } - protected void maybeAddProcessColumn() { + protected void maybeAddProcessColumnsForAgent() { + // Only relevant client views will impl it + } + + protected void maybeAddChatColumnForClient() { // Only relevant client views will impl it } @@ -957,8 +962,8 @@ public abstract class DisputeView extends ActivatableView { private TableColumn getContractColumn() { TableColumn column = new AutoTooltipTableColumn<>(Res.get("shared.details")) { { - setMaxWidth(150); - setMinWidth(80); + setMaxWidth(80); + setMinWidth(65); getStyleClass().addAll("first-column", "avatar-column"); setSortable(false); } @@ -1037,7 +1042,7 @@ public abstract class DisputeView extends ActivatableView { return column; } - private TableColumn getChatColumn() { + protected TableColumn getChatColumn() { TableColumn column = new AutoTooltipTableColumn<>(Res.get("support.chat")) { { setMaxWidth(40); @@ -1366,6 +1371,8 @@ public abstract class DisputeView extends ActivatableView { setText(newValue ? Res.get("support.closed") : Res.get("support.open")); if (getTableRow() != null) getTableRow().setOpacity(newValue && item.getBadgeCountProperty().get() == 0 ? 0.4 : 1); + if (item.isClosed() && item == chatPopup.getSelectedDispute()) + chatPopup.closeChat(); // close the chat popup when the associated ticket is closed }; closedProperty = item.isClosedProperty(); closedProperty.addListener(listener); diff --git a/desktop/src/main/java/bisq/desktop/main/support/dispute/agent/DisputeAgentView.java b/desktop/src/main/java/bisq/desktop/main/support/dispute/agent/DisputeAgentView.java index f3eb2da28b..8e437943d8 100644 --- a/desktop/src/main/java/bisq/desktop/main/support/dispute/agent/DisputeAgentView.java +++ b/desktop/src/main/java/bisq/desktop/main/support/dispute/agent/DisputeAgentView.java @@ -348,8 +348,9 @@ public abstract class DisputeAgentView extends DisputeView implements MultipleHo } @Override - protected void maybeAddProcessColumn() { + protected void maybeAddProcessColumnsForAgent() { tableView.getColumns().add(getProcessColumn()); + tableView.getColumns().add(getChatColumn()); } @Override diff --git a/desktop/src/main/java/bisq/desktop/main/support/dispute/client/DisputeClientView.java b/desktop/src/main/java/bisq/desktop/main/support/dispute/client/DisputeClientView.java index 7c73df56dc..f2539daa6b 100644 --- a/desktop/src/main/java/bisq/desktop/main/support/dispute/client/DisputeClientView.java +++ b/desktop/src/main/java/bisq/desktop/main/support/dispute/client/DisputeClientView.java @@ -66,6 +66,11 @@ public abstract class DisputeClientView extends DisputeView { return super.getFilterResult(dispute, filterString); } + @Override + protected void maybeAddChatColumnForClient() { + tableView.getColumns().add(getChatColumn()); + } + @Override protected boolean senderFlag() { return false;