diff --git a/apps/web/src/components/AppSidebarLayout.tsx b/apps/web/src/components/AppSidebarLayout.tsx index 98d108cf37fdd..ce576778990e4 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,18 @@ 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 +384,7 @@ export function AppSidebarLayout({ children }: { children: ReactNode }) { {children} - + diff --git a/run-t3.md b/run-t3.md index 8a85a207d6a67..ea655bf87dca9 100644 --- a/run-t3.md +++ b/run-t3.md @@ -56,7 +56,7 @@ This copy differs from upstream T3 Code in the points below. Keep this list curr - Whiteboard skills for agents. `T3CODE_CLAUDE_PLUGIN_ROOT` is loaded as a local Claude plugin; `T3CODE_CODEX_SKILL_ROOT` is registered with each Codex app-server through `skills/extraRoots/set`. Files: `apps/server/src/orchestration-v2/Adapters/ClaudeAdapterV2.ts` (`makeClaudeQueryOptions`, with test), `CodexAdapterV2.ts` (after `initialize`), `apps/server/src/provider/codexLaunchArgs.ts` (`resolveCodexSkillRoot`), `apps/server/src/provider/CodexProvider.ts` (probe client). `run-t3.sh` sets both variables, puts `tools/bin` on `PATH`, and sets `BASH_ENV` to `tools/agent-env.sh`. - Served under `/chat/`. Files: `apps/web/vite.config.ts` (`base: "/chat/"`), `apps/web/src/router.ts` (`basepath: "/chat"`). - Whiteboard links. `board://` links in assistant markdown are allowed, rendered with hover and click messages to the parent window (`wb-hover`, `wb-highlight`), and `[label](board://...)` mention chips in the composer show the label and report hover. Files: `apps/web/src/markdown-whiteboard.ts` (with test), `apps/web/src/components/ChatMarkdown.tsx`, `packages/shared/src/markdownPipeline.ts` (`board` href protocol), `apps/web/src/components/ComposerPromptEditorTiptap.tsx`, `packages/shared/src/composerInlineTokens.ts` (board mention token). -- Parent-window messages. The chat posts `wb-project` (workspace root and thread key) when the active thread changes, and inserts a reference into the composer on a `wb-insert-ref` message. The composer never switches to its mobile layout inside the iframe. Files: `apps/web/src/components/ChatView.tsx`, `apps/web/src/components/chat/ChatComposer.tsx`. +- Parent-window messages. The chat posts `wb-project` (workspace root and thread key) when the active thread changes, inserts a reference into the composer on a `wb-insert-ref` message, and follows the board panel's state: it asks with `wb-layout-get`, the parent answers with `wb-layout` (`boardHidden`), and while the board is collapsed a Board button before the sidebar trigger posts `wb-show-board`. The composer never switches to its mobile layout inside the iframe. Files: `apps/web/src/components/ChatView.tsx`, `apps/web/src/components/chat/ChatComposer.tsx`, `apps/web/src/components/AppSidebarLayout.tsx` (Board button). - Iframe layout. The sidebar starts closed, and neither the provider-update launch notification nor the nightly mobile beta notice is rendered. Files: `apps/web/src/components/AppSidebarLayout.tsx`, `apps/web/src/routes/__root.tsx`. - Light by default. Without a stored theme preference the chat starts light instead of following the OS appearance. Files: `apps/web/index.html` (boot script), `apps/web/src/hooks/useTheme.ts` (`DEFAULT_THEME_SNAPSHOT`), with the mirrored tests. - New-thread landing. `run-t3.sh` sets `T3CODE_AUTO_BOOTSTRAP_PROJECT_FROM_CWD=false` so each page load opens the new-thread page rather than the oldest thread of the project.