Add thumbnail image display for stacks and relocate settings button to viewport area
This commit is contained in:
+13
-20
@@ -3482,6 +3482,11 @@ function App({ container_id, imageStacks, autoCacheStack, annotationJson, viewer
|
|||||||
const count = imageIds.length;
|
const count = imageIds.length;
|
||||||
const invalid = !Array.isArray(imageIds) || count === 0;
|
const invalid = !Array.isArray(imageIds) || count === 0;
|
||||||
const isSelected = selectedStackIdx.includes(idx);
|
const isSelected = selectedStackIdx.includes(idx);
|
||||||
|
// Prefer the middle image for a representative thumbnail, fallback to first
|
||||||
|
const midIndex = Math.floor(imageIds.length / 2);
|
||||||
|
const chosenImage = imageIds[midIndex] || imageIds[0];
|
||||||
|
const thumbnailUrl = chosenImage ? (chosenImage.startsWith('wadouri:') ? chosenImage.slice(7) : chosenImage) : null;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div
|
<div
|
||||||
key={idx}
|
key={idx}
|
||||||
@@ -3503,10 +3508,17 @@ function App({ container_id, imageStacks, autoCacheStack, annotationJson, viewer
|
|||||||
cursor: invalid ? 'not-allowed' : 'pointer',
|
cursor: invalid ? 'not-allowed' : 'pointer',
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
|
<div style={{ display: 'flex', alignItems: 'center', gap: 8 }}>
|
||||||
|
{thumbnailUrl ? (
|
||||||
|
<img src={thumbnailUrl} alt={label} style={{ width: 56, height: 56, objectFit: 'cover', borderRadius: 4, background: '#111' }} />
|
||||||
|
) : (
|
||||||
|
<div style={{ width: 56, height: 56, borderRadius: 4, background: '#111', display: 'flex', alignItems: 'center', justifyContent: 'center', color: '#777' }}>No Img</div>
|
||||||
|
)}
|
||||||
<div style={{ display: 'flex', flexDirection: 'column' }}>
|
<div style={{ display: 'flex', flexDirection: 'column' }}>
|
||||||
<div style={{ fontWeight: 600 }}>{label}</div>
|
<div style={{ fontWeight: 600 }}>{label}</div>
|
||||||
<div style={{ fontSize: 12, opacity: 0.7 }}>{count} img{count === 1 ? '' : 's'}</div>
|
<div style={{ fontSize: 12, opacity: 0.7 }}>{count} img{count === 1 ? '' : 's'}</div>
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
<div style={{ fontSize: 12, opacity: 0.8 }}>{stack.studyId || ''}</div>
|
<div style={{ fontSize: 12, opacity: 0.8 }}>{stack.studyId || ''}</div>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
@@ -3520,26 +3532,7 @@ function App({ container_id, imageStacks, autoCacheStack, annotationJson, viewer
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
{/* Settings button at top-left (shift when side menu open) to avoid overlapping right-side controls */}
|
{/* duplicate Settings button removed; the Settings button is now placed inside the viewport area */}
|
||||||
<button
|
|
||||||
style={{
|
|
||||||
position: "absolute",
|
|
||||||
top: 8,
|
|
||||||
left: sideMenuOpen ? 250 + 16 : 16,
|
|
||||||
zIndex: 2800,
|
|
||||||
padding: "6px 12px",
|
|
||||||
background: "#222",
|
|
||||||
color: "#fff",
|
|
||||||
border: "none",
|
|
||||||
borderRadius: "4px",
|
|
||||||
cursor: "pointer",
|
|
||||||
opacity: 0.85,
|
|
||||||
userSelect: "none",
|
|
||||||
}}
|
|
||||||
onClick={() => setSettingsOpen(true)}
|
|
||||||
>
|
|
||||||
Settings
|
|
||||||
</button>
|
|
||||||
|
|
||||||
{/* Settings Modal (viewport-local, not fixed to page) */}
|
{/* Settings Modal (viewport-local, not fixed to page) */}
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user