From 4328851df846f5da540016feaff6a449d2bd5ecc Mon Sep 17 00:00:00 2001 From: Anandaroop Roy Date: Mon, 31 Aug 2026 12:19:28 -0400 Subject: [PATCH] revert(gene): restore previous title and description meta tags PR #17558 (DI-545) appended "Art & Prints for Sale" to Gene page titles and "Browse {name} art on Artsy." to descriptions. Search Console data since shows a ranking drop on Gene pages concentrated in generic categorical genes, driven by positional drops. Reverting both changes per DI-582; the unrelated Gene SSR change stays as-is. This reverts commit 329a903e6b5956182e5c0681472d11df060d9bb6. Assisted-by: Claude:Sonnet-5 --- playwright/e2e/gene.spec.ts | 6 ++-- src/Apps/Gene/Components/GeneMeta.tsx | 21 ++------------ .../Gene/Routes/__tests__/GeneShow.jest.tsx | 28 +++++++++++++------ 3 files changed, 25 insertions(+), 30 deletions(-) diff --git a/playwright/e2e/gene.spec.ts b/playwright/e2e/gene.spec.ts index b2b99ee54de..03dbbb7bf2b 100644 --- a/playwright/e2e/gene.spec.ts +++ b/playwright/e2e/gene.spec.ts @@ -1,4 +1,4 @@ -import { expect, test } from "@playwright/test" +import { test, expect } from "@playwright/test" test.describe("Gene", () => { test("/gene/:id", async ({ page }) => { @@ -7,8 +7,6 @@ test.describe("Gene", () => { await expect(page.locator("h1").first()).toContainText( "Contemporary Figurative Painting", ) - await expect(page).toHaveTitle( - "Contemporary Figurative Painting - Art & Prints for Sale | Artsy", - ) + await expect(page).toHaveTitle("Contemporary Figurative Painting | Artsy") }) }) diff --git a/src/Apps/Gene/Components/GeneMeta.tsx b/src/Apps/Gene/Components/GeneMeta.tsx index 3124503f8bd..b70d163dfe5 100644 --- a/src/Apps/Gene/Components/GeneMeta.tsx +++ b/src/Apps/Gene/Components/GeneMeta.tsx @@ -10,34 +10,19 @@ interface GeneMetaProps { const GeneMeta: React.FC> = ({ gene, }) => { - const title = buildTitle(gene) - const description = buildDescription(gene) + const fallbackDescription = `Explore ${gene.name} art on Artsy. Browse works by size, price, and medium.` + const title = `${gene.displayName || gene.name} | Artsy` return ( ) } -function buildTitle(gene: GeneMeta_gene$data): string { - return `${gene.displayName || gene.name} - Art & Prints for Sale | Artsy` -} - -function buildDescription(gene: GeneMeta_gene$data): string { - const description = [ - gene.meta.description, - `Browse ${gene.name} art on Artsy.`, - ] - .filter(Boolean) - .join(" ") - - return description -} - export const GeneMetaFragmentContainer = createFragmentContainer(GeneMeta, { gene: graphql` fragment GeneMeta_gene on Gene { diff --git a/src/Apps/Gene/Routes/__tests__/GeneShow.jest.tsx b/src/Apps/Gene/Routes/__tests__/GeneShow.jest.tsx index 586eb9414a2..df990604741 100644 --- a/src/Apps/Gene/Routes/__tests__/GeneShow.jest.tsx +++ b/src/Apps/Gene/Routes/__tests__/GeneShow.jest.tsx @@ -1,7 +1,7 @@ -import { screen } from "@testing-library/react" import { GeneShowFragmentContainer } from "Apps/Gene/Routes/GeneShow" import { MockBoot } from "DevTools/MockBoot" import { setupTestWrapperTL } from "DevTools/setupTestWrapperTL" +import { screen } from "@testing-library/react" import type { GeneShowTestQuery } from "__generated__/GeneShowTestQuery.graphql" import { graphql } from "react-relay" @@ -41,22 +41,34 @@ describe("GeneShow", () => { expect(screen.getByText("Display Name")).toBeInTheDocument() }) + it("renders fallback title correctly", () => { + renderWithRelay({ + Gene: () => ({ + name: "Example Gene", + displayName: "", + }), + }) + + expect(screen.getByRole("heading", { level: 1 })).toBeInTheDocument() + expect(screen.getAllByText("Example Gene")).toHaveLength(2) + }) + it("renders meta description and title from query", () => { renderWithRelay({ Gene: () => ({ - meta: { description: "Example Gene meta description." }, - displayName: "Example Gene Display Name", - name: "Example Gene Name", + meta: { description: "Gene Meta Description" }, + displayName: "Display Name", + name: "name", }), }) expect(document.querySelector('meta[name="description"]')).toHaveAttribute( "content", - "Example Gene meta description. Browse Example Gene Name art on Artsy.", + "Gene Meta Description", ) expect(document.querySelector('meta[name="title"]')).toHaveAttribute( "content", - "Example Gene Display Name - Art & Prints for Sale | Artsy", + "Display Name | Artsy", ) }) @@ -71,11 +83,11 @@ describe("GeneShow", () => { expect(document.querySelector('meta[name="description"]')).toHaveAttribute( "content", - "Browse Design art on Artsy.", + "Explore Design art on Artsy. Browse works by size, price, and medium.", ) expect(document.querySelector('meta[name="title"]')).toHaveAttribute( "content", - "Design - Art & Prints for Sale | Artsy", + "Design | Artsy", ) }) })