Skip to content

Commit 539b48e

Browse files
committed
fix: AI assistant page
1 parent 99e1fc2 commit 539b48e

File tree

5 files changed

+27
-22
lines changed

5 files changed

+27
-22
lines changed

apps/dashboard/app/(main)/websites/[id]/assistant/components/ai-assistant-main.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -56,19 +56,19 @@ export default function AIAssistantMain() {
5656

5757
return (
5858
<div className="h-full bg-gradient-to-br from-background to-muted/20">
59-
<div className="flex h-full flex-1 flex-col gap-3 overflow-hidden lg:flex-row">
59+
<div className="flex h-full flex-col gap-3 overflow-hidden lg:flex-row">
6060
<div
6161
className={cn(
62-
'flex flex-col overflow-hidden',
63-
shouldShowVisualization ? 'lg:flex-[0.6]' : 'flex-1'
62+
'flex min-h-0 flex-col overflow-hidden',
63+
shouldShowVisualization ? 'flex-1 lg:flex-[3]' : 'flex-1'
6464
)}
6565
>
6666
<Suspense fallback={<ChatSkeleton />}>
6767
<ChatSection />
6868
</Suspense>
6969
</div>
7070
{shouldShowVisualization && (
71-
<div className="flex flex-[0.4] flex-col overflow-hidden">
71+
<div className="flex min-h-0 flex-1 flex-col overflow-hidden lg:flex-[2]">
7272
<Suspense fallback={<VisualizationSkeleton />}>
7373
<VisualizationSection />
7474
</Suspense>

apps/dashboard/app/(main)/websites/[id]/assistant/components/chat-section.tsx

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ export default function ChatSection() {
137137
};
138138

139139
return (
140-
<div className="flex min-h-0 flex-1 flex-col overflow-hidden rounded border bg-gradient-to-br from-background to-muted/10 shadow-lg backdrop-blur-sm">
140+
<div className="flex h-full min-h-0 flex-col overflow-hidden rounded border bg-gradient-to-br from-background to-muted/10 shadow-lg backdrop-blur-sm">
141141
{/* Enhanced Header */}
142142
<div className="flex flex-shrink-0 items-center justify-between border-b bg-gradient-to-r from-primary/5 to-accent/5 p-4">
143143
<div className="flex min-w-0 flex-1 items-center gap-3">
@@ -201,9 +201,12 @@ export default function ChatSection() {
201201
</div>
202202

203203
{/* Messages Area */}
204-
<div className="min-h-0 flex-1 overflow-y-auto" ref={scrollAreaRef}>
204+
<div
205+
className="min-h-0 flex-1 overflow-y-auto overscroll-contain"
206+
ref={scrollAreaRef}
207+
>
205208
{/* Welcome State */}
206-
<div className="h-full px-4 py-3">
209+
<div className="min-h-full px-4 py-3">
207210
{!(hasMessages || isLoading) && (
208211
<div className="fade-in-0 slide-in-from-bottom-4 h-full animate-in space-y-6 duration-500">
209212
<div className="flex h-full flex-col justify-between">

apps/dashboard/app/(main)/websites/[id]/assistant/components/visualization-section.tsx

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1157,15 +1157,13 @@ export default function VisualizationSection() {
11571157
)}
11581158
</div>
11591159

1160-
<div className="min-h-0 flex-1 overflow-y-auto">
1161-
<ScrollArea className="h-full">
1162-
<div
1163-
className={`p-3 transition-all duration-300 ${websiteData ? 'opacity-100' : 'opacity-90'}`}
1164-
>
1165-
{renderChartContent()}
1166-
</div>
1167-
</ScrollArea>
1168-
</div>
1160+
<ScrollArea className="min-h-0 flex-1">
1161+
<div
1162+
className={`p-3 transition-all duration-300 ${websiteData ? 'opacity-100' : 'opacity-90'}`}
1163+
>
1164+
{renderChartContent()}
1165+
</div>
1166+
</ScrollArea>
11691167
</div>
11701168
);
11711169
}

apps/dashboard/app/(main)/websites/[id]/assistant/page.tsx

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@ const AIAssistantMain = dynamic(
2222

2323
function AIAssistantLoadingSkeleton() {
2424
return (
25-
<div className="flex h-full flex-col gap-3">
26-
<div className="flex flex-1 gap-3 overflow-hidden">
25+
<div className="flex h-full min-h-0 flex-col gap-3">
26+
<div className="flex min-h-0 flex-1 gap-3 overflow-hidden">
2727
<div className="flex flex-[2_2_0%] flex-col overflow-hidden rounded border bg-background shadow-sm">
2828
<div className="flex-shrink-0 border-b p-3">
2929
<Skeleton className="mb-1 h-5 w-32" />
@@ -81,5 +81,9 @@ export default function AssistantPage() {
8181
return <AIAssistantLoadingSkeleton />;
8282
}
8383

84-
return <AIAssistantMain />;
84+
return (
85+
<div className="h-full min-h-0">
86+
<AIAssistantMain />
87+
</div>
88+
);
8589
}

apps/dashboard/app/(main)/websites/[id]/layout.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,9 +50,9 @@ export default function WebsiteLayout({ children }: WebsiteLayoutProps) {
5050
};
5151

5252
return (
53-
<div className="mx-auto h-full max-w-[1600px] p-3 sm:p-4 lg:p-6">
53+
<div className="mx-auto flex h-full max-w-[1600px] flex-col p-3 sm:p-4 lg:p-6">
5454
{isTrackingSetup && !isAssistantPage && (
55-
<div className="space-y-4">
55+
<div className="flex-shrink-0 space-y-4">
5656
<AnalyticsToolbar
5757
isRefreshing={isRefreshing}
5858
onRefresh={handleRefresh}
@@ -64,7 +64,7 @@ export default function WebsiteLayout({ children }: WebsiteLayoutProps) {
6464
</div>
6565
)}
6666

67-
{children}
67+
<div className={isAssistantPage ? 'min-h-0 flex-1' : ''}>{children}</div>
6868
</div>
6969
);
7070
}

0 commit comments

Comments
 (0)