File tree Expand file tree Collapse file tree
packages/web/src/components/chat-room Expand file tree Collapse file tree Original file line number Diff line number Diff line change 33import { Archive , Loader2 , Pin , PinOff } from "lucide-react" ;
44import type { ReactElement } from "react" ;
55
6- import { Button } from "@/components/ui/button" ;
6+ import { Button , buttonVariants } from "@/components/ui/button" ;
77import {
88 Dialog ,
99 DialogClose ,
@@ -48,11 +48,13 @@ export function ChatRoomSessionRow({
4848 : "text-zinc-400" ,
4949 ) }
5050 >
51- < Button
52- className = "h-auto min-w-0 justify-start gap-2 pl-2 pr-0 py-2 text-left text-sm"
51+ < a
52+ className = { cn (
53+ buttonVariants ( { variant : "ghost" } ) ,
54+ "h-auto min-w-0 justify-start gap-2 pl-2 pr-0 py-2 text-left text-sm" ,
55+ ) }
56+ href = { `/session/${ encodeURIComponent ( session . id ) } ` }
5357 onClick = { ( ) => onSelectSession ( session . id ) }
54- type = "button"
55- variant = "ghost"
5658 >
5759 { isRunning ? (
5860 < span
@@ -68,7 +70,7 @@ export function ChatRoomSessionRow({
6870 { session . title }
6971 </ Typography >
7072 </ span >
71- </ Button >
73+ </ a >
7274 < Button
7375 aria-label = { pinLabel }
7476 aria-pressed = { isPinned }
Original file line number Diff line number Diff line change @@ -18,6 +18,7 @@ import {
1818 X ,
1919} from "lucide-react" ;
2020import Link from "next/link" ;
21+ import { usePathname } from "next/navigation" ;
2122import type { ComponentType , ReactElement } from "react" ;
2223
2324import { Button } from "@/components/ui/button" ;
@@ -48,6 +49,8 @@ export function ChatRoomSettingsSidebar({
4849 onClose,
4950 onNavigate,
5051} : ChatRoomSettingsSidebarProps ) : ReactElement {
52+ const pathname = usePathname ( ) ;
53+
5154 return (
5255 < div
5356 aria-hidden = { ! isActive }
@@ -90,7 +93,10 @@ export function ChatRoomSettingsSidebar({
9093 < div className = "grid gap-1" >
9194 { navItems . map ( ( item ) => {
9295 const Icon = iconByKey [ item . key ] ;
93- const isActiveItem = item . key === "chat" ;
96+ const isActiveItem =
97+ pathname === item . href ||
98+ pathname . startsWith ( `${ item . href } /` ) ||
99+ ( item . key === "chat" && pathname . startsWith ( "/session/" ) ) ;
94100 return (
95101 < Link
96102 aria-current = { isActiveItem ? "page" : undefined }
You can’t perform that action at this time.
0 commit comments