feat(vton): posts hybrid search (artist/scene/title/context)#613
Merged
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
- /api/v1/vton/posts: add `q` param. Meilisearch-first narrows posts by returned post-ids; if Meilisearch is unavailable, fall back to a DB ilike OR across title/artist_name/group_name/context. Commas/parens in q are sanitized before being interpolated into the or() filter. - useVtonPostFetch: accept searchQuery, debounce 300ms, send q via URL. - VtonItemPanel: render search input in posts mode too, with a posts-specific placeholder; differentiate empty-state copy for active search vs no data. - VtonModal: pipe the existing searchQuery into useVtonPostFetch only while sourceMode === "posts". Refs #602.
e6b7b0c to
2ebdad6
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
PR-4 of Epic #602 — VTON Modal 4-in-1. Adds hybrid search to the Posts tab so users can find a try-on-ready post by artist, scene/context, title, or group name.
/api/v1/vton/posts: newqquery param./api/v1/searchnarrow the Supabase query viain("id", …). Cheap and consistent with the existingitemsroute.ilikeOR fallback acrosstitle,artist_name,group_name,context.qare sanitized before being interpolated into theor()filter (PostgREST injection guard).useVtonPostFetch: acceptssearchQuery, debounced 300 ms, sent asqin the request URL.VtonItemPanel: search input now visible in posts mode too; placeholder =Search posts by artist or scene.... Empty-state copy switches between "No posts match your search." and the existing "No try-on ready posts yet."VtonModal: the existingsearchQuerystate is piped intouseVtonPostFetchonly whensourceMode === "posts"— no new state, existing reset-on-mode-switch behavior is preserved.Stacking
This PR is stacked on top of #609 (
feat/602-vton-expand-categories-and-search). Once #609 merges, GitHub will retarget this PR todev.Test plan
bun run vitest --run app/api/v1/vton lib/components/vton— 4 files / 30 tests pass (includes new q/hybrid cases inposts/__tests__/route.test.ts)bun run tsc --noEmit— only the pre-existingscripts/content-studio-video-local.tserror (fix(content-studio): useResearchInCopy type mismatch in plan route test (from #498) #610), nothing vton-relatedScope / non-goals
keywordsindexing: backlog (touches ai-server / api-server)Refs #602.