File tree Expand file tree Collapse file tree
apps/web/src/components/chat Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -19,6 +19,7 @@ import ProjectScriptsControl, { type NewProjectScriptInput } from "../ProjectScr
1919import { Toggle } from "../ui/toggle" ;
2020import { SidebarTrigger } from "../ui/sidebar" ;
2121import { OpenInPicker } from "./OpenInPicker" ;
22+ import { useCodeViewerStore } from "~/codeViewerStore" ;
2223import type { ClientMode } from "~/lib/clientMode" ;
2324
2425import type { PreviewDock } from "~/previewStateStore" ;
@@ -87,6 +88,7 @@ export const ChatHeader = memo(function ChatHeader({
8788 onToggleCodeViewer,
8889} : ChatHeaderProps ) {
8990 const isMobileCompanion = clientMode === "mobile" ;
91+ const hasCodeViewerTabs = useCodeViewerStore ( ( state ) => state . tabs . length > 0 ) ;
9092
9193 return (
9294 < div className = "flex min-w-0 flex-1 items-center gap-2" >
@@ -123,7 +125,7 @@ export const ChatHeader = memo(function ChatHeader({
123125 onImportScripts = { onImportProjectScripts }
124126 />
125127 ) }
126- { activeProjectName && < OpenInPicker onToggleCodeViewer = { onToggleCodeViewer } /> }
128+ { activeProjectName && hasCodeViewerTabs && < OpenInPicker onToggleCodeViewer = { onToggleCodeViewer } /> }
127129 { ! isMobileCompanion && activeProjectName && (
128130 < GitActionsControl gitCwd = { gitCwd } activeThreadId = { activeThreadId } />
129131 ) }
You can’t perform that action at this time.
0 commit comments