diff --git a/frontend/src/App.tsx b/frontend/src/App.tsx index 4fe8a1a..6c2ee71 100644 --- a/frontend/src/App.tsx +++ b/frontend/src/App.tsx @@ -2222,10 +2222,37 @@ function App() { const sidebarDragRef = React.useRef<{ startX: number, startWidth: number } | null>(null); const rafRef = React.useRef(null); const ghostRef = React.useRef(null); + const sidebarDragBodyStyleRef = React.useRef<{ cursor: string; userSelect: string; webkitUserSelect: string } | null>(null); const latestMouseX = React.useRef(0); // Store latest mouse position + const sidebarResizeHandleWidth = Math.max(16, Math.round(16 * effectiveUiScale)); + + const restoreSidebarDragBodyStyles = () => { + if (!sidebarDragBodyStyleRef.current || typeof document === 'undefined') { + sidebarDragBodyStyleRef.current = null; + return; + } + + const previous = sidebarDragBodyStyleRef.current; + document.body.style.cursor = previous.cursor; + document.body.style.userSelect = previous.userSelect; + (document.body.style as any).WebkitUserSelect = previous.webkitUserSelect; + sidebarDragBodyStyleRef.current = null; + }; const handleSidebarMouseDown = (e: React.MouseEvent) => { e.preventDefault(); + e.stopPropagation(); + + if (typeof document !== 'undefined') { + sidebarDragBodyStyleRef.current = { + cursor: document.body.style.cursor, + userSelect: document.body.style.userSelect, + webkitUserSelect: (document.body.style as any).WebkitUserSelect || '', + }; + document.body.style.cursor = 'col-resize'; + document.body.style.userSelect = 'none'; + (document.body.style as any).WebkitUserSelect = 'none'; + } if (ghostRef.current) { ghostRef.current.style.left = `${sidebarWidth}px`; @@ -2271,6 +2298,7 @@ function App() { if (ghostRef.current) { ghostRef.current.style.display = 'none'; } + restoreSidebarDragBodyStyles(); sidebarDragRef.current = null; document.removeEventListener('mousemove', handleSidebarMouseMove); @@ -2666,7 +2694,7 @@ function App() { -
+
@@ -2704,6 +2732,25 @@ function App() {
)} +
{/* Floating SQL Log Toggle */} @@ -2743,22 +2790,6 @@ function App() { - - {/* Sidebar Resize Handle */} -
{securityUpdateEntryVisibility.showBanner && !isSecurityUpdateBannerDismissed && (