Skip to content

Solution#1138

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

Solution#1138
Igrik74 wants to merge 2 commits intomate-academy:masterfrom
Igrik74:develop

Conversation

@Igrik74
Copy link
Copy Markdown

@Igrik74 Igrik74 commented Mar 15, 2026

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

You've done a great job implementing the core functionality here—the debouncing and filtering logic work really well! However, I am requesting changes because the main goal was to create a reusable Autocomplete component, but all the logic is currently implemented inside the App component. This prevents it from being reusable and has led to a couple of key requirements being missed:

  • The debounce delay is hardcoded in src/App.tsx. It should be a customizable prop with a default value of 300ms.
  • When a user makes a selection, the chosen person object isn't passed to an onSelected callback prop as required.

To resolve this, please refactor the logic into a separate Autocomplete component. The App component should then use this new component, configuring it with props like delay and onSelected.


✨ 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

src/App.tsx Outdated
import { peopleFromServer } from './data/people';
import { Person } from './types/Person';

const DEBOUNCE_DELAY = 300;
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

The debounce delay is hardcoded here. According to the task requirements, the delay should be a customizable prop for the Autocomplete component, with a default value of 300ms.

src/App.tsx Outdated
Comment on lines +66 to +69
const handleSelect = (person: Person) => {
setQuery(person.name);
setSelectedPerson(person);
setIsOpen(false);
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 handler correctly updates the internal state. However, the task requires passing the selected person object to an onSelected callback function that should be passed to the component via props. This is a key requirement for making the component reusable.

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 iteration! I am approving your solution. You've done a fantastic job refactoring the logic into a reusable Autocomplete component and have successfully addressed all the feedback from the previous review. The component is well-structured, and the application now fully meets all specified requirements. 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