fix(app): deduplicate related-content items across topic rows#1789
Open
johan-bell wants to merge 1 commit into
Open
fix(app): deduplicate related-content items across topic rows#1789johan-bell wants to merge 1 commit into
johan-bell wants to merge 1 commit into
Conversation
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.
MrDirkelz
reviewed
Jul 7, 2026
MrDirkelz
left a comment
Collaborator
There was a problem hiding this comment.
This deduplication feels much better when scrolling through the app
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
contentByTaggains an opt-indedupeAcrossTagsoption: 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.vueis 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) behaviornpx vitest run src/components/content/RelatedContent.spec.ts— 5/5 passing (unchanged)npx eslinton the three changed files — clean