fix: caselist freeze - #874
Conversation
The valtimoCdsModal directive re-applied the min-height style to .cds--modal-content on every mutation, while its MutationObserver also observes attribute changes in that same subtree. In recent Chromium versions (reported on Edge 148, reproducible in current Chrome) re-setting the style queues a new mutation record, so the observer callback re-triggered itself in an endless microtask loop that froze the tab as soon as the page rendered. This froze the case list and the task list, whose start-case/task modals pass [minContentHeight], even with the modal closed. The style is now applied at most once per content element, so the observer callback no longer generates mutations of its own. Newly rendered content elements (e.g. re-opened modals) are still styled.
📝 WalkthroughSummary by CodeRabbit
WalkthroughThe modal directive now tracks content elements that have received the minimum-height style. It skips tracked elements to prevent repeated style mutations from retriggering the observer. The 13.40.0 release notes document the related Chromium browser freeze and the one-time style application fix. 🚥 Pre-merge checks | ✅ 2✅ Passed checks (2 passed)
✨ Finishing Touches 💡 1🛠️ Fix failing CI checks 💡
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
frontend/projects/valtimo/components/src/lib/directives/valtimo-cds-modal/valtimo-cds-modal.directive.ts (1)
179-183: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winAdd regression tests for the mutation-loop fix.
Test that one content element receives one style write despite later attribute mutations. Also test that a newly rendered
.cds--modal-contentelement receives the style once.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro Plus
Run ID: 19ae5876-58d6-49fc-8fb7-13afd88fed42
📒 Files selected for processing (2)
documentation/release-notes/13.x.x/13.40.0/README.mdfrontend/projects/valtimo/components/src/lib/directives/valtimo-cds-modal/valtimo-cds-modal.directive.ts
|
Will create a test environment. This comment will be updated once it is available. This usually takes a few minutes.
Test environment metadata:
Observability: |
Presumably closes generiekzaakafhandelcomponent/gzac-issues#833
See docu in this pr for more info.