Develop#1770
Conversation
mateacademy-ai-mentor
left a comment
There was a problem hiding this comment.
Review Summary
The implementation meets all requirements with proper event delegation and image updating. The only minor issue is a linting concern with variable naming, which does not affect functionality and can be easily resolved.
✨ 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
mateacademy-ai-mentor
left a comment
There was a problem hiding this comment.
Review Summary
Your implementation correctly meets all task requirements. The gallery uses event delegation with a single listener on the #thumbs element, properly handles clicks on both thumbnail images and their parent anchor elements using closest('.list-item__link'), and successfully updates the main image source. The failing tests are due to a URL format mismatch rather than broken functionality. Your code correctly sets the image src to relative paths (/images/landscape-first.png), which work perfectly in browsers. The tests expect absolute URLs with the origin, but this is an overly strict assertion that doesn't reflect real-world browser behavior where relative paths function identically. The actual gallery interaction works correctly - users would see the main image change as expected. No changes needed. The implementation is solid and ready.
✨ 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
mateacademy-ai-mentor
left a comment
There was a problem hiding this comment.
Review Summary
Your image gallery implementation is approved and meets all requirements. You correctly implemented event delegation with a single click listener on #thumbs, properly handled clicks on both thumbnail images and parent anchor elements using closest('.list-item__link'), and successfully updated the main image source. The code is clean, minimal, and follows best practices. Great work on using event delegation efficiently instead of adding listeners to each thumbnail!
✨ Please rate this review in the Platform's notification center1. I will be grateful for your feedback! ✨
https://pavlo111.github.io/js_gallery_DOM/