-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- optimiztion speed - prevent see anything in auth provider https://github.com/user-attachments/assets/d3f4e2e5-1147-43e3-9b04-1af703979aed <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit ## Release Notes - **New Features** - Introduced `LoadingPage` component for a full-screen loading overlay with theme adaptability. - Added `SideBarItem` component for managing chat functionalities in the sidebar. - New `ScrollArea` and `ScrollBar` components for customizable scroll areas. - Introduced `Separator` component for rendering horizontal and vertical separators. - Added `AuthProvider` for managing user authentication state. - New `BaseProviders` component to wrap essential context providers. - **Enhancements** - Improved `ChatList` component with message editing capabilities. - Enhanced `ChatTopbar` for a simplified model selection interface. - Refactored `Sidebar` to utilize props for chat management, improving performance. - **Bug Fixes** - Fixed styling and transition effects on the `LoginPage` component. - **Chores** - Updated various package dependencies for improved functionality and performance. <!-- end of auto-generated comment: release notes by coderabbit.ai --> --------- Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
- Loading branch information
1 parent
7a120f1
commit 92e5065
Showing
37 changed files
with
1,567 additions
and
1,387 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,4 +3,4 @@ dist | |
coverage | ||
.github | ||
.husky | ||
*.config.js | ||
*.config.js |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,8 @@ | ||
{ | ||
"extends": "next/core-web-vitals", | ||
"ignorePatterns": ["src/graphql/type.ts", "src/graphql/**/*"] | ||
"ignorePatterns": [ | ||
"src/graphql/type.ts", | ||
"src/graphql/**/*", | ||
"src/components/ui/**/*" | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,29 +1,28 @@ | ||
/** @type {import('next').NextConfig} */ | ||
const nextConfig = { | ||
output: 'standalone', | ||
reactStrictMode: true, | ||
webpack: (config, { isServer }) => { | ||
// Fixes npm packages that depend on `fs` module | ||
if (!isServer) { | ||
config.resolve.fallback = { | ||
...config.resolve.fallback, // if you miss it, all the other options in fallback, specified | ||
// by next.js will be dropped. Doesn't make much sense, but how it is | ||
fs: false, // the solution | ||
module: false, | ||
perf_hooks: false, | ||
}; | ||
} | ||
|
||
return config | ||
}, | ||
typescript: { | ||
// !! WARN !! | ||
// Dangerously allow production builds to successfully complete even if | ||
// your project has type errors. | ||
// !! WARN !! | ||
ignoreBuildErrors: true, | ||
}, | ||
}; | ||
|
||
// Fixes npm packages that depend on `fs` module | ||
if (!isServer) { | ||
config.resolve.fallback = { | ||
...config.resolve.fallback, // if you miss it, all the other options in fallback, specified | ||
// by next.js will be dropped. Doesn't make much sense, but how it is | ||
fs: false, // the solution | ||
module: false, | ||
perf_hooks: false, | ||
}; | ||
} | ||
|
||
return config; | ||
}, | ||
typescript: { | ||
// !! WARN !! | ||
// Dangerously allow production builds to successfully complete even if | ||
// your project has type errors. | ||
// !! WARN !! | ||
ignoreBuildErrors: true, | ||
}, | ||
}; | ||
|
||
export default nextConfig; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,98 @@ | ||
'use client'; | ||
|
||
import React, { useEffect, useState } from 'react'; | ||
import { | ||
ResizableHandle, | ||
ResizablePanel, | ||
ResizablePanelGroup, | ||
} from '@/components/ui/resizable'; | ||
import { cn } from '@/lib/utils'; | ||
import { usePathname } from 'next/navigation'; | ||
import Sidebar from '@/components/sidebar'; | ||
import { useChatList } from '../hooks/useChatList'; | ||
|
||
export default function MainLayout({ | ||
children, | ||
}: { | ||
children: React.ReactNode; | ||
}) { | ||
const [isCollapsed, setIsCollapsed] = useState(false); | ||
const [isMobile, setIsMobile] = useState(false); | ||
const defaultLayout = [30, 160]; | ||
const navCollapsedSize = 10; | ||
|
||
const pathname = usePathname(); | ||
const currentChatId = pathname.split('/')[1] || ''; | ||
|
||
const { | ||
chats, | ||
loading, | ||
error, | ||
chatListUpdated, | ||
setChatListUpdated, | ||
refetchChats, | ||
} = useChatList(); | ||
|
||
useEffect(() => { | ||
const checkScreenWidth = () => { | ||
setIsMobile(window.innerWidth <= 1023); | ||
}; | ||
checkScreenWidth(); | ||
window.addEventListener('resize', checkScreenWidth); | ||
return () => { | ||
window.removeEventListener('resize', checkScreenWidth); | ||
}; | ||
}, []); | ||
|
||
return ( | ||
<main className="flex h-[calc(100dvh)] flex-col items-center"> | ||
<ResizablePanelGroup | ||
direction="horizontal" | ||
onLayout={(sizes: number[]) => { | ||
document.cookie = `react-resizable-panels:layout=${JSON.stringify(sizes)}`; | ||
}} | ||
className="h-screen items-stretch" | ||
> | ||
<ResizablePanel | ||
defaultSize={defaultLayout[0]} | ||
collapsedSize={navCollapsedSize} | ||
collapsible={true} | ||
minSize={isMobile ? 0 : 12} | ||
maxSize={isMobile ? 0 : 16} | ||
onCollapse={() => { | ||
setIsCollapsed(true); | ||
document.cookie = `react-resizable-panels:collapsed=${JSON.stringify(true)}`; | ||
}} | ||
onExpand={() => { | ||
setIsCollapsed(false); | ||
document.cookie = `react-resizable-panels:collapsed=${JSON.stringify(false)}`; | ||
}} | ||
className={cn( | ||
isCollapsed | ||
? 'min-w-[50px] md:min-w-[70px] transition-all duration-300 ease-in-out' | ||
: 'hidden md:block' | ||
)} | ||
> | ||
<Sidebar | ||
isCollapsed={isCollapsed} | ||
isMobile={isMobile} | ||
currentChatId={currentChatId} | ||
chatListUpdated={chatListUpdated} | ||
setChatListUpdated={setChatListUpdated} | ||
chats={chats} | ||
loading={loading} | ||
error={error} | ||
onRefetch={refetchChats} | ||
/> | ||
</ResizablePanel> | ||
<ResizableHandle className={cn('hidden md:flex')} withHandle /> | ||
<ResizablePanel | ||
className="h-full w-full flex justify-center" | ||
defaultSize={defaultLayout[1]} | ||
> | ||
{children} | ||
</ResizablePanel> | ||
</ResizablePanelGroup> | ||
</main> | ||
); | ||
} |
Oops, something went wrong.