Skip to content

Commit 2671be6

Browse files
committed
style: make layout more compact to fit in viewport
Reduce padding and spacing across components to fit content in a single viewport without scrolling. Update GlobalNav, AnalysisTabs, VideoHeader, EvidenceStrip, SummaryCard, and OverviewContent.
1 parent a4eb540 commit 2671be6

File tree

7 files changed

+97
-99
lines changed

7 files changed

+97
-99
lines changed

src/app/analysis/[id]/layout.tsx

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -28,20 +28,20 @@ function AnalysisLayoutContent({ children }: { children: React.ReactNode }) {
2828

2929
if (isLoading) {
3030
return (
31-
<div className="min-h-screen bg-[#FAF8F5]">
31+
<div className="h-screen flex flex-col overflow-hidden bg-[#FAF8F5]">
3232
<GlobalNav />
33-
<div className="border-b border-[#E8E4DC] bg-white">
34-
<div className="px-6 py-4">
35-
<Skeleton className="h-16 w-full" />
33+
<div className="border-b border-[#E8E4DC] bg-white flex-shrink-0">
34+
<div className="px-4 py-2">
35+
<Skeleton className="h-10 w-full" />
3636
</div>
3737
</div>
38-
<div className="border-b border-[#E8E4DC] bg-white">
39-
<div className="px-6">
40-
<Skeleton className="h-12 w-96" />
38+
<div className="border-b border-[#E8E4DC] bg-white flex-shrink-0">
39+
<div className="px-4">
40+
<Skeleton className="h-10 w-80" />
4141
</div>
4242
</div>
43-
<main className="p-6">
44-
<Skeleton className="h-[600px] w-full" />
43+
<main className="flex-1 overflow-auto p-4">
44+
<Skeleton className="h-full w-full" />
4545
</main>
4646
</div>
4747
);
@@ -52,12 +52,12 @@ function AnalysisLayoutContent({ children }: { children: React.ReactNode }) {
5252
}
5353

5454
return (
55-
<div className="min-h-screen bg-[#FAF8F5]">
55+
<div className="h-screen flex flex-col overflow-hidden bg-[#FAF8F5]">
5656
<GlobalNav />
5757

5858
{/* Video Header */}
59-
<div className="border-b border-[#E8E4DC] bg-white">
60-
<div className="px-6 py-4">
59+
<div className="border-b border-[#E8E4DC] bg-white flex-shrink-0">
60+
<div className="px-4 py-2">
6161
<VideoHeader
6262
video={analysis.video}
6363
totalComments={analysis.total_comments}
@@ -70,7 +70,7 @@ function AnalysisLayoutContent({ children }: { children: React.ReactNode }) {
7070
<AnalysisTabs analysisId={analysisId} />
7171

7272
{/* Page Content */}
73-
<main className="p-6">{children}</main>
73+
<main className="flex-1 overflow-auto p-4">{children}</main>
7474
</div>
7575
);
7676
}

src/components/blocks/evidence-strip.tsx

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -30,31 +30,31 @@ export function EvidenceStrip({ comments, className }: EvidenceStripProps) {
3030
}
3131
};
3232

33-
const truncateText = (text: string, maxLength: number = 80) => {
33+
const truncateText = (text: string, maxLength: number = 60) => {
3434
if (text.length <= maxLength) return text;
3535
return text.slice(0, maxLength).trim() + "...";
3636
};
3737

3838
return (
39-
<div className={cn("space-y-3", className)}>
40-
<div className="flex items-center gap-2 text-xs font-semibold text-[#6B7280] uppercase tracking-wider">
41-
<Quote className="h-3.5 w-3.5" />
39+
<div className={cn("space-y-2", className)}>
40+
<div className="flex items-center gap-1.5 text-[10px] font-semibold text-[#6B7280] uppercase tracking-wider">
41+
<Quote className="h-3 w-3" />
4242
<span>Top Evidence</span>
4343
</div>
44-
<div className="space-y-2">
44+
<div className="space-y-1.5">
4545
{topComments.map((comment) => (
4646
<div
4747
key={comment.id}
4848
className={cn(
49-
"p-3 rounded-lg border-l-4 transition-colors hover:brightness-95",
49+
"p-2 rounded-md border-l-3 transition-colors hover:brightness-95",
5050
getSentimentStyle(comment.sentiment)
5151
)}
5252
>
53-
<p className="text-sm text-[#1E3A5F] leading-relaxed">
53+
<p className="text-[11px] text-[#1E3A5F] leading-snug">
5454
"{truncateText(comment.text)}"
5555
</p>
56-
<div className="mt-2 flex items-center gap-2 text-xs text-[#6B7280]">
57-
<ThumbsUp className="h-3 w-3" />
56+
<div className="mt-1 flex items-center gap-1.5 text-[10px] text-[#6B7280]">
57+
<ThumbsUp className="h-2.5 w-2.5" />
5858
<span className="font-medium">{comment.like_count.toLocaleString()}</span>
5959
</div>
6060
</div>

src/components/blocks/summary-card.tsx

Lines changed: 21 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -69,70 +69,68 @@ export function SummaryCard({
6969
return (
7070
<div
7171
className={cn(
72-
"rounded-xl border border-[#E8E4DC] bg-white overflow-hidden card-hover",
72+
"rounded-lg border border-[#E8E4DC] bg-white overflow-hidden card-hover",
7373
className
7474
)}
7575
>
7676
{/* Header */}
77-
<div className={cn("px-4 py-3 flex items-center gap-3", config.headerBg)}>
78-
<Icon className="h-5 w-5 text-white" />
79-
<h3 className="font-semibold text-white">{config.label}</h3>
80-
<span className="ml-auto text-sm text-white/80 font-mono">
81-
{commentCount} comments
77+
<div className={cn("px-3 py-2 flex items-center gap-2", config.headerBg)}>
78+
<Icon className="h-4 w-4 text-white" />
79+
<h3 className="text-sm font-semibold text-white">{config.label}</h3>
80+
<span className="ml-auto text-xs text-white/80 font-mono">
81+
{commentCount}
8282
</span>
8383
</div>
8484

8585
{/* Content */}
86-
<div className="p-4 space-y-4">
86+
<div className="p-3 space-y-2.5">
8787
{/* Top Themes */}
8888
<div>
89-
<h4 className="text-xs font-semibold text-[#6B7280] uppercase tracking-wider mb-2">
89+
<h4 className="text-[10px] font-semibold text-[#6B7280] uppercase tracking-wider mb-1">
9090
Top Themes
9191
</h4>
9292
{sentimentTopics.length > 0 ? (
93-
<ul className="space-y-1">
94-
{sentimentTopics.map((topic) => (
93+
<ul className="space-y-0.5">
94+
{sentimentTopics.slice(0, 3).map((topic) => (
9595
<li
9696
key={topic.id}
97-
className="text-sm text-[#1E3A5F] flex items-center gap-2"
97+
className="text-xs text-[#1E3A5F] flex items-center gap-1.5"
9898
>
99-
<span className="w-1.5 h-1.5 rounded-full bg-current opacity-40" />
99+
<span className="w-1 h-1 rounded-full bg-current opacity-40" />
100100
<span className="truncate">{topic.phrase || topic.name}</span>
101-
<span className="text-xs text-[#6B7280] ml-auto">
101+
<span className="text-[10px] text-[#6B7280] ml-auto">
102102
{topic.mention_count}
103103
</span>
104104
</li>
105105
))}
106106
</ul>
107107
) : (
108-
<p className="text-sm text-[#6B7280] italic">No topics detected</p>
108+
<p className="text-xs text-[#6B7280] italic">No topics</p>
109109
)}
110110
</div>
111111

112112
{/* Evidence */}
113113
<div>
114-
<h4 className="text-xs font-semibold text-[#6B7280] uppercase tracking-wider mb-2">
114+
<h4 className="text-[10px] font-semibold text-[#6B7280] uppercase tracking-wider mb-0.5">
115115
Evidence
116116
</h4>
117-
<p className="text-sm text-[#1E3A5F]">
118-
{commentCount} comments, {totalLikes.toLocaleString()} total likes
117+
<p className="text-xs text-[#1E3A5F]">
118+
{commentCount} comments, {totalLikes.toLocaleString()} likes
119119
</p>
120120
</div>
121121

122122
{/* Summary / Action */}
123123
<div>
124-
<h4 className="text-xs font-semibold text-[#6B7280] uppercase tracking-wider mb-2">
124+
<h4 className="text-[10px] font-semibold text-[#6B7280] uppercase tracking-wider mb-0.5">
125125
Summary
126126
</h4>
127127
{hasEnoughData && summary?.summary ? (
128-
<p className="text-sm text-[#1E3A5F] leading-relaxed">
128+
<p className="text-xs text-[#1E3A5F] leading-relaxed line-clamp-3">
129129
{summary.summary}
130130
</p>
131131
) : (
132-
<p className="text-sm text-[#6B7280] italic">
133-
{hasEnoughData
134-
? "AI summary unavailable"
135-
: "Not enough data for a reliable summary (need 5+ comments)"}
132+
<p className="text-xs text-[#6B7280] italic">
133+
{hasEnoughData ? "AI summary unavailable" : "Need 5+ comments"}
136134
</p>
137135
)}
138136
</div>

src/components/layout/video-header.tsx

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ export function VideoHeader({
5454
};
5555

5656
return (
57-
<div className="flex items-center gap-4 rounded-lg border bg-white p-3">
57+
<div className="flex items-center gap-3 rounded-md border bg-white p-2">
5858
{/* Thumbnail */}
5959
{video.thumbnail_url ? (
6060
<a
@@ -66,46 +66,46 @@ export function VideoHeader({
6666
<img
6767
src={video.thumbnail_url}
6868
alt={video.title}
69-
className="h-14 w-24 rounded object-cover"
69+
className="h-10 w-18 rounded object-cover"
7070
/>
7171
<div className="absolute inset-0 rounded bg-black/0 group-hover:bg-black/20 transition-colors flex items-center justify-center">
72-
<ExternalLink className="h-4 w-4 text-white opacity-0 group-hover:opacity-100 transition-opacity" />
72+
<ExternalLink className="h-3 w-3 text-white opacity-0 group-hover:opacity-100 transition-opacity" />
7373
</div>
7474
</a>
7575
) : (
76-
<div className="h-14 w-24 rounded bg-slate-100 flex-shrink-0" />
76+
<div className="h-10 w-18 rounded bg-slate-100 flex-shrink-0" />
7777
)}
7878

7979
{/* Video Info */}
8080
<div className="flex-1 min-w-0">
81-
<h1 className="font-semibold text-sm truncate leading-tight">
81+
<h1 className="font-semibold text-xs truncate leading-tight">
8282
{video.title}
8383
</h1>
84-
<div className="flex items-center gap-3 mt-1">
84+
<div className="flex items-center gap-2 mt-0.5">
8585
{video.channel_title && (
86-
<div className="flex items-center gap-1 text-xs text-muted-foreground">
87-
<User className="h-3 w-3" />
88-
<span className="truncate max-w-[150px]">{video.channel_title}</span>
86+
<div className="flex items-center gap-1 text-[10px] text-muted-foreground">
87+
<User className="h-2.5 w-2.5" />
88+
<span className="truncate max-w-[120px]">{video.channel_title}</span>
8989
</div>
9090
)}
9191
{video.published_at && (
92-
<div className="flex items-center gap-1 text-xs text-muted-foreground">
93-
<Calendar className="h-3 w-3" />
92+
<div className="flex items-center gap-1 text-[10px] text-muted-foreground">
93+
<Calendar className="h-2.5 w-2.5" />
9494
<span>{new Date(video.published_at).toLocaleDateString()}</span>
9595
</div>
9696
)}
9797
</div>
9898
</div>
9999

100100
{/* Stats Badges */}
101-
<div className="flex items-center gap-2 flex-shrink-0">
102-
<Badge variant="secondary" className="gap-1.5 text-xs font-medium">
103-
<MessageSquare className="h-3 w-3" />
104-
{totalComments.toLocaleString()} comments
101+
<div className="flex items-center gap-1.5 flex-shrink-0">
102+
<Badge variant="secondary" className="gap-1 text-[10px] font-medium px-2 py-0.5">
103+
<MessageSquare className="h-2.5 w-2.5" />
104+
{totalComments.toLocaleString()}
105105
</Badge>
106106
{analyzedAt && (
107-
<Badge variant="outline" className="text-xs font-normal text-muted-foreground">
108-
Analyzed {formatDate(analyzedAt)}
107+
<Badge variant="outline" className="text-[10px] font-normal text-muted-foreground px-2 py-0.5">
108+
{formatDate(analyzedAt)}
109109
</Badge>
110110
)}
111111
</div>

src/components/navigation/analysis-tabs.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ export function AnalysisTabs({ analysisId, className }: AnalysisTabsProps) {
4646
};
4747

4848
return (
49-
<div className={cn("border-b border-[#E8E4DC] bg-white", className)}>
49+
<div className={cn("border-b border-[#E8E4DC] bg-white flex-shrink-0", className)}>
5050
<nav className="flex gap-0 px-4" aria-label="Analysis tabs">
5151
{tabs.map((tab) => {
5252
const Icon = tab.icon;
@@ -57,7 +57,7 @@ export function AnalysisTabs({ analysisId, className }: AnalysisTabsProps) {
5757
key={tab.name}
5858
href={tab.href(analysisId)}
5959
className={cn(
60-
"flex items-center gap-2 px-4 py-3 text-sm font-medium border-b-2 transition-colors",
60+
"flex items-center gap-2 px-3 py-2 text-sm font-medium border-b-2 transition-colors",
6161
active
6262
? "border-[#D4714E] text-[#1E3A5F]"
6363
: "border-transparent text-[#6B7280] hover:text-[#1E3A5F] hover:border-[#E8E4DC]"

src/components/navigation/global-nav.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ export function GlobalNav({ className }: GlobalNavProps) {
1616
return (
1717
<nav
1818
className={cn(
19-
"h-14 border-b border-[#E8E4DC] bg-white px-4 flex items-center justify-between",
19+
"h-12 border-b border-[#E8E4DC] bg-white px-4 flex items-center justify-between flex-shrink-0",
2020
className
2121
)}
2222
>

0 commit comments

Comments
 (0)