From 5d5f5d2fca285f7ae8b29c5e3be662d8a9626b82 Mon Sep 17 00:00:00 2001 From: Pedro Kohler Date: Wed, 1 Apr 2026 07:24:09 -0300 Subject: [PATCH] fix: pass sorted display sets to hanging protocol for deterministic viewport order The `applyHangingProtocol` function already sorts display sets by modality priority and series number into `sortedDisplaySets`, but the unsorted `displaySets` array was being passed to `hangingProtocolService.run()`. This caused non-deterministic viewport ordering across page loads because `displaySetService.getActiveDisplaySets()` returns display sets in creation order, which depends on asynchronous network responses. Made-with: Cursor --- platform/app/src/routes/Mode/defaultRouteInit.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/platform/app/src/routes/Mode/defaultRouteInit.ts b/platform/app/src/routes/Mode/defaultRouteInit.ts index b7aeb844f31..723c4823168 100644 --- a/platform/app/src/routes/Mode/defaultRouteInit.ts +++ b/platform/app/src/routes/Mode/defaultRouteInit.ts @@ -49,7 +49,7 @@ export async function defaultRouteInit( // run the hanging protocol matching on the displaySets with the predefined // hanging protocol in the mode configuration - hangingProtocolService.run({ studies, activeStudy, displaySets }, hangingProtocolId, { + hangingProtocolService.run({ studies, activeStudy, displaySets: sortedDisplaySets }, hangingProtocolId, { stageIndex, }); }