fix: improve slide-list overview preview sizing (#399) - #400
fix: improve slide-list overview preview sizing (#399)#400igoroctaviano wants to merge 5 commits into
Conversation
|
|
Overall Grade |
Security Reliability Complexity Hygiene |
Code Review Summary
| Analyzer | Status | Updated (UTC) | Details |
|---|---|---|---|
| JavaScript | Aug 6, 2026 10:37p.m. | Review ↗ |
Important
AI Review is run only on demand for your team. We're only showing results of static analysis review right now. To trigger AI Review, comment @deepsourcebot review on this thread.
|
Visit the preview URL for this PR (updated for commit 2681183): https://idc-external-006--pr400-fix-399-overview-siz-6kevhuiw.web.app (expires Thu, 13 Aug 2026 23:05:45 GMT) 🔥 via Firebase Hosting GitHub Action 🌎 Sign: 88aacecd98ba54d2f9c8d201a9444e43d1ad8307 |
Google Healthcare rejects fractional viewport=w,h (HTTP 400). Derive resizeFactor so cols*factor and rows*factor are integers; fall back to factor 1 when no integer downscale fits the slide-list tile.
|
@igoroctaviano this is how the second slide looks like right now... is this expected?
|
Yes, if it's a wide and low case. The heuristic is using the slide dimensions to make it easier to see the overview while navigating. I can set it to be fixed height and width if that makes sense too. |
|
I admit I do not know what is a good heuristic, but when overview has the same size as the actual image, I am not sure the heuristic is good. Why is wide-and-low taking entire width, but narrow-and-tall does not take the full height? But after all, it is not a big deal - I think this is better than what we had before, so let's merge and refine later. |
Prefer a shared viewport fraction on both axes and cap growth at 60% so wide slides no longer spill to full width while tall slides get matching height treatment.
|
|
Addressed the wide vs tall asymmetry in the overview mini-map heuristic (also mirrored in ImagingDataCommons/dicom-microscopy-viewer#266):
Wide and tall extremes now get matching treatment instead of width-first expansion. |





Summary
TotalPixelMatrixextent but the rendered PNG is much smaller (Heuristic for sizing overview needs improvements #399).computeOverviewPreviewResizeFactorto deriveOverviewImageViewer.resizeFactorfrom the 100px preview tile and matrix dimensions (replaces the removed fixed0.3thumbnail heuristic from fix: Thumbnail fallback and multiple thumbnail using dicom tag browser #340).ResizeObserver.clampOverviewMapInViewport) for the volume viewer until the published DMV bundle includes the same sizing fix.Root cause
With
resizeFactor: 1, DMV builds an extent from the full matrix whileretrieveInstanceRenderedreturns a small overview/thumbnail PNG — the preview shows a tiny image or fails to fit the tile.Related
dicom-microscopy-viewerdependency in Slim; the client-side clamp can remain as a safety net or be simplified.Test plan
computeOverviewPreviewResizeFactor,recoverSeriesInstanceUID, andfitOverviewMapSizetsc --noEmitandbiome checkCloses #399