improvement(seo): extract shared withFilteredNoindex helper by waleedlatif1 · Pull Request #5392 · simstudioai/sim · GitHub
Skip to content

improvement(seo): extract shared withFilteredNoindex helper#5392

Merged
waleedlatif1 merged 1 commit into
stagingfrom
seo-noindex-helper-dx
Jul 3, 2026
Merged

improvement(seo): extract shared withFilteredNoindex helper#5392
waleedlatif1 merged 1 commit into
stagingfrom
seo-noindex-helper-dx

Conversation

@waleedlatif1

Copy link
Copy Markdown
Collaborator

Summary

  • Small DX follow-up to fix(seo): fix GSC indexing issues, remove unused academy/partners pages #5388 (already merged) — noticed while doing a deeper performance/DX pass that the { ...base, ...(isFiltered && { robots: { index: false, follow: true } }) } faceted-navigation noindex pattern was duplicated verbatim across five catalog pages (integrations, models, blog, careers, pricing)
  • Extracted to a single withFilteredNoindex(metadata, isFiltered) helper in lib/landing/seo.ts, next to buildLandingMetadata
  • Pure refactor, no behavior change — verified byte-identical rendered <meta name="robots">/<link rel="canonical"> output on baseline and filtered variants of all five pages, before and after, against a running dev server

Type of Change

  • Refactor / code quality

Testing

Tested manually (live dev server, curl against rendered HTML for all 5 pages × baseline/filtered). Typecheck, Biome lint, check:api-validation, and check:migrations all pass.

Checklist

  • Code follows project style guidelines
  • Self-reviewed my changes
  • Tests added/updated and passing
  • No new warnings introduced
  • I confirm that I have read and agree to the terms outlined in the Contributor License Agreement (CLA)

The `{ ...base, ...(isFiltered && { robots: { index: false, follow: true } }) }`
faceted-navigation noindex pattern was duplicated verbatim across five
catalog pages (integrations, models, blog, careers, pricing). Extracted to
lib/landing/seo.ts alongside buildLandingMetadata, giving the pattern a
name and a single point of change. Pure refactor — verified byte-identical
rendered output (robots meta + canonical) on baseline and filtered variants
of all five pages before and after.
@vercel

vercel Bot commented Jul 3, 2026

Copy link
Copy Markdown

@cursor

cursor Bot commented Jul 3, 2026

Copy link
Copy Markdown

PR Summary

Low Risk
SEO metadata refactor with no intended behavior change; risk is limited to accidental robots/canonical differences if the helper were misused.

Overview
Adds withFilteredNoindex(metadata, isFiltered) in lib/landing/seo.ts next to buildLandingMetadata, with a short doc comment on the faceted-navigation noindex pattern (unfiltered listing indexable, filtered/paginated variants noindex, follow, canonical still on the bare URL).

Blog, integrations, models, careers, and pricing generateMetadata now call that helper instead of inlining { ...base, ...(isFiltered && { robots: { index: false, follow: true } }) }. Metadata fields and isFiltered logic are unchanged; this is a DRY refactor only.

Reviewed by Cursor Bugbot for commit 48c2d2e. Configure here.

@greptile-apps

greptile-apps Bot commented Jul 3, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR extracts the repeated { ...metadata, ...(isFiltered && { robots: { index: false, follow: true } }) } inline pattern into a single withFilteredNoindex(metadata, isFiltered) helper in lib/landing/seo.ts, then applies it across five catalog pages (blog, careers, integrations, models, pricing). It is a pure refactor — no behavior is changed.

  • New helper (withFilteredNoindex): well-typed, well-documented with the Google faceted-navigation rationale, placed alongside buildLandingMetadata in the existing SEO utility file.
  • Five call sites updated: each page now delegates to the shared helper instead of repeating the spread pattern verbatim; imports follow the existing @/lib/landing/seo path-alias convention.

Confidence Score: 5/5

Safe to merge — the change is a mechanical extraction of a repeated inline expression into a named helper with no logic alterations.

Every call site produces byte-identical output to what existed before. The helper is narrowly scoped, fully typed, and the five consuming pages are straightforward substitutions. No new dependencies, no runtime branching changes, no side effects.

No files require special attention.

Important Files Changed

Filename Overview
apps/sim/lib/landing/seo.ts New withFilteredNoindex helper extracted here — correctly typed, well-documented, and mirrors the pre-existing inline pattern exactly.
apps/sim/app/(landing)/blog/page.tsx Metadata literal wrapped in withFilteredNoindex; logic unchanged, indentation restructured.
apps/sim/app/(landing)/careers/page.tsx Inline spread pattern replaced with withFilteredNoindex; behavior unchanged.
apps/sim/app/(landing)/integrations/(shell)/page.tsx Metadata literal wrapped in withFilteredNoindex; logic unchanged.
apps/sim/app/(landing)/models/(shell)/page.tsx Metadata literal wrapped in withFilteredNoindex; logic unchanged.
apps/sim/app/(landing)/pricing/page.tsx Inline spread pattern replaced with withFilteredNoindex; behavior unchanged.

Reviews (1): Last reviewed commit: "improvement(seo): extract shared withFil..." | Re-trigger Greptile

@waleedlatif1 waleedlatif1 merged commit 4fe372b into staging Jul 3, 2026
13 checks passed
@waleedlatif1 waleedlatif1 deleted the seo-noindex-helper-dx branch July 3, 2026 20:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant