@@ -11,6 +11,7 @@ import { cn } from "~/lib/utils";
1111
1212import type { ThreadPanelPresentation } from "../../rightPanelLayout" ;
1313import { PopoverCreateHandle , PopoverTrigger } from "../ui/popover" ;
14+ import { useMobileSidebarSheetMounted } from "../ui/sidebar" ;
1415import { Toggle } from "../ui/toggle" ;
1516import { Tooltip , TooltipPopup , TooltipTrigger } from "../ui/tooltip" ;
1617
@@ -171,9 +172,13 @@ export const RightPanelMaximizeControl = memo(function RightPanelMaximizeControl
171172
172173/** The thread panel toggle on a header whose right side the inline right panel covers. */
173174export function ThreadPanelHeaderControl ( props : PanelLayoutControlsProps ) {
175+ const mobileSidebarSheetMounted = useMobileSidebarSheetMounted ( ) ;
174176 return (
175177 < div
176- className = "absolute top-[var(--workspace-controls-top)] right-[calc(env(safe-area-inset-right)+0.75rem)] z-50 flex h-[var(--workspace-topbar-height)] items-center [-webkit-app-region:no-drag]"
178+ className = { cn (
179+ "absolute top-[var(--workspace-controls-top)] right-[calc(env(safe-area-inset-right)+0.75rem)] z-50 flex h-[var(--workspace-topbar-height)] items-center [-webkit-app-region:no-drag]" ,
180+ mobileSidebarSheetMounted && "hidden" ,
181+ ) }
177182 data-workspace-titlebar-controls
178183 >
179184 < PanelLayoutControls { ...props } showTerminalControl = { false } showRightPanelControl = { false } />
@@ -190,9 +195,13 @@ export function WorkspaceTitlebarControls(props: {
190195 readonly onToggleMaximized : ( ) => void ;
191196 readonly children : ReactNode ;
192197} ) {
198+ const mobileSidebarSheetMounted = useMobileSidebarSheetMounted ( ) ;
193199 return (
194200 < div
195- className = "pointer-events-none fixed top-[var(--workspace-controls-top)] right-[var(--workspace-controls-right)] z-50 mr-px flex h-[var(--workspace-topbar-height)] items-center gap-1 [-webkit-app-region:no-drag]"
201+ className = { cn (
202+ "pointer-events-none fixed top-[var(--workspace-controls-top)] right-[var(--workspace-controls-right)] z-50 mr-px flex h-[var(--workspace-topbar-height)] items-center gap-1 [-webkit-app-region:no-drag]" ,
203+ mobileSidebarSheetMounted && "hidden" ,
204+ ) }
196205 data-workspace-titlebar-controls
197206 >
198207 { props . showMaximizeControl ? (
0 commit comments