Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions components/brain/left-sidebar/web/WebLeftSidebar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ import React, { useRef } from "react";
import WebBrainLeftSidebarWaves from "./WebBrainLeftSidebarWaves";
import WebDirectMessagesList from "./WebDirectMessagesList";
import { usePathname } from "next/navigation";
import { useSidebarState } from "../../../../hooks/useSidebarState";
import { ChevronDoubleRightIcon } from "@heroicons/react/24/outline";
Comment thread
ragnep marked this conversation as resolved.

/**
* WebLeftSidebar
Expand All @@ -24,9 +26,13 @@ const WebLeftSidebar: React.FC<WebLeftSidebarProps> = ({
}) => {
const scrollContainerRef = useRef<HTMLDivElement>(null);
const pathname = usePathname();
const { closeRightSidebar } = useSidebarState();

// Determine content type based on current route/context - WEB SPECIFIC LOGIC
const isMessagesView = pathname?.startsWith("/messages");
const expandLabel = isMessagesView
? "Expand messages panel"
: "Expand waves panel";

return (
<div
Expand All @@ -41,6 +47,23 @@ const WebLeftSidebar: React.FC<WebLeftSidebarProps> = ({
}`}
style={{ minHeight: "100%" }}
>
{isCollapsed && (
<div className="tw-sticky tw-top-2 tw-z-20 tw-flex tw-justify-center tw-py-2">
<button
type="button"
onClick={closeRightSidebar}
onMouseDown={(event) => event.preventDefault()}
aria-label={expandLabel}
title={expandLabel}
className="desktop-hover:hover:tw-border-iron-600 desktop-hover:hover:tw-bg-iron-700 desktop-hover:hover:tw-shadow-[0_16px_34px_rgba(0,0,0,0.4)] tw-border-iron-700 tw-bg-iron-800 tw-shadow-[0_12px_28px_rgba(0,0,0,0.35)] tw-flex tw-items-center tw-justify-center tw-border tw-border-solid tw-h-6 tw-w-6 tw-rounded-lg"
>
<ChevronDoubleRightIcon
strokeWidth={2}
className="tw-h-4 tw-w-4 tw-flex-shrink-0 tw-text-iron-200 group-hover:desktop-hover:hover:tw-text-white tw-transition-all tw-duration-300 tw-ease-in-out"
/>
</button>
</div>
)}
{!isMessagesView && (
<WebBrainLeftSidebarWaves
scrollContainerRef={scrollContainerRef}
Expand Down
Loading