From a99b4aab786cd69637513ed2cb50bca87416ab28 Mon Sep 17 00:00:00 2001 From: Rene Fichtmueller Date: Mon, 6 Apr 2026 10:24:39 +0200 Subject: [PATCH] fix: correct verified badge, comparable pricing, and clickable product images - Reset details_verified=false for 298 products where reach_label is empty (DB migration) - Runtime check in dashboard: dVer requires non-empty reach_label regardless of DB flag - comparable price query: treat reach_meters=0 same as NULL so 800G OSFP products find FS.com equivalent prices (was blocked by reach_meters=0 != NULL shortcircuit) - Product image area now fully clickable with vendor link overlay when product_page_url exists - Clear wrong image for O.Czz8HG.z.R (was showing unrelated OSFP product image) --- packages/api/src/routes/transceivers.ts | 3 ++- packages/dashboard/index.html | 15 ++++++++++----- 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/packages/api/src/routes/transceivers.ts b/packages/api/src/routes/transceivers.ts index 2a12dee..cd4b3a2 100644 --- a/packages/api/src/routes/transceivers.ts +++ b/packages/api/src/routes/transceivers.ts @@ -81,7 +81,8 @@ transceiverRouter.get("/:id", async (req: Request, res: Response) => { t2.form_factor = t1.form_factor AND t2.speed_gbps = t1.speed_gbps AND ( - t1.reach_meters IS NULL OR t2.reach_meters IS NULL + t1.reach_meters IS NULL OR t1.reach_meters = 0 + OR t2.reach_meters IS NULL OR t2.reach_meters = 0 OR ABS(t2.reach_meters - t1.reach_meters) <= GREATEST(t1.reach_meters, 1) * 0.25 ) AND t2.id != t1.id diff --git a/packages/dashboard/index.html b/packages/dashboard/index.html index 3d5d674..80cc48b 100644 --- a/packages/dashboard/index.html +++ b/packages/dashboard/index.html @@ -2689,15 +2689,19 @@ async function openTxDetail(id) { } h += ''; - // Image section + // Image section — entire box clickable if product_page_url exists var hasRealImage = t.image_url || (t.vendor_name === 'FLEXOPTIX' && FF_REFERENCE_IMAGES[t.form_factor]); - h += '
'; + if (t.product_page_url) { + h += ''; + } + h += ''; + if (t.product_page_url) h += ''; // Title below image — proper manufacturer designation only, never garbage/auto-generated names var isGarbageName = function(s) { @@ -2747,8 +2751,9 @@ async function openTxDetail(id) { // Verification summary bar — explicit === true to handle any type coercion var pVer = t.price_verified === true; var iVer = t.image_verified === true; - var dVer = t.details_verified === true; - var fVer = t.fully_verified === true; + // details_verified from DB can be stale — runtime-check reach_label as gating requirement + var dVer = t.details_verified === true && !!(t.reach_label && t.reach_label.trim() !== ''); + var fVer = t.fully_verified === true && dVer; // Competitor verified: at least 1 price from a non-Flexoptix vendor in last 30 days var allPricesForBadge = (t.competitor_prices || []).filter(function(p) { return p.url && p.price > 0; }); var cVer = allPricesForBadge.some(function(p) {