From 87b3da71180729834d17adc0eaf505497bc6e4a5 Mon Sep 17 00:00:00 2001 From: Renfei Zhou Date: Sat, 10 Oct 2026 11:26:07 +0000 Subject: [PATCH 1/2] Show a Board button when the whiteboard collapses its board panel Inside the whiteboard iframe, the parent page reports the split layout. While the board is collapsed, a Board button before the sidebar trigger asks the parent to restore the split. Co-Authored-By: Claude Opus 5.5 --- apps/web/src/components/AppSidebarLayout.tsx | 43 +++++++++++++++++++- 1 file changed, 41 insertions(+), 2 deletions(-) diff --git a/apps/web/src/components/AppSidebarLayout.tsx b/apps/web/src/components/AppSidebarLayout.tsx index 98d108cf37fdd..ca7aa4f792db4 100644 --- a/apps/web/src/components/AppSidebarLayout.tsx +++ b/apps/web/src/components/AppSidebarLayout.tsx @@ -8,6 +8,7 @@ import { type ReactNode, } from "react"; import { useLocation, useNavigate, useParams } from "@tanstack/react-router"; +import { PresentationIcon } from "lucide-react"; import { isElectron } from "../env"; import { getLocalStorageItem, removeLocalStorageItem } from "../hooks/useLocalStorage"; @@ -55,6 +56,7 @@ import { useSidebar, useSidebarVisibility, } from "./ui/sidebar"; +import { Button } from "./ui/button"; import { Tooltip, TooltipPopup, TooltipTrigger } from "./ui/tooltip"; const MACOS_TRAFFIC_LIGHTS_LEFT_INSET = "var(--desktop-window-controls-inset, 90px)"; @@ -80,7 +82,25 @@ function readInitialThreadSidebarWidth(): number { } } -function SidebarControl() { +// The whiteboard parent page reports whether its board panel is collapsed; asking on mount +// covers the report it sent before this listener existed. +function useWhiteboardBoardHidden() { + const [boardHidden, setBoardHidden] = useState(false); + useEffect(() => { + if (window.parent === window) return; + const receive = (event: MessageEvent) => { + if (event.source === window.parent && event.data?.type === "wb-layout") { + setBoardHidden(event.data.boardHidden === true); + } + }; + window.addEventListener("message", receive); + window.parent.postMessage({ type: "wb-layout-get" }, "*"); + return () => window.removeEventListener("message", receive); + }, []); + return boardHidden; +} + +function SidebarControl({ boardHidden }: { boardHidden: boolean }) { const usagePageOpen = useLocation({ select: (location) => location.pathname === "/usage" }); const keybindings = useAtomValue(primaryServerKeybindingsAtom); const { toggleSidebar } = useSidebar(); @@ -142,6 +162,17 @@ function SidebarControl() { className="pointer-events-none fixed left-[var(--workspace-controls-left)] top-[var(--workspace-controls-top)] z-50 ml-px flex h-[var(--workspace-topbar-height)] items-center" data-sidebar-control="" > + {boardHidden && ( + + )} { @@ -344,7 +383,7 @@ export function AppSidebarLayout({ children }: { children: ReactNode }) { {children} - + From 2d8fcc7c4b034c06ac693a51d8bb659afe09b183 Mon Sep 17 00:00:00 2001 From: Renfei Zhou Date: Sat, 10 Oct 2026 15:43:38 +0000 Subject: [PATCH 2/2] Keep Board button layout on a wrapper; record the board messages in run-t3.md Co-Authored-By: Claude Opus 5.5 --- apps/web/src/components/AppSidebarLayout.tsx | 19 ++++++++++--------- run-t3.md | 2 +- 2 files changed, 11 insertions(+), 10 deletions(-) diff --git a/apps/web/src/components/AppSidebarLayout.tsx b/apps/web/src/components/AppSidebarLayout.tsx index ca7aa4f792db4..ce576778990e4 100644 --- a/apps/web/src/components/AppSidebarLayout.tsx +++ b/apps/web/src/components/AppSidebarLayout.tsx @@ -163,15 +163,16 @@ function SidebarControl({ boardHidden }: { boardHidden: boolean }) { data-sidebar-control="" > {boardHidden && ( - +
+ +
)}