diff --git a/data/lars.txt b/data/lars.txt
index 690aea23d3..e6b5797d46 100644
--- a/data/lars.txt
+++ b/data/lars.txt
@@ -1,5 +1,4 @@
-D | 0 | return library book | Feb 15 2026
-T | 0 | borrow book
+T | 1 | borrow book
E | 0 | project meeting | 2026-02-10 | 2026-02-20
D | 0 | return library book | Feb 15 2026 18:00
D | 0 | return book | Sunday
@@ -11,3 +10,9 @@ D | 0 | return book | Sunday
T | 0 | 2103
D | 0 | return li book | 2026-02-19
T | 0 | miss mjr
+T | 0 | 11
+T | 0 | 11
+T | 0 | 111
+E | 0 | project meeting | 2026-02-10 | 2026-02-20
+T | 0 | 11
+E | 0 | project meeting | 2026-02-10 | 2026-02-20
diff --git a/src/main/java/DialogBox.java b/src/main/java/DialogBox.java
index 1cfac902c1..9aed6998ff 100644
--- a/src/main/java/DialogBox.java
+++ b/src/main/java/DialogBox.java
@@ -35,7 +35,10 @@ private DialogBox(String text, Image img) {
dialog.setText(text);
dialog.setWrapText(true);
dialog.setMaxWidth(400);
+
displayPicture.setImage(img);
+
+ dialog.getStyleClass().add("label");
}
/**
@@ -46,15 +49,21 @@ private void flip() {
Collections.reverse(tmp);
getChildren().setAll(tmp);
setAlignment(Pos.TOP_LEFT);
- dialog.getStyleClass().add("reply-label");
+ dialog.getStyleClass().add("lars-label");
}
public static DialogBox getUserDialog(String text, Image img) {
- return new DialogBox(text, img);
+ var db = new DialogBox(text, img);
+ db.setAlignment(Pos.TOP_RIGHT);
+ db.dialog.getStyleClass().add("user-bubble");
+ return db;
}
private void changeDialogStyle(String commandType) {
switch (commandType) {
+ case "Error":
+ dialog.getStyleClass().add("error-bubble");
+ break;
case "AddCommand":
dialog.getStyleClass().add("add-label");
break;
@@ -78,10 +87,15 @@ private void changeDialogStyle(String commandType) {
public static DialogBox getLarsDialog(String text, Image img, String commandType) {
var db = new DialogBox(text, img);
db.flip();
+ db.dialog.getStyleClass().add("lars-bubble");
+
if (commandType != null) {
db.changeDialogStyle(commandType);
}
return db;
}
+ public void flipToErrorStyle() {
+ dialog.getStyleClass().add("error-bubble");
+ }
}
diff --git a/src/main/java/MainWindow.java b/src/main/java/MainWindow.java
index 7314a6b4a4..25db2b8364 100644
--- a/src/main/java/MainWindow.java
+++ b/src/main/java/MainWindow.java
@@ -40,6 +40,12 @@ private void handleUserInput() throws LarsException {
String input = userInput.getText();
String response = lars.getResponse(input);
String commandType = lars.getCommandType();
+ DialogBox larsDialog = DialogBox.getLarsDialog(response, larsImage, commandType);
+
+ if ("Error".equals(commandType)) {
+ larsDialog.flipToErrorStyle();
+ }
+
dialogContainer.getChildren().addAll(
DialogBox.getUserDialog(input, userImage),
DialogBox.getLarsDialog(response, larsImage, commandType)
diff --git a/src/main/resources/css/dialog-box.css b/src/main/resources/css/dialog-box.css
index c6a5500ed7..adde5e643c 100644
--- a/src/main/resources/css/dialog-box.css
+++ b/src/main/resources/css/dialog-box.css
@@ -1,13 +1,25 @@
.label {
- -fx-background-color: linear-gradient(to bottom right, #00ffbf, #00ddff);
- -fx-border-color: #d55e00 #009e73 #cc79a7 #0072b2;
- -fx-border-width: 2px;
+ -fx-background-color: #FAFF72;
+ -fx-border-color: rgba(0,0,0,0.08);;
+ -fx-border-width: 1px;
+ -fx-padding: 8 12 8 12;
+ -fx-text-fill: black;
+}
+
+.user-bubble {
+ -fx-background-color: #A7E6FF;
-fx-background-radius: 1em 1em 0 1em;
-fx-border-radius: 1em 1em 0 1em;
}
+.lars-bubble {
+ -fx-background-color: #FAFF72;
+ -fx-background-radius: 1em 1em 1em 0;
+ -fx-border-radius: 1em 1em 1em 0;
+}
+
.add-label {
- -fx-background-color: yellow;
+ -fx-background-color: #FAFF72;
}
.marked-label {
@@ -18,9 +30,9 @@
-fx-background-color: lightpink;
}
-.reply-label {
- -fx-background-radius: 1em 1em 1em 0;
- -fx-border-radius: 1em 1em 1em 0;
+.error-bubble {
+ -fx-background-color: #FFEBEE !important;
+ -fx-border-color: #FFCDD2 !important;
}
#displayPicture {
diff --git a/src/main/resources/css/main.css b/src/main/resources/css/main.css
index 8a1c027bd5..d487569e50 100644
--- a/src/main/resources/css/main.css
+++ b/src/main/resources/css/main.css
@@ -36,7 +36,7 @@
}
.scroll-bar .thumb {
- -fx-background-color: #ff9cb4;
+ -fx-background-color: #F4C902;
-fx-background-radius: 1em;
}
diff --git a/src/main/resources/view/DialogBox.fxml b/src/main/resources/view/DialogBox.fxml
index 252f139623..47ec7efd4a 100644
--- a/src/main/resources/view/DialogBox.fxml
+++ b/src/main/resources/view/DialogBox.fxml
@@ -9,12 +9,12 @@
-
+