Skip to content

refactor(landing): DRY page metadata via buildLandingMetadata + derive pricing credits#5299

Merged
waleedlatif1 merged 2 commits into
stagingfrom
improvement/landing-followups
Jun 30, 2026
Merged

refactor(landing): DRY page metadata via buildLandingMetadata + derive pricing credits#5299
waleedlatif1 merged 2 commits into
stagingfrom
improvement/landing-followups

Conversation

@waleedlatif1

Copy link
Copy Markdown
Collaborator

Summary

Two DRY follow-ups on the landing surface (after #5181 / #5298). Quality-only — no behavior, SEO, or render-mode change (verified empirically below).

buildLandingMetadata helper (DRY ~470 duplicated lines)

  • New apps/sim/lib/landing/seo.ts — single source of truth for the shared landing OpenGraph / Twitter / robots / canonical chrome (mirrors the existing buildPostMetadata in lib/blog/seo.ts).
  • 13 static landing pages migrated to it; each now declares only what varies (title, description, keywords, path, and any non-default image alt). Removed the now-dead PAGE_URL/SITE_URL from the 12 pages that no longer reference them (partners keeps them for its JSON-LD).
  • Output is identical per page. partners additionally gains the standard authors/creator/publisher it was previously missing (a normalization).
  • Not migrated (intentionally): the home page ((landing)/page.tsx, extra formatDetection/classification/referrer fields), integrations/models (resolve their card from sibling opengraph-image), and the blog family (buildPostMetadata).

Pricing comparison data derived from billing constants

  • comparison-table/comparison-data.ts now derives the Monthly-credits and Daily-refresh cells from CREDIT_TIERS, DEFAULT_FREE_CREDITS, DAILY_REFRESH_RATE, and a new CREDITS_PER_DOLLAR constant instead of hardcoding 6,000 / 25,000 / +50 / +200 — so they can't drift from billing. Values are byte-identical.

Testing

  • tsc --noEmit — 0 errors; biome check — clean (16 files)
  • next build — compiled successfully, 712 pages, 0 errors
  • Verified zero SSR/SEO impact: migrated pages keep the same ƒ Dynamic render mode (unchanged vs baseline), and the rendered <head> OpenGraph/Twitter/canonical/alt tags are unchanged (curled the built server)

Type of Change

  • Improvement / refactor (no behavior change)

…t cells

- Add lib/landing/seo.ts buildLandingMetadata(), the single source of truth for
  the shared landing OpenGraph/Twitter/robots/canonical chrome; migrate 13 static
  landing pages to it (drop ~470 lines of duplicated literals). Output is identical
  per page (verified: rendered head tags unchanged, render mode unchanged); partners
  additionally gains the standard authors/creator/publisher it was missing.
- Drop the now-dead PAGE_URL const + SITE_URL import from the 12 migrated pages that
  no longer reference them (partners keeps both for its JSON-LD).
- comparison-data.ts: derive monthly/daily credit cells from CREDIT_TIERS,
  DEFAULT_FREE_CREDITS, DAILY_REFRESH_RATE and a new CREDITS_PER_DOLLAR constant
  instead of hardcoding, so they can't drift (values byte-identical).
@vercel

vercel Bot commented Jun 30, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated (UTC)
docs Skipped Skipped Jun 30, 2026 11:27pm

Request Review

@cursor

cursor Bot commented Jun 30, 2026

Copy link
Copy Markdown

PR Summary

Low Risk
Refactor-only with intended identical SEO output and comparison values; main watchpoint is accidental metadata drift if the helper diverges from prior per-page objects.

Overview
Introduces buildLandingMetadata in lib/landing/seo.ts and replaces large inline metadata objects on 13 static landing pages (changelog, demo, enterprise, partners, pricing, privacy, terms, workflows, and solution routes). Each page now only passes title, description, path, and optional keywords / image alt overrides; shared OpenGraph, Twitter, robots, and canonical fields live in one place. The partners page additionally picks up the standard authors / creator / publisher fields it lacked before.

Separately, the workspace upgrade comparison table no longer hardcodes monthly credits and daily refresh strings—it derives them from CREDIT_TIERS, DEFAULT_FREE_CREDITS, DAILY_REFRESH_RATE, and a new CREDITS_PER_DOLLAR export in billing constants, with tier lookup by name so reordering tiers stays safe.

Reviewed by Cursor Bugbot for commit 6fa6703. Configure here.

@greptile-apps

greptile-apps Bot commented Jun 30, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR reduces duplicated landing metadata and derives pricing credits from shared billing constants.

  • Added a shared landing metadata helper for static landing pages.
  • Migrated landing pages to declare only page-specific metadata fields.
  • Derived monthly and daily refresh credit rows from billing constants.
  • Added a shared credits-per-dollar billing constant.

Confidence Score: 5/5

This looks safe to merge.

  • No blocking issues found in the changed code.

Important Files Changed

Filename Overview
apps/sim/app/workspace/[workspaceId]/upgrade/components/comparison-table/comparison-data.ts Uses named Pro and Max tier lookups before deriving comparison-table credit values.
apps/sim/lib/billing/constants.ts Exports the credits-per-dollar conversion used by the comparison data.
apps/sim/lib/landing/seo.ts Adds the shared metadata builder used by the migrated landing pages.

Reviews (2): Last reviewed commit: "refactor(billing): bind comparison colum..." | Re-trigger Greptile

Look up Pro/Max tiers by name instead of array position so the comparison
table can't silently bind to the wrong tier if CREDIT_TIERS is reordered or a
tier is inserted (addresses Greptile P2). Values unchanged.
@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@greptile review

@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@cursor review

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Bugbot reviewed your changes and found no new issues!

Comment @cursor review or bugbot run to trigger another review on this PR

Reviewed by Cursor Bugbot for commit 6fa6703. Configure here.

@waleedlatif1 waleedlatif1 merged commit 8c8e4b7 into staging Jun 30, 2026
17 checks passed
@waleedlatif1 waleedlatif1 deleted the improvement/landing-followups branch June 30, 2026 23:44
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