From 41207af0d9f72d9e58f4f660551f60cc64cd72c0 Mon Sep 17 00:00:00 2001 From: Kamran Ahmed Date: Fri, 13 Jun 2025 00:28:30 +0100 Subject: [PATCH] Improve skeleton and logged out user workflow --- src/components/AIChat/AIChat.tsx | 10 ++++++++++ .../AIChatHistory/ListChatHistory.tsx | 17 +++++++++++++++-- .../AIChatHistory/ListChatHistorySkeleton.tsx | 3 --- 3 files changed, 25 insertions(+), 5 deletions(-) diff --git a/src/components/AIChat/AIChat.tsx b/src/components/AIChat/AIChat.tsx index 2360f0b4e..783398e31 100644 --- a/src/components/AIChat/AIChat.tsx +++ b/src/components/AIChat/AIChat.tsx @@ -448,6 +448,11 @@ export function AIChat(props: AIChatProps) { icon={PersonStandingIcon} label="Personalize" onClick={() => { + if (!isLoggedIn()) { + showLoginPopup(); + return; + } + setIsPersonalizedResponseFormOpen(true); }} /> @@ -455,6 +460,11 @@ export function AIChat(props: AIChatProps) { icon={FileUpIcon} label={isUploading ? 'Processing...' : 'Upload Resume'} onClick={() => { + if (!isLoggedIn()) { + showLoginPopup(); + return; + } + setIsUploadResumeModalOpen(true); }} isLoading={isUploading} diff --git a/src/components/AIChatHistory/ListChatHistory.tsx b/src/components/AIChatHistory/ListChatHistory.tsx index 8d479f53e..e036b2897 100644 --- a/src/components/AIChatHistory/ListChatHistory.tsx +++ b/src/components/AIChatHistory/ListChatHistory.tsx @@ -44,10 +44,24 @@ export function ListChatHistory(props: ListChatHistoryProps) { const deviceType = getTailwindScreenDimension(); const isMediumSize = ['sm', 'md'].includes(deviceType); - setIsOpen(!isMediumSize); + // Only set initial state from localStorage if not on mobile + if (!isMediumSize) { + const storedState = localStorage.getItem('chat-history-sidebar-open'); + setIsOpen(storedState === null ? true : storedState === 'true'); + } else { + setIsOpen(!isMediumSize); + } + setIsMobile(isMediumSize); }, []); + // Save state to localStorage when it changes, but only if not on mobile + useEffect(() => { + if (!isMobile) { + localStorage.setItem('chat-history-sidebar-open', isOpen.toString()); + } + }, [isOpen, isMobile]); + const [query, setQuery] = useState(''); const { @@ -236,7 +250,6 @@ export function UpgradeToProMessage(props: UpgradeToProMessageProps) { return (
-

Chat History

{closeButton}
diff --git a/src/components/AIChatHistory/ListChatHistorySkeleton.tsx b/src/components/AIChatHistory/ListChatHistorySkeleton.tsx index 46f47b0d4..015745fab 100644 --- a/src/components/AIChatHistory/ListChatHistorySkeleton.tsx +++ b/src/components/AIChatHistory/ListChatHistorySkeleton.tsx @@ -12,9 +12,6 @@ export function ListChatHistorySkeleton() {
-
-
-