Skip to content

Commit 769019d

Browse files
committed
[BLD-242] Dashboard: Fix Notification overflow, UI Improvements (#7985)
<!-- ## title your PR with this format: "[SDK/Dashboard/Portal] Feature/Fix: Concise title for the changes" If you did not copy the branch name from Linear, paste the issue tag here (format is TEAM-0000): ## Notes for the reviewer Anything important to call out? Be sure to also clarify these in your comments. ## How to test Unit tests, playground, etc. --> <!-- start pr-codex --> --- ## PR-Codex overview This PR focuses on enhancing the UI of the notification components in the dashboard. It includes updates to layout, spacing, and styles, improving the overall user experience and visual consistency. ### Detailed summary - Updated `PopoverContent` with new dimensions and layout. - Enhanced `NotificationList` with improved tab spacing and structure. - Adjusted styles for empty state messages in `InboxTab` and `ArchiveTab`. - Modified `NotificationEntry` layout and added icons for better aesthetics. - Changed button styles and interactions for improved usability. > ✨ Ask PR-Codex anything about this PR by commenting with `/codex {your question}` <!-- end pr-codex --> <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **Style** * Refreshed Notifications panel: larger, rounded popover with improved spacing, overflow handling, and updated alignment. * Redesigned notification items: bell capsule indicator, clearer card-like layout, hover-revealed “Mark as read,” and an outline CTA with arrow icon. * Improved list layout: flexible, smoother scrolling, simplified tab styling, and refined spacing. * Enhanced empty states for Inbox and Archive with centered, card-style icon visuals. * **Refactor** * Reorganized component layouts for consistency and responsiveness without changing behavior or public APIs. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
1 parent 488a3af commit 769019d

File tree

3 files changed

+39
-29
lines changed

3 files changed

+39
-29
lines changed

apps/dashboard/src/@/components/notifications/notification-button.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,8 @@ export function NotificationsButton(props: { accountId: string }) {
5656
<PopoverTrigger asChild>{trigger}</PopoverTrigger>
5757
<PopoverContent
5858
align="end"
59-
className="max-h-[90vh] min-h-[500px] w-[400px] max-w-md p-0"
59+
sideOffset={8}
60+
className="max-h-[90vh] min-h-[550px] w-[450px] max-w-md p-0 flex flex-col rounded-xl overflow-hidden"
6061
>
6162
<NotificationList {...manager} />
6263
</PopoverContent>

apps/dashboard/src/@/components/notifications/notification-entry.tsx

Lines changed: 26 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import {
77
parseISO,
88
subDays,
99
} from "date-fns";
10-
import { ArchiveIcon } from "lucide-react";
10+
import { ArchiveIcon, ArrowUpRightIcon, BellIcon } from "lucide-react";
1111
import { useMemo } from "react";
1212
import type { Notification } from "@/api/notifications";
1313
import { Button } from "@/components/ui/button";
@@ -42,39 +42,48 @@ export function NotificationEntry({
4242
}, [notification.createdAt]);
4343

4444
return (
45-
<div className="flex flex-row py-1.5">
46-
{onMarkAsRead && (
47-
<div className="min-h-full w-1 shrink-0 rounded-r-lg bg-primary" />
48-
)}
49-
<div className="flex w-full flex-row justify-between gap-2 border-b px-4 py-2 transition-colors last:border-b-0">
45+
<div className="flex items-start gap-3 p-4 border-b group hover:bg-card last:border-b-0">
46+
<div className="p-2.5 rounded-full border bg-card">
47+
<BellIcon className="size-4 text-muted-foreground" />
48+
</div>
49+
<div className="flex w-full flex-row justify-between gap-2 transition-colors">
5050
<div className="flex items-start gap-3">
51-
<div className="flex-1 space-y-1">
51+
<div className="flex-1 space-y-1.5">
5252
<p className="text-sm">{notification.description}</p>
5353
{timeAgo && (
5454
<p className="text-muted-foreground text-xs">{timeAgo}</p>
5555
)}
56-
<div className="flex flex-row justify-between gap-2 pt-1">
57-
<Button asChild className="px-0" size="sm" variant="link">
56+
<div className="flex flex-row justify-between gap-2 pt-2">
57+
<Button
58+
asChild
59+
size="sm"
60+
variant="outline"
61+
className="rounded-full bg-card gap-2"
62+
>
5863
<a
5964
href={notification.ctaUrl}
6065
rel="noopener noreferrer"
6166
target="_blank"
6267
>
6368
{notification.ctaText}
69+
<ArrowUpRightIcon className="size-4 text-muted-foreground" />
6470
</a>
6571
</Button>
6672
</div>
6773
</div>
6874
</div>
6975
{onMarkAsRead && (
70-
<Button
71-
className="text-muted-foreground hover:text-foreground"
72-
onClick={() => onMarkAsRead(notification.id)}
73-
size="icon"
74-
variant="ghost"
75-
>
76-
<ArchiveIcon className="h-4 w-4" />
77-
</Button>
76+
<div className="flex items-center">
77+
<Button
78+
className="p-2 h-auto opacity-0 group-hover:opacity-100 rounded-full text-muted-foreground hover:text-foreground"
79+
onClick={() => onMarkAsRead(notification.id)}
80+
size="sm"
81+
variant="ghost"
82+
aria-label="Archive notification"
83+
>
84+
<ArchiveIcon className="size-4" />
85+
</Button>
86+
</div>
7887
)}
7988
</div>
8089
</div>

apps/dashboard/src/@/components/notifications/notification-list.tsx

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -21,15 +21,15 @@ export function NotificationList(props: ReturnType<typeof useNotifications>) {
2121
const scrollContainerRef = useRef<HTMLDivElement>(null);
2222

2323
return (
24-
<div className="flex w-full flex-1 flex-col">
24+
<div className="flex flex-col overflow-hidden grow">
2525
<TabButtons
26-
tabClassName="!text-sm hover:!bg-transparent !px-0 !py-1"
27-
tabContainerClassName="space-x-6 px-4 pt-2"
26+
tabClassName="hover:bg-transparent"
27+
tabContainerClassName="pt-1.5 px-4"
2828
tabs={[
2929
{
3030
isActive: activeTab === "inbox",
3131
name: (
32-
<div className="flex items-center gap-1">
32+
<div className="flex items-center gap-2">
3333
Inbox
3434
{props.unreadNotificationsCount > 0 && (
3535
<Badge variant="secondary">
@@ -49,7 +49,7 @@ export function NotificationList(props: ReturnType<typeof useNotifications>) {
4949
/>
5050

5151
<div
52-
className="h-full w-full flex-1 overflow-y-auto"
52+
className="flex-1 overflow-y-auto overscroll-contain flex flex-col grow"
5353
ref={scrollContainerRef}
5454
>
5555
{activeTab === "inbox" ? (
@@ -93,9 +93,9 @@ function InboxTab(
9393
},
9494
) {
9595
return props.unreadNotifications.length === 0 ? (
96-
<div className="flex h-full flex-col items-center justify-center gap-4 p-8 text-center">
97-
<div className="flex h-10 w-10 items-center justify-center rounded-full bg-muted">
98-
<BellIcon className="h-4 w-4 text-muted-foreground" />
96+
<div className="flex grow flex-col items-center justify-center gap-4 p-4 text-center">
97+
<div className="p-2 bg-card rounded-full border">
98+
<BellIcon className="size-5 text-muted-foreground" />
9999
</div>
100100
<p className="text-muted-foreground text-sm">No new notifications</p>
101101
</div>
@@ -131,9 +131,9 @@ function ArchiveTab(
131131
},
132132
) {
133133
return props.archivedNotifications.length === 0 ? (
134-
<div className="flex flex-col items-center justify-center gap-4 p-8 text-center">
135-
<div className="flex h-10 w-10 items-center justify-center rounded-full bg-muted">
136-
<ArchiveIcon className="h-4 w-4 text-muted-foreground" />
134+
<div className="flex grow flex-col items-center justify-center gap-4 p-4 text-center">
135+
<div className="p-2 bg-card rounded-full border">
136+
<ArchiveIcon className="size-5 text-muted-foreground" />
137137
</div>
138138
<p className="text-muted-foreground text-sm">No archived notifications</p>
139139
</div>

0 commit comments

Comments
 (0)