Skip to content

Append tags to the search query and combine tags with text - #8

Merged
kibotu merged 1 commit into
mainfrom
feature/search-append-tags
Nov 18, 2026
Merged

kibotu merged 1 commit into
mainfrom
feature/search-append-tags

Conversation

@kibotu

@kibotu kibotu commented Nov 18, 2026 •

Copy link
Copy Markdown
Owner

TL;DR

  • A tag click adds the tag to the search field instead of clearing it: memory plus a click on #openai reads memory #openai.
  • One query can carry several tags and free text, and all of them must match.

Review focus

  • Entry::tagFilterConditions() — one EXISTS per slug, joined with AND, bound through array_merge($params, $tagSlugs). Confirm each of the four call sites appends the slugs at exactly the point where the condition is added.
  • Entry.php — searchByUser, countSearchAll and countSearchByUser take a nullable text query and skip the text condition when it is null or empty. searchByTagSlug, searchByTagSlugWithImages and countByTagSlug are deleted: nothing called them once listPublic moved to the combined query.
  • SearchService::parseQuery() and SearchManager.appendTag() tokenize tags independently, both as # plus letters, numbers and hyphens. #foo_bar reads as tag foo with text _bar, and #Café now resolves where the controller rejected it outright.
  • search-manager.js — five call sites move from setQuery('#' + slug) to appendTag(slug): landing page (SSR cards and API cards), user profile, collection page, embed. Tag clicks on the status page still navigate to /?q=%23slug; that page has no search field to append into.

Caveats

  • The tag key in the entries response is populated only for a query that is exactly one tag.
  • public/assets/dist/*.bundle.js is generated by sync.sh and is not in the diff.

SearchService::parseQuery() splits ?q= into free text and #tag tokens, and the
entry queries AND every tag with the text. SearchManager.appendTag() adds the
clicked tag to whatever is already in the field.

Tag queries now run through searchAll and searchByUser with a tag slug list, so
searchByTagSlug, searchByTagSlugWithImages and countByTagSlug are removed.
@kibotu
kibotu merged commit 1919db2 into main Nov 18, 2026
2 checks passed
@kibotu
kibotu deleted the feature/search-append-tags branch November 18, 2026 12:19
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.

1 participant