From 4bff9b39f3e84d3dbfd5db88a74a8306caab33a1 Mon Sep 17 00:00:00 2001 From: Ross Date: Mon, 22 Sep 2025 09:41:03 +0100 Subject: [PATCH] Add toggle functionality for top stack bar visibility and persistent button to reveal it --- dicom-viewer/src/App.tsx | 86 ++++++++++++++++++++++++++++++---------- 1 file changed, 64 insertions(+), 22 deletions(-) diff --git a/dicom-viewer/src/App.tsx b/dicom-viewer/src/App.tsx index 1a41d0d..d09206e 100644 --- a/dicom-viewer/src/App.tsx +++ b/dicom-viewer/src/App.tsx @@ -173,6 +173,8 @@ function App({ container_id, imageStacks, autoCacheStack, annotationJson, viewer const [presetsOpen, setPresetsOpen] = useState(false); const [settingsOpen, setSettingsOpen] = useState(false); + // Control visibility of the global top stack bar (hidden by default) + const [topBarVisible, setTopBarVisible] = useState(false); const [fullscreenHoverIdx, setFullscreenHoverIdx] = useState(null); const [openDropdownIdx, setOpenDropdownIdx] = useState(null); @@ -2983,27 +2985,45 @@ function App({ container_id, imageStacks, autoCacheStack, annotationJson, viewer )} - {/* Top bar stack browser */} -
+ {/* Top bar stack browser (hidden by default) */} +
+ + + {topBarVisible && ( +
{/* Group stacks by studyId or studyInstanceUID or 'Unspecified' */} {(() => { const groups: Record = {}; @@ -3063,9 +3083,31 @@ function App({ container_id, imageStacks, autoCacheStack, annotationJson, viewer
)); })()} +
+ )}
+ {/* Persistent floating button to reveal the stack bar */} + -
+
{/* Side menu toggle button */}