From 900738ef1aa8e6ff7794a7cb1d2592627e995cd2 Mon Sep 17 00:00:00 2001 From: Tree Trunks <6ba22921d9dc2ad0aa6ecdf63787ddd24726e266d866da31af69f2e4e146ace5@buzz.block.builderlab.xyz> Date: Fri, 25 Sep 2026 18:03:56 -0700 Subject: [PATCH 1/9] Polish top bar and animate contextual sidebar toggle Co-authored-by: Peppermint Butler <29b529ff43be424db89f51bff58a38cf86942acbffff98a14ce50b38c2a57d8f@buzz.block.builderlab.xyz> Signed-off-by: Tree Trunks <6ba22921d9dc2ad0aa6ecdf63787ddd24726e266d866da31af69f2e4e146ace5@buzz.block.builderlab.xyz> --- src/app/shell/AppShell.tsx | 51 +++++++++++- src/app/shell/NavigationControls.tsx | 2 +- src/app/shell/PanelLaunchers.tsx | 2 +- src/app/shell/ProfileButton.module.css | 17 ++++ src/app/shell/ProfileButton.tsx | 2 +- src/shared/styles/globals.css | 63 ++++++++++++++- tests/browser/sidenav-polish.spec.mjs | 108 +++++++++++++++++++++++++ 7 files changed, 236 insertions(+), 9 deletions(-) diff --git a/src/app/shell/AppShell.tsx b/src/app/shell/AppShell.tsx index 2a6f19d4f..f79f8ca15 100644 --- a/src/app/shell/AppShell.tsx +++ b/src/app/shell/AppShell.tsx @@ -1,5 +1,11 @@ import { NavigationItem } from "../../shared/design-system/ui/NavigationItem"; -import { useEffect, useRef, useState, type ReactNode } from "react"; +import { + useEffect, + useLayoutEffect, + useRef, + useState, + type ReactNode, +} from "react"; import { IconButton } from "../../shared/design-system/ui/IconButton"; import { SidebarIcon } from "../../shared/design-system/icons"; import { Panel } from "../../shared/design-system/ui/Panel"; @@ -49,6 +55,26 @@ export function AppShell({ children: ReactNode; }) { const fillsWorkspace = workspace || selected === "settings"; + const channelsNavigation = + selected === "buzz.channels/channels" || selected === "buzz.agents/agents"; + const [sidebarOpen, setSidebarOpen] = useState(true); + const sidebarNavigation = useRef(null); + useLayoutEffect(() => { + if (!channelsNavigation || !sidebarNavigation.current) return; + const navigation = sidebarNavigation.current; + const sidebar = navigation.querySelector(".shell-sidebar"); + if (!sidebar) return; + const updateWidth = () => { + navigation.style.setProperty( + "--shell-navigation-width", + `${sidebar.getBoundingClientRect().width}px`, + ); + }; + updateWidth(); + const observer = new ResizeObserver(updateWidth); + observer.observe(sidebar); + return () => observer.disconnect(); + }, [channelsNavigation]); const [navigationOpen, setNavigationOpen] = useState(false); const navigationToggle = useRef(null); useEffect(() => { @@ -103,6 +129,23 @@ export function AppShell({ data-tauri-drag-region={macDesktop ? undefined : true} {...titleBarDragProps} > + {channelsNavigation && ( + setSidebarOpen((open) => !open)} + icon={