From 6240ab677dd73bb05b7a87bd41ba0fa3cc06100b Mon Sep 17 00:00:00 2001 From: "claude[bot]" <209825114+claude[bot]@users.noreply.github.com> Date: Tue, 27 May 2025 09:06:09 +0000 Subject: [PATCH] Add GlobalChat component with drawer functionality MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Create GlobalChat.svelte with placeholder chat functionality - Create GlobalChatDrawer.svelte as drawer wrapper - Add global chat button to sidebar menu (both mobile and desktop) - Integrate global chat state management in main layout - Include message history, loading states, and error handling - Implement responsive design and proper drawer behavior 🤖 Generated with [Claude Code](https://claude.ai/code) Co-authored-by: rubenfiszel --- .../src/lib/components/chat/GlobalChat.svelte | 195 ++++++++++++++++++ .../components/chat/GlobalChatDrawer.svelte | 21 ++ .../src/routes/(root)/(logged)/+layout.svelte | 35 +++- 3 files changed, 250 insertions(+), 1 deletion(-) create mode 100644 frontend/src/lib/components/chat/GlobalChat.svelte create mode 100644 frontend/src/lib/components/chat/GlobalChatDrawer.svelte diff --git a/frontend/src/lib/components/chat/GlobalChat.svelte b/frontend/src/lib/components/chat/GlobalChat.svelte new file mode 100644 index 0000000000..4d8ca25e70 --- /dev/null +++ b/frontend/src/lib/components/chat/GlobalChat.svelte @@ -0,0 +1,195 @@ + + +
+ +
+
+ +

Global Chat

+
+
+ +
+
+ + +
+ {#each messages as msg (msg.timestamp.getTime())} +
+
+

{msg.content}

+
+ + {formatTime(msg.timestamp)} + +
+ {/each} + + {#if $loading} +
+
+
+ + Thinking... +
+
+
+ {/if} +
+ + +
+
+ +
+

+ Global chat with placeholder functionality - ready for AI integration +

+
+
\ No newline at end of file diff --git a/frontend/src/lib/components/chat/GlobalChatDrawer.svelte b/frontend/src/lib/components/chat/GlobalChatDrawer.svelte new file mode 100644 index 0000000000..8276dd986a --- /dev/null +++ b/frontend/src/lib/components/chat/GlobalChatDrawer.svelte @@ -0,0 +1,21 @@ + + + + + + + \ No newline at end of file diff --git a/frontend/src/routes/(root)/(logged)/+layout.svelte b/frontend/src/routes/(root)/(logged)/+layout.svelte index dc3876ffc5..7e396ab764 100644 --- a/frontend/src/routes/(root)/(logged)/+layout.svelte +++ b/frontend/src/routes/(root)/(logged)/+layout.svelte @@ -43,7 +43,7 @@ import { SUPERADMIN_SETTINGS_HASH, USER_SETTINGS_HASH } from '$lib/components/sidebar/settings' import { isCloudHosted } from '$lib/cloud' import { syncTutorialsTodos } from '$lib/tutorialUtils' - import { ArrowLeft, Search } from 'lucide-svelte' + import { ArrowLeft, Search, MessageCircle } from 'lucide-svelte' import { getUserExt } from '$lib/user' import { workspaceAIClients } from '$lib/components/copilot/lib' import { twMerge } from 'tailwind-merge' @@ -53,10 +53,12 @@ import { setContext } from 'svelte' import { base } from '$app/paths' import { Menubar } from '$lib/components/meltComponents' + import GlobalChatDrawer from '$lib/components/chat/GlobalChatDrawer.svelte' OpenAPI.WITH_CREDENTIALS = true let menuOpen = false let globalSearchModal: GlobalSearchModal | undefined = undefined + let globalChatOpen = false let isCollapsed = false let userSettings: UserSettings let superadminSettings: SuperadminSettings @@ -305,6 +307,10 @@ globalSearchModal?.openSearchWithPrefilledText(text) } + function openGlobalChat(): void { + globalChatOpen = true + } + setContext('openSearchWithPrefilledText', openSearchModal) $: { @@ -449,6 +455,14 @@ class="!text-xs" shortcut={`${getModifierKey()}k`} /> + openGlobalChat()} + isCollapsed={false} + icon={MessageCircle} + label="Global Chat" + class="!text-xs" + /> + openGlobalChat()} + {isCollapsed} + icon={MessageCircle} + label="Global Chat" + class="!text-xs" + /> + openGlobalChat()} + {isCollapsed} + icon={MessageCircle} + label="Global Chat" + class="!text-xs" + /> {/if} + + +