diff --git a/desktop/src/components/layout/Sidebar.test.tsx b/desktop/src/components/layout/Sidebar.test.tsx index 5fe96033..55fdc2b8 100644 --- a/desktop/src/components/layout/Sidebar.test.tsx +++ b/desktop/src/components/layout/Sidebar.test.tsx @@ -255,6 +255,7 @@ describe('Sidebar', () => { ]) expect(useTabStore.getState().activeTabId).toBe('session-new-1') expect(screen.getByRole('complementary')).not.toHaveAttribute('data-desktop-drag-region') + expect(screen.getByTestId('sidebar-title-region')).toHaveAttribute('data-desktop-drag-region') }) it('groups sessions by project and expands overflow rows', () => { diff --git a/desktop/src/components/layout/Sidebar.tsx b/desktop/src/components/layout/Sidebar.tsx index d41ad1fb..1a6bc7e5 100644 --- a/desktop/src/components/layout/Sidebar.tsx +++ b/desktop/src/components/layout/Sidebar.tsx @@ -15,7 +15,6 @@ import { publicAssetPath } from '../../lib/publicAsset' const desktopHost = getDesktopHost() const isDesktopRuntime = desktopHost.isDesktop const canUseNativeDialogs = desktopHost.capabilities.dialogs -const canStartWindowDragging = desktopHost.capabilities.windowControls const isWindows = typeof navigator !== 'undefined' && /Win/.test(navigator.platform) const SESSION_LIST_AUTO_REFRESH_MS = 30_000 const SESSION_LIST_FOCUS_REFRESH_MIN_MS = 5_000 @@ -575,19 +574,6 @@ export function Sidebar({ isMobile = false, onRequestClose }: SidebarProps) { setRenameValue('') }, [renamingId, renameValue, renameSession]) - const startDraggingRef = useRef<(() => Promise) | null>(null) - - useEffect(() => { - if (!canStartWindowDragging) return - startDraggingRef.current = () => getDesktopHost().window.startDragging() - }, []) - - const handleSidebarDrag = useCallback((e: React.MouseEvent) => { - if (e.button !== 0) return - if ((e.target as HTMLElement).closest('button, input, textarea, select, a, [role="button"]')) return - startDraggingRef.current?.() - }, []) - useEffect(() => { if (!isBatchMode) return @@ -611,12 +597,15 @@ export function Sidebar({ isMobile = false, onRequestClose }: SidebarProps) { return (