Repository navigation
Fix search to match notes containing the term - #331
hernandezggg wants to merge 2 commits into
Conversation
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
left a comment
There was a problem hiding this comment.
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! ✨
matches()comparednote.text === term, so search only found notes whose whole text equaled the term. UsesString.includesinstead; the two failing search tests now pass.notes.mdcompares my quick commit message with Claude's.🤖 Generated with Claude Code