Skip to content

fix(app): deduplicate related-content items across topic rows#1789

Open
johan-bell wants to merge 1 commit into
mainfrom
1737-app-duplicate-content-for-different-related-content
Open

fix(app): deduplicate related-content items across topic rows#1789
johan-bell wants to merge 1 commit into
mainfrom
1737-app-duplicate-content-for-different-related-content

Conversation

@johan-bell

@johan-bell johan-bell commented Jul 7, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • The app's "Related" section on a content page shows one horizontal row per topic tag (e.g. "People in the Bible", "Heroes of faith"). Any item tagged with multiple topics was repeated verbatim in every matching row — same thumbnails, same order, no added value.
  • contentByTag gains an opt-in dedupeAcrossTags option: it claims each content item for a single row, processing topics in ascending order of match count so a broad topic doesn't swallow items a niche topic needs.
  • RelatedContent.vue is the only consumer that opts in. The five other callers (HomePagePinned, PinnedVideo, UnpinnedVideo, PinnedTopics, UnpinnedTopics) call the helper with no options, so their behavior (intentional duplication across topic browsing) is unchanged.

Why

Fixes #1737 — related-content rows currently duplicate the same content across categories instead of surfacing distinct related items, which undermines the "related content" section's purpose of encouraging further reading.

Test plan

  • npx vitest run src/components/contentByTag.spec.ts — 4/4 passing, including two new cases covering dedup-on and default (dedup-off) behavior
  • npx vitest run src/components/content/RelatedContent.spec.ts — 5/5 passing (unchanged)
  • npx eslint on the three changed files — clean
  • Manual check in the browser that a post with overlapping topics no longer repeats items across rows (not yet done in this session)

The related-content section repeated the same items in every topic row
a piece of content belonged to (e.g. "People in the Bible" and "Heroes
of faith" both showing Esther, Mary, Moses...). Add an opt-in
dedupeAcrossTags option to contentByTag that claims each item for only
one row, preferring the topic with fewer matches so broad topics don't
starve niche ones. RelatedContent.vue is the only consumer that opts
in; other callers (HomePage/VideoPage/ExplorePage) are unaffected.
@johan-bell johan-bell linked an issue Jul 7, 2026 that may be closed by this pull request
@johan-bell johan-bell deployed to app-staging July 7, 2026 11:33 — with GitHub Actions Active
@johan-bell johan-bell requested a review from MrDirkelz July 7, 2026 12:27

@MrDirkelz MrDirkelz left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

This deduplication feels much better when scrolling through the app

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.

APP: Duplicate content for different related content

2 participants