Skip to content

Add task solution - #1263

Open
DiegoBalkeKuhn wants to merge 3 commits into
mate-academy:masterfrom
DiegoBalkeKuhn:develop
Open

DiegoBalkeKuhn wants to merge 3 commits into
mate-academy:masterfrom
DiegoBalkeKuhn:develop

Conversation

@DiegoBalkeKuhn

@DiegoBalkeKuhn DiegoBalkeKuhn commented Nov 19, 2026 •

Copy link
Copy Markdown

Solution for the react_autocomplete task.

@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

The core autocomplete flow is in place, but two required behaviors in src/components/Autocomplete.tsx still need correction. In the filtering path, whitespace-only input reaches filterPeople; check whether the input is blank after trimming and skip the filtering call in that case, as required by checklist item 1. The input uses data-cy and the component does not provide the required data-qa attributes; add the expected test attributes so the tests can locate the elements. The PR description also needs the required demo link. These are specific, fixable gaps; the remaining reviewed behavior looks good.


✨ 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 on lines +50 to +51
lastFilterRef.current = value;
const filtered = filterPeople(value);

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 violates checklist item 1: “make sure that filter won't be called if user enred spaces only;”. A spaces-only value reaches filterPeople here; skip the filtering call for whitespace-only input.

type="text"
placeholder="Enter a part of the name"
className="input"
data-cy="search-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.

The task requires retaining the data-qa attributes for tests, but this input uses data-cy and the component has no data-qa attributes. Add or preserve the required test attributes.

@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

The autocomplete flow is otherwise in good shape, but one required behavior remains incomplete in src/components/Autocomplete.tsx: clearing the focused input leaves the previous suggestions visible. Update the empty-input path to show all people, and cancel any pending debounce so an older query cannot overwrite that list with stale results. This is a functional gap in the required empty-input behavior; the relevant code is the input-change and debounce handling in Autocomplete.tsx. Addressing it will complete the autocomplete flow.


✨ 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 on lines +71 to +73

if (value.trim() !== '') {
debouncedFilter(value);

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

When the input is cleared, no new suggestions are set, so the previous results remain visible. Update the list to show all people while the focused input is empty, and cancel any pending debounce so stale results are not applied afterward.

@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

Your solution is approved. The autocomplete behavior covers debounced filtering, empty and whitespace-only input, selection, and clearing the selected person when the input is edited. The selected-person title, required data-qa attributes, and stable suggestion keys are also in place; no functional issues were identified. Great work delivering a complete implementation.


✨ 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