-
Notifications
You must be signed in to change notification settings - Fork 72
feat(helper): add Message class to handle message #417
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
Pull Request Test Coverage Report for Build 14132289657Details
💛 - Coveralls |
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
A feature to add a new Message class for handling in-app messages in the client utilities.
- Introduces a Message class to create, display, and remove messages.
- Exports the new Message class via the utils index.
- Updates the ESLint configuration to allow empty private constructors.
Reviewed Changes
Copilot reviewed 3 out of 4 changed files in this pull request and generated 1 comment.
File | Description |
---|---|
tools/helper/src/client/utils/message.ts | Adds the Message class with pop, close, and destroy methods to manage messages. |
tools/helper/src/client/utils/index.ts | Exports the newly added Message class. |
eslint.config.js | Adds an ESLint rule to permit empty private constructors. |
Files not reviewed (1)
- tools/helper/src/client/styles/message.scss: Language not supported
Comments suppressed due to low confidence (1)
tools/helper/src/client/utils/message.ts:46
- [nitpick] Consider adding the option { once: true } to the 'animationend' event listener to ensure the listener is automatically removed after execution.
messageElement.addEventListener('animationend', () => {
|
||
public pop(html: string, duration = 2000): number { | ||
const messageElement = document.createElement('div') | ||
const messageId = Date.now() |
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.
Using Date.now() to generate a messageId may lead to collisions if multiple messages are created in rapid succession. Consider using a more robust unique ID generator.
Copilot uses AI. Check for mistakes.
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.
@pengzhanbo I think the AI is right about this, any suggestions with it?
No description provided.