Skip to content

tree_from_object_dom#1738

Open
MaksVash wants to merge 2 commits intomate-academy:masterfrom
MaksVash:develop
Open

tree_from_object_dom#1738
MaksVash wants to merge 2 commits intomate-academy:masterfrom
MaksVash:develop

Conversation

@MaksVash
Copy link
Copy Markdown

@MaksVash MaksVash commented Apr 5, 2026

No description provided.

Copy link
Copy Markdown

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

Choose a reason for hiding this comment

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

Review Summary

Great job on the recursive createTree function! The JavaScript logic is well-implemented and correctly builds the nested list. However, changes are needed in your src/index.html file due to an issue with the HTML structure. You are using an <li id="tree"> element directly inside the <body>, which is not valid HTML. According to web standards, <li> elements must always be direct children of a list element like <ul> or <ol>. To fix this, please change the container element to a more appropriate tag, such as <div id="tree"></div>. After this small but important correction, your solution will be ready for approval.


✨ 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/index.html Outdated
</head>
<body>
<script src="scripts/main.js"></script>
<li id="tree"></li>
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Using a <li> element directly inside the <body> is not semantically correct HTML. List items (<li>) should always be children of a list element (<ul> or <ol>). Consider using a <div> as the container for your tree instead.

Comment thread src/scripts/main.js
ul.append(li);
}

element.append(ul);
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 line appends the generated <ul> to the parent element. In the initial call, element refers to the <li id="tree"> from your index.html. While this works, using an <li> element as a direct child of <body> is not valid HTML. To fix this, you should change the container in your HTML file to a more appropriate element, like <div id="tree"></div>.

Copy link
Copy Markdown

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

Choose a reason for hiding this comment

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

Review Summary

Excellent work on this submission! You've successfully addressed the feedback from the previous review by correcting the HTML structure. Your recursive createTree function is well-implemented, clean, and correctly builds the nested list as required. The solution now meets all the project requirements, so I am happy to approve it. Great job!


✨ 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