Improve SPA permanence#52
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
👋 Hello @glenn-jocher, thank you for submitting a
For more guidance, please refer to our Contributing Guide. If you have any questions or need clarification, feel free to leave a comment in this PR. Thank you for contributing to Ultralytics! 🚀 |
UltralyticsAssistant
left a comment
There was a problem hiding this comment.
🔍 PR Review
Made with ❤️ by Ultralytics Actions
Key SPA-hardening goals aren’t met yet: permanent flags need stable IDs to take effect, and the new document-wide MutationObserver runs on every mutation, which can noticeably hurt performance. Address these to ensure the widget stays stable without regressing page responsiveness.
💬 Posted 2 inline comments
📋 Skipped 1 file (lock files, minified, images, etc.)
js/chat.min.js
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
🛠️ PR Summary
Made with ❤️ by Ultralytics Actions
🌟 Summary
Improves the resilience of the Ultralytics Chat widget in SPA environments by marking key elements as permanent and hardening DOM reattachment logic.
📊 Key Changes
markPermanenthelper that setsdata-turbo-permanentanddata-turbolinks-permanenton critical chat elements.watchForRemovalto:parentaccessors (() => document.head/body) instead of static references.document.documentElementwithsubtree: truefor more robust detection across SPA navigations.markPermanentto the injected style tag, backdrop, pill, modal, and tooltip in bothchat.jsand the minifiedchat.min.jsbundle.🎯 Purpose & Impact