From f9d2b461dd855e9d128bb5d0229cf048ffb32b3e Mon Sep 17 00:00:00 2001 From: Seanathon Date: Sat, 27 Jun 2026 00:07:32 -0700 Subject: [PATCH 1/2] feat(capture): pull og:image so readable/product cards get a hero image MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Image descriptor fields had no fill path: the AI skips image fields by design (it can't emit a screenshot), and url-readable capture produced no image — so a board with an image field (e.g. a 'Wish List' with featured_image) silently showed nothing, status 'done', no error. Now url-readable also extracts the page's og:image (secure first, then twitter:image, JSON-LD product image, link[rel=image_src]) from the HTML captureLibrary already fetched — zero extra network — and downloads it as the item's image asset: - extractOgImage(html, url) — pure, resolves relative URLs (processor-library). - url-readable adapter downloads it: SSRF-guarded (assertCapturableUrl), capped (12MB, 8s, image content-types only), stored as a kind:'image' asset. Any failure leaves the capture successful with no asset (best-effort). - hydrate surfaces a kind:'image' asset as the card/modal image when there's no screenshot. - honest fallback: empty placeholder reads 'No image' (was 'No screenshot'). Verified live: refetching the Edifier product item produced its real product photo. tsc clean; +8 tests (5 extractOgImage, 3 download-path). Co-Authored-By: Claude Opus 4.8 (1M context) --- public/index.html | 4 +- src/capture/url-readable.test.ts | 72 +++++++++++++++++++++++++++ src/capture/url-readable.ts | 84 ++++++++++++++++++++++++++++++-- src/db/hydrate.ts | 5 +- src/processor-library.test.ts | 32 +++++++++++- src/processor-library.ts | 71 ++++++++++++++++++++++++++- src/processors.ts | 4 +- 7 files changed, 263 insertions(+), 9 deletions(-) diff --git a/public/index.html b/public/index.html index f31115b..55710af 100644 --- a/public/index.html +++ b/public/index.html @@ -2287,7 +2287,7 @@
${b.screenshot ? `${esc(b.title)}` - : `
No screenshot
`} + : `
No image
`}
@@ -2788,7 +2788,7 @@ content.innerHTML = ` ${b.screenshot ? `${esc(b.title)}` - : ``} + : ``}