From e134d67cec0717ed18a817c636dbb7163a28b81d Mon Sep 17 00:00:00 2001 From: kusowl Date: Sat, 2 May 2026 00:13:18 +0530 Subject: [PATCH] fix: main chat now fillup space when sidebar is closed. --- frontend/src/app/chat/chat.css | 37 +++-- frontend/src/app/chat/chat.html | 63 +++++--- .../src/app/core/layout/sidebar/sidebar.html | 148 ++++++++---------- .../src/app/core/layout/sidebar/sidebar.ts | 6 +- 4 files changed, 133 insertions(+), 121 deletions(-) diff --git a/frontend/src/app/chat/chat.css b/frontend/src/app/chat/chat.css index 731a71e..bb7cb64 100644 --- a/frontend/src/app/chat/chat.css +++ b/frontend/src/app/chat/chat.css @@ -1,5 +1,6 @@ -@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600&display=swap'); - +:host { + min-width: 100%; +} .custom-scrollbar::-webkit-scrollbar { width: 6px; } @@ -36,17 +37,35 @@ } @keyframes typing { - 0%, 80%, 100% { transform: scale(0); opacity: 0.3; } - 40% { transform: scale(1); opacity: 1; } + 0%, + 80%, + 100% { + transform: scale(0); + opacity: 0.3; + } + 40% { + transform: scale(1); + opacity: 1; + } } @keyframes pulse { - 0% { box-shadow: 0 0 0 0 rgba(79, 172, 254, 0.4); } - 70% { box-shadow: 0 0 0 10px rgba(79, 172, 254, 0); } - 100% { box-shadow: 0 0 0 0 rgba(79, 172, 254, 0); } + 0% { + box-shadow: 0 0 0 0 rgba(79, 172, 254, 0.4); + } + 70% { + box-shadow: 0 0 0 10px rgba(79, 172, 254, 0); + } + 100% { + box-shadow: 0 0 0 0 rgba(79, 172, 254, 0); + } } @keyframes fadeIn { - from { opacity: 0; } - to { opacity: 1; } + from { + opacity: 0; + } + to { + opacity: 1; + } } diff --git a/frontend/src/app/chat/chat.html b/frontend/src/app/chat/chat.html index fac9fd8..2e84880 100644 --- a/frontend/src/app/chat/chat.html +++ b/frontend/src/app/chat/chat.html @@ -1,39 +1,52 @@ -
-
+
+
@for (msg of messageStore.messages(); track msg.id) { +
-
- {{ msg.attributes.content }} -
-
- {{ msg.attributes.createdAt | date:'shortTime' }} -
+ {{ msg.attributes.content }}
- } - - @if (messageStore.isLoading()) { -
-
-
-
+
+ {{ msg.attributes.createdAt | date:'shortTime' }}
+
+ } @if (messageStore.isLoading()) { +
+
+
+
+
}
@if (errorMessage) { -
- {{ errorMessage }} -
+
+ {{ errorMessage }} +
} -
+
- +
diff --git a/frontend/src/app/core/layout/sidebar/sidebar.html b/frontend/src/app/core/layout/sidebar/sidebar.html index 131bbcb..54fd5a6 100644 --- a/frontend/src/app/core/layout/sidebar/sidebar.html +++ b/frontend/src/app/core/layout/sidebar/sidebar.html @@ -1,5 +1,5 @@ +@if(!isOpen()){ +} - -
- -
+ @if (chatStore.chats().length !== 0) {
@for (chat of chatStore.chats(); track chat.id) { - + + +
+

{{ chat.attributes.title }}

+
+ + + {{ formatTime(chat.attributes.createdAt) }} +
+ }
- + } @if (chatStore.chats().length === 0) { -
-
- - - -
-

No chats found

+
+
+ + +
+

No chats found

+
} diff --git a/frontend/src/app/core/layout/sidebar/sidebar.ts b/frontend/src/app/core/layout/sidebar/sidebar.ts index ec51625..a43adac 100644 --- a/frontend/src/app/core/layout/sidebar/sidebar.ts +++ b/frontend/src/app/core/layout/sidebar/sidebar.ts @@ -17,13 +17,13 @@ export class Sidebar implements OnInit { ngOnInit() { this.chatStore.fetchChats(); - console.log(this.chatStore.chats()); } protected sidebarClasses = computed(() => { const base = - 'fixed top-0 right-0 h-full w-64 border-l border-[#1e2f4d] flex flex-col z-40 transition-transform duration-300 ease-in-out shadow-2xl shadow-black/40 relative overflow-hidden'; - return this.isOpen() ? base : base + ' translate-x-full'; + 'rounded-l-xl top-0 right-0 h-full border-l border-[#1e2f4d] flex flex-col transition-all duration-300 ease-in-out shadow-2xl shadow-black/40 overflow-hidden'; + + return this.isOpen() ? base + ' w-64' : base + ' w-0 border-none opacity-0'; }); protected chatItemClasses(chat: any): string {