From 6b7f7e68e6b0357f0382afe47c3f71de81d574ca Mon Sep 17 00:00:00 2001 From: Edwin Cartagena Date: Tue, 27 Oct 2026 01:33:40 -0600 Subject: [PATCH 1/2] Fix search to match notes containing the term 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 --- lib/store.js | 2 +- notes.md | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) create mode 100644 notes.md diff --git a/lib/store.js b/lib/store.js index 1d9215f..7ceefa0 100644 --- a/lib/store.js +++ b/lib/store.js @@ -38,7 +38,7 @@ function remove(id) { // Returns the notes that match `term`. function matches(notes, term) { - return notes.filter((note) => note.text === term); + return notes.filter((note) => note.text.includes(term)); } function search(term) { diff --git a/notes.md b/notes.md new file mode 100644 index 0000000..efdff2f --- /dev/null +++ b/notes.md @@ -0,0 +1,7 @@ +# Mi mensaje de commit (versión rápida) + +fix search + +# Mensaje de Claude + +(ver el commit en la rama `fix-search-contains`; se compara abajo) From 93adc52655386469b52c6d5e1838568d88882593 Mon Sep 17 00:00:00 2001 From: Edwin Cartagena Date: Tue, 27 Oct 2026 01:33:50 -0600 Subject: [PATCH 2/2] Compare commit messages in notes.md Co-Authored-By: Claude Sonnet 5.5 --- notes.md | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/notes.md b/notes.md index efdff2f..9f28886 100644 --- a/notes.md +++ b/notes.md @@ -4,4 +4,16 @@ fix search # Mensaje de Claude -(ver el commit en la rama `fix-search-contains`; se compara abajo) +``` +Fix search to match notes containing the term + +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. +``` + +# Comparación + +El mío dice solo el *qué* ("fix search") y no aclara qué estaba roto. El de Claude explica el *por qué*: la causa (`===` en lugar de `includes`), un ejemplo concreto (`milk` vs `buy milk`), la referencia al comportamiento documentado en el README y el efecto en los tests. Es más largo, pero alguien que lea el historial entiende el cambio sin abrir el diff.