fix(seo): replace SVG data URI placeholders with proper fallback handling#218
Open
BuyWhere wants to merge 1 commit into
Open
fix(seo): replace SVG data URI placeholders with proper fallback handling#218BuyWhere wants to merge 1 commit into
BuyWhere wants to merge 1 commit into
Conversation
…ling Product card images on SEO landing pages and search results were all rendering as generic SVG gradient placeholders (data:image/svg+xml) instead of real product photos or a clean text fallback. Root causes: - isUsableProductImage() returned true for SVG data URIs - withFallbackImage() actively generated SVG placeholders via buildCategoryImage() - ProductGridCard had a special branch rendering SVG data URIs as <Image> - buildSeoLandingSchema() included SVG data URIs in JSON-LD image field - search page hasUsableProductImage() didn't reject data: protocol URIs Fixes: - isUsableProductImage: return false for SVG data URIs - withFallbackImage: return null instead of generating SVG placeholder - ProductGridCard: remove SVG-specific rendering branch - buildSeoLandingSchema: exclude SVG data URIs from structured data - search hasUsableProductImage: reject data: protocol URLs Ref: BUY-62196
Owner
Author
Fix complete — PR ready for mergePR: #218 What changed (3 files, +5/-13 lines)
Expected behavior after merge
Next stepMerge PR #218 to deploy to Railway production. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes product card images rendering as generic SVG gradient placeholders (
data:image/svg+xml) instead of real product photos or clean text fallbacks.Ref: BUY-62196
Root Cause
Product card images on SEO landing pages (
/air-purifier-singaporeetc.) and search results were all displaying as SVG data URI placeholders due to:isUsableProductImage()treated SVG data URIs as valid imageswithFallbackImage()actively generated SVG placeholders viabuildCategoryImage()ProductGridCardhad a special rendering branch for SVG data URIsbuildSeoLandingSchema()included SVG data URIs in JSON-LDhasUsableProductImage()didn't rejectdata:protocol URLsChanges (3 files, +5/-13 lines)
src/lib/seo-landing-pages.tsisUsableProductImage(): reject SVG data URIswithFallbackImage(): return null instead of generating SVG placeholderbuildSeoLandingSchema(): exclude SVG data URIs from JSON-LD image fieldsrc/components/seo/SeoLandingPage.tsxProductGridCard: remove SVG-specific rendering branchsrc/app/search/SearchResultsClient.tsxhasUsableProductImage(): rejectdata:protocol URLsBehavior After Fix