Similar recipes on the preview screen (similar-by-URL) - #142
Merged
Conversation
The preview screen (where shared/deep links land, and every search
result before import) had no "similar recipes" section — that only
existed on the saved-recipe detail screen, which needs a saved id.
New GET /v1/recipes/similar-by-url?u=<url>: resolves the page to its
canonical extraction, reuses that entry's stored embedding (generating +
persisting one only when the backfill hasn't yet), and returns similar
entries from the extraction pool as lightweight {title, source_url,
source_domain} cards. A cache miss is not an error — it returns an empty
list so the section quietly hides. VectorRepo gains FindSimilarCanonicals
(+ UpdateCanonicalEmbedding surfaced on the interface).
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
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.
Why
Opening a recipe from an outside link (shared/universal link) lands on the preview screen, which had no "similar recipes" section — that only lived on the saved-recipe detail screen and requires a saved recipe id. Reported by the user.
What
GET /v1/recipes/similar-by-url?u=<source-url>&limit=N:VectorRepo.FindSimilarCanonicals— the natural "recipes like this from around the web" for a not-yet-saved page, and a pool that grows with every extraction (vs. the sparse saved-recipes pool the detail screen uses).{title, source_url, source_domain}cards (canonicals have no image). A cache miss / no-embedding / query error all return an empty list (HTTP 200) so the app section quietly hides — never an error surface on a preview.Interface additions:
FindSimilarCanonicals+UpdateCanonicalEmbeddingonVectorRepo(+ mock). App side: windoze95/saltybytes-app (companion PR).Tests
3 new handler tests (stored-embedding reuse, cache-miss → empty, missing-url → 400); existing similarity tests updated for the new constructor arg. Full suite green.
🤖 Generated with Claude Code