From 2f14631ad06e7ba8923dc213c24453a4c04054d5 Mon Sep 17 00:00:00 2001 From: Ross Date: Mon, 22 Sep 2025 11:26:30 +0100 Subject: [PATCH] Enhance right-side stack panel interaction with hover button and settings button adjustments --- dicom-viewer/src/App.tsx | 56 ++++++++++++++++++++++++++++++---------- 1 file changed, 42 insertions(+), 14 deletions(-) diff --git a/dicom-viewer/src/App.tsx b/dicom-viewer/src/App.tsx index 94b70f8..3cc717c 100644 --- a/dicom-viewer/src/App.tsx +++ b/dicom-viewer/src/App.tsx @@ -178,6 +178,7 @@ function App({ container_id, imageStacks, autoCacheStack, annotationJson, viewer // Right-side stack panel open state (toggled by button) const [stackPanelOpen, setStackPanelOpen] = useState(false); + const [showOpenButtonHover, setShowOpenButtonHover] = useState(false); const [fullscreenHoverIdx, setFullscreenHoverIdx] = useState(null); const [openDropdownIdx, setOpenDropdownIdx] = useState(null); @@ -2992,32 +2993,39 @@ function App({ container_id, imageStacks, autoCacheStack, annotationJson, viewer {/* Right-side stack panel is implemented in the main content flex container below */} - {/* Floating right-edge toggle — always visible so users can open the panel */} - {!stackPanelOpen && ( + {/* Right-edge hover strip to reveal open button */} +
{ if (!stackPanelOpen) setShowOpenButtonHover(true); }} + onMouseLeave={() => { if (!stackPanelOpen) setShowOpenButtonHover(false); }} + style={{ position: 'absolute', right: 0, top: 0, height: '100%', width: 56, zIndex: 2400, pointerEvents: stackPanelOpen ? 'none' : 'auto' }} + /> + + {/* Open button only visible when hover strip is active */} + {showOpenButtonHover && !stackPanelOpen && (
- {/* Right-side panel occupies layout space when visible or pinned */} -
+ {/* Right-side panel occupies layout space when visible; when closed width is 0 and it doesn't catch pointer events */} +
{/* Reuse the existing right-side panel markup but ensure pointerEvents are enabled inside */}
{/* Panel (same content as before) */} @@ -3498,7 +3526,7 @@ function App({ container_id, imageStacks, autoCacheStack, annotationJson, viewer position: "absolute", top: 8, left: sideMenuOpen ? 250 + 16 : 16, - zIndex: 2600, + zIndex: 2800, padding: "6px 12px", background: "#222", color: "#fff",