1
0
mirror of https://github.com/kamranahmedse/developer-roadmap.git synced 2025-09-03 14:22:41 +02:00

Improve skeleton and logged out user workflow

This commit is contained in:
Kamran Ahmed
2025-06-13 00:28:30 +01:00
parent 92af03dc6c
commit 41207af0d9
3 changed files with 25 additions and 5 deletions

View File

@@ -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}

View File

@@ -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 (
<div className={cn('relative flex flex-col', className)}>
<div className="mb-4 flex items-center justify-between">
<h1 className="font-medium text-gray-900">Chat History</h1>
{closeButton}
</div>

View File

@@ -12,9 +12,6 @@ export function ListChatHistorySkeleton() {
<div className="relative mt-2">
<div className="h-9 w-full animate-pulse rounded-lg bg-gray-200" />
<div className="absolute top-1/2 left-2.5 -translate-y-1/2">
<div className="h-4 w-4 animate-pulse rounded-full bg-gray-300" />
</div>
</div>
</div>