Skip to content

Similar recipes on the preview screen (similar-by-URL) - #142

Merged
windoze95 merged 1 commit into
mainfrom
feat/similar-by-url
Jul 8, 2026
Merged

Similar recipes on the preview screen (similar-by-URL)#142
windoze95 merged 1 commit into
mainfrom
feat/similar-by-url

Conversation

@windoze95

Copy link
Copy Markdown
Owner

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:

  • Resolves the URL to its canonical extraction; reuses that entry's stored embedding (generates + persists one only when the async backfill hasn't reached it yet).
  • Matches against the canonical extraction pool via new 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).
  • Returns lightweight {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 + UpdateCanonicalEmbedding on VectorRepo (+ 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

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>
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

@windoze95
windoze95 merged commit 7f52e0a into main Jul 8, 2026
1 check passed
@windoze95
windoze95 deleted the feat/similar-by-url branch July 8, 2026 17:37
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