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 += '
'; h += getTransceiverImage(t); if (t.vendor_name && t.image_url) h += '' + esc(t.vendor_name) + ''; if (t.product_page_url) { - h += 'View on ' + esc(t.vendor_name || 'Vendor') + ' →'; + h += 'View on ' + esc(t.vendor_name || 'Vendor') + ' →'; } 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) {