Skip to content

solution#1855

Open
Handsome010 wants to merge 2 commits into
mate-academy:masterfrom
Handsome010:develop
Open

solution#1855
Handsome010 wants to merge 2 commits into
mate-academy:masterfrom
Handsome010:develop

Conversation

@Handsome010

Copy link
Copy Markdown

No description provided.

@mateacademy-ai-mentor mateacademy-ai-mentor left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review Summary

I am requesting changes because there is a critical style issue that breaks the required notification positioning. In src/scripts/main.js, you first set notif.style.position = 'fixed', but then immediately call notif.setAttribute('style', ...), which overrides the entire style attribute and removes position: fixed. This means the notification may no longer be fixed on the screen as required, affecting the core behavior of the feature [CHECKLIST ITEM #2].

To fix this, either include position: fixed in the string you pass to setAttribute('style', ...), or better, stop using setAttribute for styles and set notif.style.top and notif.style.right directly so they work together with notif.style.position. Aside from this, your implementation of pushNotification looks solid: it creates the elements correctly, assigns the right classes, appends them to the DOM, and hides them after 2 seconds with style.display = 'none'. Once you correct the style overwrite so the notification remains fixed at the given coordinates, your solution should fully meet the task requirements. Keep going—you're very close and just need this small but important adjustment.


✨ Please rate this review in the Platform's notification center1. I will be grateful for your feedback! ✨

Important

Fix the issues, commit the changes, and then re-request my review using the Re-request review button2 in the Reviewers tab.

Tip

If you have any comments about this review, please leave a message in the Add a comment section below and mention me with the @mateacademy-ai-mentor tag3.
I will read your message during my next review of your pull request. Please do not reply directly to my comments, as that feature is not supported yet.

Caution

Do not close the pull request until the review is complete. Closing it early can lead to unexpected behavior and disrupt the review process.

Footnotes

  1. Rate AI review example

  2. Re-request AI review example

  3. Add AI review comments example

Comment thread src/scripts/main.js Outdated
Comment on lines +8 to +9
notif.style.position = 'fixed';
notif.setAttribute('style', `top: ${posTop}px; right: ${posRight}px;`);

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here you first set notif.style.position = 'fixed', but then use setAttribute('style', ...) which replaces the entire style attribute and effectively discards the position property. To keep position: fixed along with top and right, consider setting notif.style.top and notif.style.right directly instead of using setAttribute.

@mateacademy-ai-mentor mateacademy-ai-mentor left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review Summary

I am approving your solution because the pushNotification function in src/scripts/main.js fully meets the functional and technical requirements. You correctly create the notification container, h2.title for the title, and p for the description, and you append the notification to document.body with both the base notification class and the dynamic type class (success, error, warning). The notification is hidden after 2 seconds using setTimeout and style.display = 'none', which satisfies the requirement to keep elements in the DOM while controlling visibility. You also avoid overwriting the entire style attribute, so any external positioning (like position: fixed) remains intact while you set top and right. There are no critical blockers or broken behaviors in your current implementation of main.js. The only remaining task-related detail is to ensure the [DEMO LINK] uses your real GitHub username in the project description, but that sits outside this file and does not block approval of your code here. Overall, this is a clean, requirement-compliant implementation—nice work.


✨ Please rate this review in the Platform's notification center1. I will be grateful for your feedback! ✨

Footnotes

  1. Rate AI review example

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants