Skip to content

Commit 3900383

Browse files
committedJan 7, 2025
clean the unnecessary comments
1 parent 06000a6 commit 3900383

File tree

2 files changed

+20
-24
lines changed

2 files changed

+20
-24
lines changed
 

‎search_engine/search/frontend/src/assets/styles/style.css

+17-17
Original file line numberDiff line numberDiff line change
@@ -432,16 +432,16 @@
432432

433433
/* Highlight selected filters options*/
434434
.highlighted {
435-
background-color: #e0f4ff; /* Very light blue background for selected filters */
435+
background-color: #e0f4ff;
436436
font-weight: bold;
437-
color: #0092b3; /* Slightly darker blue text color for better contrast */
437+
color: #0092b3;
438438
padding: 2px 4px;
439439
border-radius: 4px;
440440
}
441441

442442
/* Highlight the filter results in materials */
443443
mark {
444-
background-color: #ffffcc;; /* Highlight color for matching text */
444+
background-color: #ffffcc;;
445445
font-weight: bold;
446446
}
447447

@@ -520,18 +520,18 @@ mark {
520520
/*** Searchbar Suggestion Dropdown ***/
521521
.suggestion-list {
522522
position: absolute;
523-
background-color: white; /* Set background color to make suggestions visible */
524-
border: 1px solid #ccc; /* Adds a border for better visual distinction */
525-
width: 100%; /* Ensure it takes the width of the search input */
526-
z-index: 1000; /* Ensure it stays on top of other elements */
523+
background-color: white;
524+
border: 1px solid #ccc;
525+
width: 100%;
526+
z-index: 1000;
527527
list-style: none;
528528
padding: 0;
529529
margin: 0;
530530
}
531531

532532
.suggestion-list li {
533533
padding: 10px;
534-
border-bottom: 1px solid #ccc; /* Adds a separator between suggestions */
534+
border-bottom: 1px solid #ccc;
535535
cursor: pointer;
536536
text-align: left;
537537
}
@@ -545,7 +545,7 @@ mark {
545545
}
546546

547547
.suggestion-list li span {
548-
color: black; /* Ensure text is visible */
548+
color: black;
549549
}
550550

551551
.suggestion_list_mark {
@@ -595,20 +595,20 @@ mark {
595595
height: 80px;
596596
border-radius: 50%;
597597
background-color: #ffffff;
598-
box-shadow: 0 8px 15px rgba(0, 0, 0, 0.3); /* Default shadow */
598+
box-shadow: 0 8px 15px rgba(0, 0, 0, 0.3);
599599
display: flex;
600600
align-items: center;
601601
justify-content: center;
602602
overflow: hidden;
603-
transition: box-shadow 0.3s ease; /* Smooth transition */
603+
transition: box-shadow 0.3s ease;
604604
}
605605

606606
.chatbot-icon-container:hover {
607-
box-shadow: 0 12px 20px rgba(0, 0, 0, 0.5); /* Darker shadow on hover */
607+
box-shadow: 0 12px 20px rgba(0, 0, 0, 0.5);
608608
}
609609

610610
.chatbot-icon-container.active:hover {
611-
box-shadow: 0 8px 15px rgba(0, 0, 0, 0.3); /* Disable hover effect when active */
611+
box-shadow: 0 8px 15px rgba(0, 0, 0, 0.3);
612612
}
613613

614614

@@ -663,11 +663,11 @@ mark {
663663

664664
.bot-row {
665665
justify-content: flex-start;
666-
align-items: flex-start; /* Align items to the top */
666+
align-items: flex-start;
667667
}
668668

669669
.user-row {
670-
justify-content: flex-end; /* Align user content to the right */
670+
justify-content: flex-end;
671671
}
672672

673673
.chat-avatar {
@@ -694,8 +694,8 @@ mark {
694694
border-radius: 10px;
695695
max-width: 70%;
696696
word-wrap: break-word;
697-
display: inline-block; /* Ensure bubble is inline with the avatar */
698-
margin: 0; /* Remove unnecessary margin */
697+
display: inline-block;
698+
margin: 0;
699699
}
700700

701701
.user-bubble {

‎search_engine/search/frontend/src/components/ChatbotWidget.js

+3-7
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,7 @@ import robotAvatar from "../assets/images/avatar_robot.jpg";
44
import userAvatar from "../assets/images/avatar_user.jpg";
55
import axios from "axios";
66

7-
// Utility function to detect and render URLs as clickable links
87
const renderMessageWithLinks = (message) => {
9-
// Updated regex to exclude trailing parentheses unless balanced
108
const urlRegex = /(https?:\/\/[^\s\)\]]*[^\s\)\]\.])/g;
119
const parts = message.split(urlRegex);
1210

@@ -28,14 +26,13 @@ const renderMessageWithLinks = (message) => {
2826
});
2927
};
3028

31-
3229
const ChatbotWidget = () => {
3330
const [isOpen, setIsOpen] = useState(false);
3431
const [query, setQuery] = useState("");
3532
const [chatHistory, setChatHistory] = useState([]);
3633
const [isFirstOpen, setIsFirstOpen] = useState(true);
3734
const [isThinking, setIsThinking] = useState(false);
38-
const chatContainerRef = useRef(null); // Reference for chat bubbles container
35+
const chatContainerRef = useRef(null);
3936

4037
const toggleChatbot = () => {
4138
setIsOpen(!isOpen);
@@ -49,7 +46,7 @@ const ChatbotWidget = () => {
4946
}, 500);
5047
}
5148
};
52-
49+
5350
const handleQueryChange = (e) => {
5451
setQuery(e.target.value);
5552
};
@@ -84,11 +81,10 @@ const ChatbotWidget = () => {
8481
};
8582

8683
useEffect(() => {
87-
// Automatically scroll to the bottom of the chat
8884
if (chatContainerRef.current) {
8985
chatContainerRef.current.scrollTop = chatContainerRef.current.scrollHeight;
9086
}
91-
}, [chatHistory, isThinking]); // Trigger scroll on chatHistory or isThinking change
87+
}, [chatHistory, isThinking]);
9288

9389
return (
9490
<div className="chatbot-icon-container">

0 commit comments

Comments
 (0)
Please sign in to comment.