fix(webapp): truncate SEO titles on tag and source pages#5683
fix(webapp): truncate SEO titles on tag and source pages#5683
Conversation
Reuse getPageSeoTitles on tag and source detail pages so long SEO titles are truncated consistently while preserving full Open Graph titles. Made-with: Cursor
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
@claude please review this pr |
|
Claude finished @nimrodkra's task in 2m 3s —— View job PR Review
Overall: Clean, focused change. Looks good to merge with a couple of minor notes. The PR correctly ports both the tag and source pages to What this PR doesBefore (both pages): // [source].tsx
const seo: NextSeoProps = {
title: `${source.name} posts on daily.dev`,
openGraph: { ...defaultOpenGraph }, // ← BUG: overwritten by ...defaultSeo below
...defaultSeo,
...
};
// [tag].tsx
const getSeoData = (...): NextSeoProps => ({
title: `${title} posts on daily.dev`,
openGraph: { ...defaultOpenGraph }, // ← same bug
...defaultSeo,
...
});After: const seoTitles = getPageSeoTitles(`${source.name} posts`);
const seo: NextSeoProps = {
...defaultSeo,
...seoTitles,
openGraph: { ...defaultOpenGraph, ...seoTitles.openGraph }, // ✅ correct merge order
...
};Observations1. Bonus bug fix: openGraph spread order 2. Title format change: "on daily.dev" → "| daily.dev" 3. "Drop suffix" edge case is expected and tested 4. OG title is correctly untruncated 5. Minor: Test plan gapThe PR notes the build fails locally due to DNS. The linter passes. Given the narrowness of the change (no logic added, only reusing an already-tested utility), this is low risk to merge. |
Summary
getPageSeoTitlesso long titles are truncated consistentlygetPageSeoTitleswith the same behaviorWhy this matters
Keeping titles within a healthy length improves how results are rendered in search and reduces low-quality truncation in SERPs. This also standardizes title behavior across key page types, which makes SEO signals more consistent.
Test plan
pnpm --filter webapp lintpnpm --filter webapp build(fails locally due DNS lookup forapi.local.fylla.devduring prerender in this environment)Made with Cursor
Preview domain
https://seo-pr1-title-truncation.preview.app.daily.dev