fix: give ai-cad a dedicated shell layout
Some checks failed
Lint / build (20) (push) Has been cancelled
Playwright Tests / test (push) Has been cancelled

This commit is contained in:
Your Name 2026-04-06 16:07:26 +08:00
parent 9d3ba9b353
commit 450e998d3f
2 changed files with 33 additions and 20 deletions

View File

@ -3595,7 +3595,7 @@ export function AiCadWorkbench() {
}
return (
<div className="flex h-full flex-col overflow-hidden bg-[#1b1b1b] text-white">
<div className="flex min-h-svh flex-col overflow-hidden bg-[#1b1b1b] text-white">
<div className="border-white/10 border-b bg-[#252525] px-3 py-2.5 xl:px-4">
<div className="space-y-2.5">
<div className="flex flex-col gap-2.5 border-white/10 border-b pb-2.5 xl:flex-row xl:items-center xl:justify-between">

View File

@ -68,6 +68,7 @@ export function ChatShell({
}: ChatShellProps) {
const pathname = usePathname();
const isLovartHome = pathname === "/" && homeVariant === "lovart";
const isAiCadWorkspace = pathname === "/ai-cad";
if (isLovartHome) {
return <div className="h-svh w-full overflow-y-auto">{children}</div>;
@ -75,26 +76,38 @@ export function ChatShell({
return (
<SidebarProvider defaultOpen={!isCollapsed}>
<TopNavbar
siteName={siteName}
siteLogo={siteLogo}
siteLogoDark={siteLogoDark}
isAdmin={isAdmin}
settingsHref={settingsHref}
customLinks={customLinks}
toolbox1Name={toolbox1Name}
toolbox1Enabled={toolbox1Enabled}
toolbox2Name={toolbox2Name}
toolbox2Enabled={toolbox2Enabled}
tutorialVideos={tutorialVideos}
tutorialEnabled={tutorialEnabled}
rankingEnabled={rankingEnabled}
productPlanningEnabled={productPlanningEnabled}
agentEnabled={agentEnabled}
/>
<div className="flex h-svh w-full overflow-hidden pl-16 [--sidebar-offset:4rem]">
{isAiCadWorkspace ? null : (
<TopNavbar
agentEnabled={agentEnabled}
customLinks={customLinks}
isAdmin={isAdmin}
productPlanningEnabled={productPlanningEnabled}
rankingEnabled={rankingEnabled}
settingsHref={settingsHref}
siteLogo={siteLogo}
siteLogoDark={siteLogoDark}
siteName={siteName}
toolbox1Enabled={toolbox1Enabled}
toolbox1Name={toolbox1Name}
toolbox2Enabled={toolbox2Enabled}
toolbox2Name={toolbox2Name}
tutorialEnabled={tutorialEnabled}
tutorialVideos={tutorialVideos}
/>
)}
<div
className={
isAiCadWorkspace
? "flex min-h-svh w-full pl-16 [--sidebar-offset:4rem]"
: "flex h-svh w-full overflow-hidden pl-16 [--sidebar-offset:4rem]"
}
>
<AppSidebar user={user} />
<SidebarInset className="h-full">{children}</SidebarInset>
<SidebarInset
className={isAiCadWorkspace ? "min-h-svh overflow-visible" : "h-full"}
>
{children}
</SidebarInset>
</div>
</SidebarProvider>
);