feat: update public preview UI with adjustable sidebar height, layer panel toggle, and synchronized data loading states(mobile UI)
Build and Release / release (push) Successful in 37s

This commit is contained in:
taDuc
2026-06-04 18:39:46 +07:00
parent 794ad2913f
commit 9a5dfdb2ed
14 changed files with 801 additions and 249 deletions
+11 -1
View File
@@ -14,8 +14,10 @@ type Message = {
export default function ChatbotWidget({
projectId = "",
hideFloatingButton = false,
}: {
projectId?: string;
hideFloatingButton?: boolean;
}) {
const [isOpen, setIsOpen] = useState(false);
const [messages, setMessages] = useState<Message[]>([
@@ -33,6 +35,14 @@ export default function ChatbotWidget({
messagesEndRef.current?.scrollIntoView({ behavior: "smooth" });
};
useEffect(() => {
const handleToggle = () => setIsOpen((prev) => !prev);
window.addEventListener("toggle-chatbot", handleToggle);
return () => {
window.removeEventListener("toggle-chatbot", handleToggle);
};
}, []);
useEffect(() => {
if (isOpen) {
scrollToBottom();
@@ -93,7 +103,7 @@ export default function ChatbotWidget({
return (
<div className="fixed bottom-8 right-8 z-50">
{!isOpen && (
{!isOpen && !hideFloatingButton && (
<button
name="AI chat"
onClick={() => setIsOpen(true)}