Skip to content

Solution - #1934

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

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

Conversation

@Dm1trik

@Dm1trik Dm1trik commented Aug 22, 2026

Copy link
Copy Markdown

@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 the implementation violates task requirement #3 by selecting all inputs on the page instead of only those within the form. In src/scripts/main.js, the line that uses document.querySelectorAll('input') (please update the exact line number where this occurs) should be scoped to the form element as required. This is a critical blocker because it can include unintended inputs outside the form and fails an explicit requirement.

Issues to fix:

  • Replace the global selector with a form-scoped one, e.g., document.querySelector('form').querySelectorAll('input') or document.querySelectorAll('form input').

Everything else (labels and placeholders) looks good—nice work there. Once the input selection is limited to the form, the solution should meet the requirements.


✨ 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
'use strict';

// write code here
document.querySelectorAll('input').forEach((input) => {

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

This selects ALL inputs on the page, but requirement #3 specifies to get inputs FROM the form tag. Use document.querySelector('form').querySelectorAll('input') or document.querySelectorAll('form input') instead.

@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

Here is my approval: You correctly scoped the selector to document.querySelectorAll('form input'), created labels with the field-label class, set each label’s for to match the input id, capitalized label text and placeholders based on each input’s name, and appended labels to the inputs’ parent containers. These steps fulfill the functional requirements and avoid the earlier global selector issue. The implementation appears clean and aligned with the task, with no critical blockers or missing features. As a minor improvement (non-blocking), consider guarding against inputs without an id or name to avoid edge cases, and handle cases where a label may already exist to prevent duplicates. Nicely done!


✨ 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