fix(defaultRouteInit): pass sorted display sets to hanging protocol for deterministic viewport order (#5933)

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
This commit is contained in:
Pedro Köhler 2026-04-06 10:23:37 -03:00 committed by GitHub
parent 91a8715795
commit 68b10d365a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -49,7 +49,7 @@ export async function defaultRouteInit(
// run the hanging protocol matching on the displaySets with the predefined // run the hanging protocol matching on the displaySets with the predefined
// hanging protocol in the mode configuration // hanging protocol in the mode configuration
hangingProtocolService.run({ studies, activeStudy, displaySets }, hangingProtocolId, { hangingProtocolService.run({ studies, activeStudy, displaySets: sortedDisplaySets }, hangingProtocolId, {
stageIndex, stageIndex,
}); });
} }