From 215e884bdee5bbab7c763ba4e0ce29866bf550ca Mon Sep 17 00:00:00 2001 From: Guneev Pannu Date: Mon, 7 Sep 2026 14:26:54 -0400 Subject: [PATCH 1/5] Added a 3 state volume icon for browser notifications --- src/app/room/classChat/ChatHeader.tsx | 43 ++++++++++++++++++++++++++- src/app/room/classChat/index.tsx | 9 ++++++ src/app/room/page.tsx | 4 +-- 3 files changed, 53 insertions(+), 3 deletions(-) diff --git a/src/app/room/classChat/ChatHeader.tsx b/src/app/room/classChat/ChatHeader.tsx index 324267b..5301af3 100644 --- a/src/app/room/classChat/ChatHeader.tsx +++ b/src/app/room/classChat/ChatHeader.tsx @@ -2,7 +2,18 @@ import { Input } from "@/components/ui/input"; import { useContext, useState } from "react"; -import { PanelRightClose, Users, GraduationCap, Search, X, UserPlus, Undo2 } from "lucide-react"; +import { + PanelRightClose, + Users, + GraduationCap, + Search, + X, + UserPlus, + Undo2, + VolumeOff, + Volume2, + BellRing, +} from "lucide-react"; import ManageTAsModal from "./ManageTAsModal"; import { useMediaQuery } from "@/hooks/use-media-query"; import { SlideUpdateContext } from "../SlideUpdateContext"; @@ -15,6 +26,8 @@ const TITLE_MAX_CHARS = 6; interface ChatHeaderProps { role: Role; answerMode: "all" | "instructors_only"; + notificationMode: "off" | "sound" | "browser"; + onToggleNotificationMode: () => void; onToggleAnswerMode: () => void; searchQuery: string; onSearchChange: (value: string) => void; @@ -55,6 +68,8 @@ function SlideToggle() { export default function ChatHeader({ role, answerMode, + notificationMode, + onToggleNotificationMode, onToggleAnswerMode, searchQuery, onSearchChange, @@ -63,6 +78,24 @@ export default function ChatHeader({ const { isSlidesVisible } = useContext(SlideUpdateContext); const [isSearchExpanded, setIsSearchExpanded] = useState(false); const [showTAModal, setShowTAModal] = useState(false); + const notificationButton = + notificationMode === "off" + ? { + Icon: VolumeOff, + title: "Notifications off", + className: "bg-red-100 text-red-700 hover:bg-red-200", + } + : notificationMode === "sound" + ? { + Icon: Volume2, + title: "Beep notifications on", + className: "bg-stone-200 text-stone-600 hover:bg-stone-300", + } + : { + Icon: BellRing, + title: "Browser notifications on", + className: "bg-amber-100 text-amber-700 hover:bg-amber-200", + }; return ( <> @@ -126,6 +159,14 @@ export default function ChatHeader({
+