Skip to content

Commit d73c22e

Browse files
notification dot
1 parent 358f6ba commit d73c22e

7 files changed

Lines changed: 50 additions & 528 deletions

File tree

packages/web/src/app/(app)/agents/page.tsx

Lines changed: 0 additions & 69 deletions
This file was deleted.

packages/web/src/app/(app)/components/appSidebar/index.tsx

Lines changed: 24 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -30,23 +30,25 @@ import { usePathname } from "next/navigation";
3030
import posthog from "posthog-js";
3131
import { useEffect, useRef, useState } from "react";
3232
import { AppearanceDropdownMenuGroup } from "../appearanceDropdownMenuGroup";
33+
import { NotificationDot } from "../notificationDot";
3334
import { ChatHistoryItem, ChatHistorySidebarGroup } from "./chatHistorySidebarGroup";
3435
import { useSidebarOverride } from "./sidebarOverrideContext";
3536

36-
const items = [
37-
{ title: "Code Search", href: "/search", icon: SearchIcon },
38-
{ title: "Ask", href: "/chat", icon: MessageCircleIcon },
39-
{ title: "Chats", href: "/chats", icon: MessagesSquareIcon },
40-
{ title: "Repositories", href: "/repos", icon: BookMarkedIcon },
41-
{ title: "Settings", href: "/settings", icon: SettingsIcon },
37+
const baseItems = [
38+
{ title: "Code Search", href: "/search", icon: SearchIcon, key: "search" },
39+
{ title: "Ask", href: "/chat", icon: MessageCircleIcon, key: "chat" },
40+
{ title: "Chats", href: "/chats", icon: MessagesSquareIcon, key: "chats" },
41+
{ title: "Repositories", href: "/repos", icon: BookMarkedIcon, key: "repos" },
42+
{ title: "Settings", href: "/settings", icon: SettingsIcon, key: "settings" },
4243
];
4344

4445
interface AppSidebarProps {
4546
session: Session | null;
4647
chatHistory: ChatHistoryItem[];
48+
isSettingsNotificationVisible?: boolean;
4749
}
4850

49-
export function AppSidebar({ session, chatHistory }: AppSidebarProps) {
51+
export function AppSidebar({ session, chatHistory, isSettingsNotificationVisible }: AppSidebarProps) {
5052
const pathname = usePathname();
5153
const [isScrolled, setIsScrolled] = useState(false);
5254
const contentRef = useRef<HTMLDivElement>(null);
@@ -91,16 +93,21 @@ export function AppSidebar({ session, chatHistory }: AppSidebarProps) {
9193
</Link>
9294
{hasOverride ? sidebarOverride.override?.header : (
9395
<SidebarMenu>
94-
{items.map((item) => (
95-
<SidebarMenuItem key={item.title}>
96-
<SidebarMenuButton asChild isActive={isActive(item.href)}>
97-
<a href={item.href}>
98-
<item.icon />
99-
<span>{item.title}</span>
100-
</a>
101-
</SidebarMenuButton>
102-
</SidebarMenuItem>
103-
))}
96+
{baseItems.map((item) => {
97+
const showNotification =
98+
(item.key === "settings" && isSettingsNotificationVisible);
99+
return (
100+
<SidebarMenuItem key={item.title}>
101+
<SidebarMenuButton asChild isActive={isActive(item.href)}>
102+
<a href={item.href}>
103+
<item.icon />
104+
<span>{item.title}</span>
105+
{showNotification && <NotificationDot className="ml-1.5" />}
106+
</a>
107+
</SidebarMenuButton>
108+
</SidebarMenuItem>
109+
);
110+
})}
104111
</SidebarMenu>
105112
)}
106113
</SidebarHeader>

packages/web/src/app/(app)/components/navigationMenu/index.tsx

Lines changed: 0 additions & 143 deletions
This file was deleted.

packages/web/src/app/(app)/components/navigationMenu/navigationItems.tsx

Lines changed: 0 additions & 89 deletions
This file was deleted.

0 commit comments

Comments
 (0)