You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Follow-up to #672 / PR #749. After PR #749, _searchByTag no longer pollutes search-input, so a tag pill click on a fresh session leaves search-input empty. doSearch() (packages/memtomem/src/memtomem/web/static/app.js:1675) currently early-returns on empty q:
So the click currently acts as a "filter prep" — Search tab opens with tag-filter populated, but no results render until the user types a query.
Why
The intuitive UX (per #672 discussion) is that clicking a tag pill = "show me all memos with this tag". Today that requires an extra keystroke. Lifting the empty-q guard on both layers makes the click work as expected without any further _searchByTag change — PR #749 already calls doSearch() unconditionally, so this fix is purely additive.
Suggested change
Frontend (app.js:1673-1722): replace if (!q) return; with if (!q && !tf) return; so the search runs whenever either axis has a value.
Backend (packages/memtomem/src/memtomem/web/routes/search.py): make q optional (q: str | None = Query(None)) and validate that at least one of q / tag_filter is present (return 400 otherwise — keeps the "no-op search" guard at the API layer).
pipeline.search (packages/memtomem/src/memtomem/search/pipeline.py): verify it tolerates query=None / query="". The pipeline order is fixed (per CLAUDE.md); the BM25/dense stages should short-circuit cleanly when there's no query and the tag/source filter stage takes over as the primary selector. Add a regression test for tag_filter-only retrieval.
What
Follow-up to #672 / PR #749. After PR #749,
_searchByTagno longer pollutessearch-input, so a tag pill click on a fresh session leavessearch-inputempty.doSearch()(packages/memtomem/src/memtomem/web/static/app.js:1675) currently early-returns on emptyq:…and the backend (
packages/memtomem/src/memtomem/web/routes/search.py) declaresqas required:So the click currently acts as a "filter prep" — Search tab opens with
tag-filterpopulated, but no results render until the user types a query.Why
The intuitive UX (per #672 discussion) is that clicking a tag pill = "show me all memos with this tag". Today that requires an extra keystroke. Lifting the empty-
qguard on both layers makes the click work as expected without any further_searchByTagchange — PR #749 already callsdoSearch()unconditionally, so this fix is purely additive.Suggested change
app.js:1673-1722): replaceif (!q) return;withif (!q && !tf) return;so the search runs whenever either axis has a value.packages/memtomem/src/memtomem/web/routes/search.py): makeqoptional (q: str | None = Query(None)) and validate that at least one ofq/tag_filteris present (return 400 otherwise — keeps the "no-op search" guard at the API layer).pipeline.search(packages/memtomem/src/memtomem/search/pipeline.py): verify it toleratesquery=None/query="". The pipeline order is fixed (perCLAUDE.md); the BM25/dense stages should short-circuit cleanly when there's no query and the tag/source filter stage takes over as the primary selector. Add a regression test fortag_filter-only retrieval.[Unreleased] / Changed— "Tag pill click now runs a tag-only search on a fresh session (was a no-op filter prep after _searchByTag pollutes search-input with tag text #672)."Out of scope
tag-filter(separate UX question — issue _searchByTag pollutes search-input with tag text #672 noted the field is currently single-value text).importanceboost; needs a small UX call).Test plan
pytest packages/memtomem/tests/test_user_workflows.py::TestSearch::test_tag_filter_searchextended to coverq=None.References