Skip to content

Fix search to match notes containing the term - #331

Open
hernandezggg wants to merge 2 commits into
mate-academy:mainfrom
hernandezggg:fix-search-contains
Open

hernandezggg wants to merge 2 commits into
mate-academy:mainfrom
hernandezggg:fix-search-contains

Conversation

@hernandezggg

Copy link
Copy Markdown

matches() compared note.text === term, so search only found notes whose whole text equaled the term. Uses String.includes instead; the two failing search tests now pass. notes.md compares my quick commit message with Claude's.

🤖 Generated with Claude Code

Edwin Cartagena and others added 2 commits October 27, 2026 01:33
matches() compared note.text with === term, so `notes search milk`
only found a note whose entire text was "milk" and missed notes like
"buy milk". Use String.includes so search returns every note that
contains the term, as the README documents. The two failing search
tests in tests/notes.test.js now pass.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

@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 fix in lib/store.js line 41 correctly implements substring matching using .includes(term) instead of exact match with ===, which satisfies the task requirement that the search command lists every note containing the search term. The notes.md file properly documents the commit message comparison as requested. All core requirements are met: the bug is fixed in the matches function, the implementation is a single-line change, and the documentation is complete. The test output visibility is a non-blocking documentation concern that doesn't affect the correctness of your 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