Skip to content

SEO context for Quality#646

Merged
feruzm merged 3 commits intodevelopfrom
seocontext
Feb 6, 2026
Merged

SEO context for Quality#646
feruzm merged 3 commits intodevelopfrom
seocontext

Conversation

@feruzm
Copy link
Copy Markdown
Member

@feruzm feruzm commented Feb 6, 2026

Summary by CodeRabbit

  • New Features

    • SEO-aware context support added so post rendering can consider author reputation and payout when deciding link behavior.
  • Improvements

    • External links now include improved rel attributes by default, with followed links allowed for high-quality posts.
    • Consistent external-link handling applied across profiles, posts, and widgets.
  • Tests

    • New tests cover nuanced rel attribute rules for different reputation/payout scenarios.
  • Chores

    • Render helper bumped and changelog updated.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Feb 6, 2026

📝 Walkthrough

Walkthrough

SEO context support is added across rendering layers: author reputation and post payout are threaded into renderPostBody/markdown pipeline to determine external link rel attributes; multiple UI components also add rel="nofollow ugc noopener" to external links.

Changes

Cohort / File(s) Summary
SEO Context Type & Exports
packages/render-helper/src/types/seo-context.interface.ts, packages/render-helper/src/types/index.ts, packages/render-helper/src/index.ts
Adds SeoContext interface (authorReputation, postPayout) and re-exports it from render-helper public types.
Render-helper public API & pipeline
packages/render-helper/src/markdown-2-html.ts, packages/render-helper/src/index.ts, packages/render-helper/package.json, packages/render-helper/CHANGELOG.md
Extends markdown2Html signature to accept optional seoContext, threads it through cache keys and exports; package version bumped and changelog updated.
Markdown traversal & link handling
packages/render-helper/src/methods/traverse.method.ts, packages/render-helper/src/methods/a.method.ts, packages/render-helper/src/methods/markdown-to-html.method.ts
Propagates seoContext through traversal and markdown-to-HTML; a.method uses seoContext to decide external rel ("noopener" for high-quality content else "nofollow ugc noopener").
Render-helper tests
packages/render-helper/src/methods/a.method.spec.ts, packages/render-helper/src/markdown-2-html.spec.ts, packages/render-helper/src/methods/traverse.method.spec.ts
Updates/adds tests to assert new rel attribute behavior and reputation/payout-based rules.
Renderer components (props & forwarding)
apps/web/src/features/post-renderer/components/ecency-renderer.tsx, apps/web/src/features/shared/post-content-renderer.tsx
Adds optional seoContext prop to EcencyRenderer and PostContentRenderer and forwards it to renderPostBody with parent domain.
Entry page render paths
apps/web/src/app/(dynamicPages)/entry/.../_components/entry-page-content-ssr.tsx, .../entry-page-cross-post-body.tsx, .../entry-page-static-body.tsx, .../redditbot/route.ts
Builds SeoContext (authorReputation via accountReputation(), postPayout) and passes it into renderPostBody calls; applies HTML-escaping for meta values in redditbot route.
External link attribute additions in UI
apps/web/src/app/(dynamicPages)/profile/.../profile-card/index.tsx, apps/web/src/app/witnesses/_components/witness-card.tsx, apps/web/src/app/witnesses/_components/witnesses-list.tsx, apps/web/src/features/shared/hiveposh/index.tsx, apps/web/src/app/(dynamicPages)/entry/.../entry-page-content-ssr.tsx
Adds rel="nofollow ugc noopener" (or rel="nofollow noopener" in one entry) to external anchors/Link elements that open externally; minor label text change in witness card.

Sequence Diagram

sequenceDiagram
    actor Client
    participant EntryComp as Entry Component
    participant Renderer as RenderHelper
    participant LinkHandler as Link Handler (a.method)
    participant Output as HTML Output

    Client->>EntryComp: Request entry page
    EntryComp->>EntryComp: Extract author reputation and payout
    EntryComp->>EntryComp: Create SeoContext {authorReputation, postPayout}
    EntryComp->>Renderer: renderPostBody(content, parentDomain, seoContext)
    Renderer->>Renderer: markdown2Html → markdownToHTML (seoContext)
    Renderer->>LinkHandler: traverse → a.method (seoContext)
    LinkHandler->>LinkHandler: evaluate (authorReputation, postPayout)
    alt High-quality (rep ≥ 40 and payout > 5)
        LinkHandler->>Output: render anchor with rel="noopener"
    else Otherwise
        LinkHandler->>Output: render anchor with rel="nofollow ugc noopener"
    end
    Output->>Client: Return rendered HTML
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

Poem

🐰 A hop through markup, a nibble of code,
Reputation and payout now lighten the road.
Links wear small tags — follow or not,
Render-helper guides each anchor we spot.
Hooray — quality hops forward, carrot in hand!

🚥 Pre-merge checks | ✅ 2 | ❌ 1
❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 11.76% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'SEO context for Quality' directly aligns with the main changeset, which introduces SEO context infrastructure (SeoContext type, authorReputation, postPayout) and applies intelligent rel attribute handling for external links based on content quality metrics.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch seocontext

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

coderabbitai[bot]

This comment was marked as resolved.

@feruzm feruzm added the patch Bug fixes and patches (1.0.0 → 1.0.1), add this only if any packages/ have patch changes in PR label Feb 6, 2026
@feruzm feruzm merged commit 435cf48 into develop Feb 6, 2026
1 check passed
@feruzm feruzm deleted the seocontext branch February 6, 2026 19:46
@coderabbitai coderabbitai bot mentioned this pull request Feb 18, 2026
This was referenced Mar 4, 2026
@coderabbitai coderabbitai bot mentioned this pull request Mar 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

patch Bug fixes and patches (1.0.0 → 1.0.1), add this only if any packages/ have patch changes in PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant