-
Notifications
You must be signed in to change notification settings - Fork 32
♻️ [Frontend] Refactor: Message model #8471
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR refactors the message model in the frontend by introducing a proper osparc.data.model.Message class to replace plain JavaScript objects. The refactoring improves type safety and encapsulation by using getter methods instead of direct property access.
- Introduced a new
Messagemodel class with proper properties and methods - Updated all message handling code to use the new model class methods
- Refactored conversation classes to extend
MessageListinstead ofConversation
Reviewed Changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
osparc/data/model/Message.js |
New Message model class with properties and getter methods |
osparc/data/model/Conversation.js |
Updated to use Message model instances and proper type checking |
osparc/conversation/MessageList.js |
Renamed from Conversation class and simplified message handling |
osparc/conversation/MessageUI.js |
Updated to use Message model getter methods and data binding |
osparc/conversation/NotificationUI.js |
Updated parameter types and method calls for Message model |
osparc/conversation/AddMessage.js |
Updated to use Message model and improved UI focus handling |
osparc/support/ConversationListItem.js |
Updated to use Message model getter methods |
osparc/support/Conversation.js |
Updated to extend MessageList instead of Conversation |
osparc/study/Conversation.js |
Updated to extend MessageList and added override comment |
Comments suppressed due to low confidence (1)
services/static-webserver/client/source/class/osparc/conversation/AddMessage.js:1
- This line excludes a UI control but there's no corresponding logic to show it when needed. Consider adding a comment explaining when this control should be visible or ensure proper visibility management.
/* ************************************************************************
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
services/static-webserver/client/source/class/osparc/conversation/MessageUI.js
Outdated
Show resolved
Hide resolved
services/static-webserver/client/source/class/osparc/conversation/MessageUI.js
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
|



What do these changes do?
This PR refactors the message model in the frontend by introducing a proper
osparc.data.model.Messageclass to replace plain JavaScript objects. The refactoring improves type safety and encapsulation by using getter methods instead of direct property access.Messagemodel class with proper properties and methodsRelated issue/s
How to test
Dev-ops