Repository navigation
Closed
Copy link
Labels
agent:brandClaimed by Agent: BrandClaimed by Agent: Brandarea:webfeatureNew feature or enhancementNew feature or enhancementpo:antigravityDispatched by the Antigravity Product OwnerDispatched by the Antigravity Product Ownerstatus:in-reviewTask completed and waiting for review / PR mergeTask completed and waiting for review / PR merge
Description
Goal
Implement Package 8A Feature F3 (approved by JOY on 2026-11-22 from Docs/Proposals/2026-11-22-de-xuat-tinh-nang-moi-phase-8.html): generate brand-authentic dark-theme Dynamic OpenGraph truth cards (1200x630) for product detail pages, 1v1 versus matchups, and Deal Radar, plus a 1-click downloadable social Truth Card PNG (4:5 / 1200x630) in ProductShareAuditButton.tsx with zero database migrations.
Requirements
- Validated, Rate-Limited Truth Card Image Endpoint (
/api/v1/rate/og+apps/web/src/lib/og-truth-card.tsx):- Render crisp dark-theme (
#0f1113background,#161a1esurface,#FF2E29accent) PNG cards for 3 verified entity types:product: product title, verified floor price in VND acrossX / 22stores, price spread, Bayesian star score, 6-axis review trust signal, and Deal Radar badge.versus: head-to-head 2-device comparison card (prices, overall star scores, category winner badge).deals: Deal Radar summary card highlighting verified multi-store floor deals across 22 retail chains.
- Support
format=og(1200x630) andformat=social(1080x13504:5portrait for Threads/TikTok/Facebook/Zalo) with full Vietnamese and Czech diacritics (using bundled@fontsource/sharpSVG-to-PNG ornext/ogImageResponsewith local font bytes - zero external network calls!). - Anti-abuse & security: NEVER render arbitrary user-supplied query text onto images! Only accept validated
slug/versus/localeidentifiers backed by real cached catalog records (404when unknown), protect withBoundedSlidingWindowRateLimiter, and setCache-Control: public, s-maxage=3600, stale-while-revalidate=86400.
- Render crisp dark-theme (
- OpenGraph & Twitter Card Metadata Wiring + 1-Click PNG Download:
- Wire
openGraph.imagesandtwitter.imagesingenerateMetadataof product detail pages,/compare/[versus]/page.tsx, and/deals/page.tsx(without touchingCompareWorkspace.tsxorDealFinderWorkspace.tsx). - Add a 1-click
"Download Truth Card (PNG)"action insideProductShareAuditButton.tsx("productDetail"locale namespace).
- Wire
Approach
Implement the image generator + route handler /api/v1/rate/og/route.ts using cached BFF reads (withRateDataCache), wire openGraph.images / twitter.images in seo.ts / page generateMetadata, add the download action to ProductShareAuditButton.tsx, and add unit/route tests in apps/web/src/lib/__tests__/seo.test.ts and product-detail-copy.test.ts.
Acceptance
/api/v1/rate/ogreturns validimage/png(1200x630and1080x1350) withCache-Controlheaders for real products, versus pairs, and deals invi,en, andcs, and returns400/404/429safely on invalid, unknown, or rate-limited requests without rendering untrusted query strings.- Product detail,
/compare/[versus], and/dealsHTML metadata includeog:imageandtwitter:imagepointing to the canonical OG truth card URL. ProductShareAuditButton.tsxlets users download the PNG truth card in 1 click acrossvi,en, andcs.- Full monorepo
typecheck,lint,test,build, and Playwright E2E pass.
Files
apps/web/src/lib/og-truth-card.tsx(or.ts)apps/web/src/app/api/v1/rate/og/route.tsapps/web/src/lib/seo.ts& pagegenerateMetadatain category[slug]/page.tsx,compare/[versus]/page.tsx,deals/page.tsxapps/web/src/components/leaderboard/ProductShareAuditButton.tsxapps/web/locales/{vi,en,cs}.json("productDetail"namespace only)apps/web/src/lib/__tests__/seo.test.tsapps/web/src/lib/__tests__/product-detail-copy.test.ts
Metadata
Metadata
Assignees
Labels
agent:brandClaimed by Agent: BrandClaimed by Agent: Brandarea:webfeatureNew feature or enhancementNew feature or enhancementpo:antigravityDispatched by the Antigravity Product OwnerDispatched by the Antigravity Product Ownerstatus:in-reviewTask completed and waiting for review / PR mergeTask completed and waiting for review / PR merge
Activity
JOY commentedon Nov 22, 2026
🔒 [Agent: Brand] Claim lock
refs/claims/1865taken by claimantantigravity:0a1440be-c5c8-4ac0-8916-8f45aad1d36c(Status: in-progress).JOY commentedon Nov 22, 2026
[Agent: Brand] Claimed this issue on branch
feat/1865-og-truth-cards(Claimant:antigravity:0a1440be-c5c8-4ac0-8916-8f45aad1d36c). Starting implementation of Dynamic OpenGraph truth cards (/api/v1/rate/og,og-truth-card.tsx), metadata wiring, and 1-click social PNG download inProductShareAuditButton.tsx.JOY commentedon Nov 22, 2026
[Agent: Brand] Opened PR #1868 (
feat/1865-og-truth-cards->dev, commit7755067f), completed two independent fresh-context subagent reviews (all Round-1 P1/P2/P3 findings resolved and tested), and verified localtest,typecheck,lint, andbuild. Waiting for GitHub required checks on PR #1868.