From 0cfe5e52bd613738ff78a9e3acf6b6e955af2410 Mon Sep 17 00:00:00 2001 From: Anish Sarkar <104695310+AnishSarkar22@users.noreply.github.com> Date: Thu, 4 Jun 2026 12:57:16 +0530 Subject: [PATCH] refactor(ui): Adjust layout and styling for chat components, enhancing spinner positioning and removing unused shared chat indicators --- .../layout/providers/LayoutDataProvider.tsx | 9 +- .../layout/ui/sidebar/AllChatsSidebar.tsx | 96 ++++++++++--------- .../layout/ui/sidebar/ChatListItem.tsx | 9 +- 3 files changed, 60 insertions(+), 54 deletions(-) diff --git a/surfsense_web/components/layout/providers/LayoutDataProvider.tsx b/surfsense_web/components/layout/providers/LayoutDataProvider.tsx index 57a295cb5..5fac87973 100644 --- a/surfsense_web/components/layout/providers/LayoutDataProvider.tsx +++ b/surfsense_web/components/layout/providers/LayoutDataProvider.tsx @@ -704,7 +704,7 @@ export function LayoutDataProvider({ searchSpaceId, children }: LayoutDataProvid } workspacePanelContentClassName={ isAutomationsPage - ? "max-w-none" + ? "max-w-none select-none" : isUserSettingsPage || isSearchSpaceSettingsPage || isTeamPage ? "max-w-5xl" : undefined @@ -815,7 +815,12 @@ export function LayoutDataProvider({ searchSpaceId, children }: LayoutDataProvid {tSidebar("rename") || "Rename"} - {isRenamingChat && } + {isRenamingChat && ( + + )} diff --git a/surfsense_web/components/layout/ui/sidebar/AllChatsSidebar.tsx b/surfsense_web/components/layout/ui/sidebar/AllChatsSidebar.tsx index bb5c0db39..7149f5f00 100644 --- a/surfsense_web/components/layout/ui/sidebar/AllChatsSidebar.tsx +++ b/surfsense_web/components/layout/ui/sidebar/AllChatsSidebar.tsx @@ -359,17 +359,12 @@ export function AllChatsSidebarContent({ "h-auto w-full justify-start gap-2 overflow-hidden px-2 py-1.5 text-left font-normal", "group-hover/item:bg-accent group-hover/item:text-accent-foreground", "focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring", + thread.visibility === "SEARCH_SPACE" && "pr-9", isActive && "bg-accent text-accent-foreground", isBusy && "opacity-50 pointer-events-none" )} > {thread.title || "New Chat"} - {thread.visibility === "SEARCH_SPACE" ? ( - - ) : null} ) : ( @@ -383,6 +378,7 @@ export function AllChatsSidebarContent({ "h-auto w-full justify-start gap-2 overflow-hidden px-2 py-1.5 text-left font-normal", "group-hover/item:bg-accent group-hover/item:text-accent-foreground", "focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring", + thread.visibility === "SEARCH_SPACE" && "pr-9", isActive && "bg-accent text-accent-foreground", isBusy && "opacity-50 pointer-events-none" )} @@ -390,12 +386,6 @@ export function AllChatsSidebarContent({ {thread.title || "New Chat"} - {thread.visibility === "SEARCH_SPACE" ? ( - - ) : null} @@ -414,34 +404,50 @@ export function AllChatsSidebarContent({ : "bg-gradient-to-l from-sidebar from-60% to-transparent group-hover/item:from-accent", isMobile ? "opacity-0" - : openDropdownId === thread.id + : thread.visibility === "SEARCH_SPACE" || openDropdownId === thread.id ? "opacity-100" : "opacity-0 group-hover/item:opacity-100" )} > - setOpenDropdownId(isOpen ? thread.id : null)} - > - - - - + /> + ) : null} + setOpenDropdownId(isOpen ? thread.id : null)} + > + + + + {!thread.archived && ( handleStartRename(thread.id, thread.title || "New Chat")} @@ -470,8 +476,9 @@ export function AllChatsSidebarContent({ {t("delete") || "Delete"} - - + + + ); @@ -534,16 +541,17 @@ export function AllChatsSidebarContent({ diff --git a/surfsense_web/components/layout/ui/sidebar/ChatListItem.tsx b/surfsense_web/components/layout/ui/sidebar/ChatListItem.tsx index ec0ba534a..fd6edb3ea 100644 --- a/surfsense_web/components/layout/ui/sidebar/ChatListItem.tsx +++ b/surfsense_web/components/layout/ui/sidebar/ChatListItem.tsx @@ -1,6 +1,6 @@ "use client"; -import { ArchiveIcon, MoreHorizontal, Pencil, RotateCcwIcon, Trash2, Users } from "lucide-react"; +import { ArchiveIcon, MoreHorizontal, Pencil, RotateCcwIcon, Trash2 } from "lucide-react"; import { useTranslations } from "next-intl"; import { useCallback, useState } from "react"; import { Button } from "@/components/ui/button"; @@ -31,7 +31,6 @@ interface ChatListItemProps { export function ChatListItem({ name, isActive, - isShared, archived, dropdownOpen: controlledOpen, onDropdownOpenChange, @@ -71,12 +70,6 @@ export function ChatListItem({ )} > {animatedName} - {isShared ? ( - - ) : null} {/* Actions dropdown - trigger hidden on mobile, long-press opens it instead */}