Skip to content

Commit be4a227

Browse files
committed
Update the chatbot version to 1.8
1 parent 4989ba0 commit be4a227

File tree

2 files changed

+16
-4
lines changed

2 files changed

+16
-4
lines changed

perun/templates/scripts/chatbot.html.jinja2

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,18 @@ const $messageInput = $("#message-input");
6464
const $chatHeader = $("#chat-header");
6565
6666
$chatButton.on("click", function () {
67-
$chatWindow.css("display", $chatWindow.is(":visible") ? "none" : "flex");
67+
const isVisible = $chatWindow.is(":visible");
68+
69+
// Toggle visibility
70+
$chatWindow.css("display", isVisible ? "none" : "flex");
71+
72+
// Add/remove global chat-open flag
73+
if (isVisible) {
74+
document.body.classList.remove("chat-open");
75+
} else {
76+
document.body.classList.add("chat-open");
77+
}
78+
6879
});
6980
7081
function getPilotPrompt() {
@@ -215,13 +226,14 @@ $(document).ready(() => {
215226
216227
$block.hover(
217228
function () {
218-
if (!isSelected) {
229+
// Only show highlight and eye icon if chat is open
230+
if (!isSelected && $("body").hasClass("chat-open")) {
219231
$block.addClass("context-highlight");
220232
$eyeIcon.show();
221233
}
222234
},
223235
function () {
224-
if (!isSelected) {
236+
if (!isSelected && $("body").hasClass("chat-open")) {
225237
$block.removeClass("context-highlight");
226238
$eyeIcon.hide();
227239
}

perun/templates/style/chatbot.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@
163163
transition: box-shadow 0.2s ease;
164164
}
165165

166-
.context-selected {
166+
body.chat-open .context-selected {
167167
box-shadow: 0 0 0 2px #339af0;
168168
background-color: var(--color-secondary-hover);
169169
}

0 commit comments

Comments
 (0)