Add forced remount sequence for thumbnail stabilization in viewer

This commit is contained in:
Ross
2026-05-18 13:08:32 +01:00
parent 2b10f2e73c
commit 2f8b61a4be
@@ -1017,6 +1017,26 @@
}
panel.dataset.viewerControlsBound = '1';
// Force a take-page-only remount sequence to test thumbnail stabilization.
if (mainViewerEl && mainViewerEl.dataset.takeForcedRemountScheduled !== '1') {
mainViewerEl.dataset.takeForcedRemountScheduled = '1';
var forceTakeRemount = function (label) {
if (typeof window.mountDicomViewers === 'function') {
console.debug('[take-viewer] forcing dv3d remount:', label);
try {
window.mountDicomViewers();
} catch (e) {
console.warn('[take-viewer] forced dv3d remount failed:', label, e);
}
}
};
// First remount shortly after controls initialize.
setTimeout(function () { forceTakeRemount('early'); }, 250);
// Second remount after initial image pipeline settles.
setTimeout(function () { forceTakeRemount('late'); }, 1600);
}
var savedH = localStorage.getItem(HEIGHT_KEY);
if (savedH && !isNaN(parseInt(savedH, 10))) {
container.style.height = parseInt(savedH, 10) + 'px';