Skip to content
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

Develop #767

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open

Develop #767

wants to merge 3 commits into from

Conversation

vitorhvieira
Copy link

Copy link

@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.


Thank you for your hard work on this pull request! 😊 While your implementation of App.tsx is generally well-structured, there are a few critical issues that need to be addressed before we can approve it:

  1. Checklist Compliance:

    • Ensure that the filter in the Autocomplete component is not triggered by spaces only. This is a crucial requirement that needs verification.
    • Avoid direct DOM manipulation in the Autocomplete component to adhere to React best practices.
    • Check that keys are not generated on render, as this can lead to performance issues.
    • Follow the naming conventions for methods as specified in the guidelines.
  2. Task Description Compliance:

    • Implement a debounce mechanism in the Autocomplete component with a customizable delay.
    • Ensure the component shows all people when the input is focused but empty, and displays a "No matching suggestions" message when necessary.
    • Make sure the filtering logic doesn't rerun unnecessarily if the input text hasn't changed.
    • Handle the selection of suggestions correctly, updating the input and closing the list.
    • Ensure the selected person is passed to the onSelected callback and manage the display logic for the selected person appropriately.
  3. Missing Files:

    • The Autocomplete component and the Person type are missing, which are essential for verifying the task requirements.

Please address these points to ensure the functionality and requirements are fully met. Once these issues are resolved, your code will be in great shape! Keep up the great work, and don't hesitate to reach out if you have any questions or need further guidance. 🚀

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

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

Comment on lines +18 to +20
{selectedPerson
? `${selectedPerson?.name} (${selectedPerson?.born} - ${selectedPerson?.died})`
: 'No selected person'}

Choose a reason for hiding this comment

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

The conditional rendering logic here is correct, but you can simplify it by removing the optional chaining (?.) when accessing selectedPerson properties. Since the condition selectedPerson is already checked, selectedPerson is guaranteed to be non-null in the true branch. Therefore, you can safely use selectedPerson.name, selectedPerson.born, and selectedPerson.died without optional chaining.

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