Skip to content

fix search substring matching function so that substring matching works - #329

Open
tobywipebookcode wants to merge 1 commit into
mate-academy:mainfrom
tobywipebookcode:fix-search-substring
Open

tobywipebookcode wants to merge 1 commit into
mate-academy:mainfrom
tobywipebookcode:fix-search-substring

Conversation

@tobywipebookcode

Copy link
Copy Markdown

fixes the search substring

@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 matches function in lib/store.js correctly uses .includes(term) to perform substring matching, which satisfies the core task requirement that the search command should list every note containing the search term, not just exact matches. All four commands (add, list, search, delete) are properly implemented, and the file layout follows the required structure. The bug fix is minimal and targeted - a single line change that resolves the issue. Your implementation is ready for the commit step.


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

Footnotes

  1. Rate AI review example ↩

matches() compared note.text to the term with ===, so only a note whose
entire text equalled the term was returned. Use includes() so any note
containing the term is listed.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@tobywipebookcode tobywipebookcode changed the title fix search substring fix search substring matching function so that substring matching works Oct 26, 2026

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

Sorry, the pull request review was unsuccessful for the following reasons:

Warning

No changes were made in the pull request since the last review. Please make sure that you have added files to the pull request and committed the changes.
[CODE: NCM]

The next review attempt will not launch automatically.
Push a commit with your changes to this pull request, or write a comment that mentions me.
Then request a new review with the Re-request review button next to my name in the Reviewers section.
If you believe this is an error or need assistance, please contact the support team.

@tobywipebookcode

Copy link
Copy Markdown
Author

@mateacademy-ai-mentor please review the updated commit message

@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 code correctly implements substring matching using .includes(term) in the matches function on line 41 of lib/store.js. All four required commands (add, list, search, delete) are working properly, and the search functionality now finds notes containing the search term anywhere in the text. The file structure matches the requirements with the entry point in notes.js, storage in lib/store.js, and config in lib/config.js. While the commit message "fixes the search substring" could be more descriptive (consider adding what problem was solved and why), this is a minor documentation issue rather than a critical blocker that prevents task completion.


✨ 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