feat: implement filterSeenArticles in DCR #8695
Closed
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.
What does this change?
Introduces a new prop
hasBeenSeen
for<Card />
components to allow them to be dimmed for app users who have already visited the article represented by the card.<Carousel />
components as these are the ones used at the bottom of articles. Any specific fronts-related cards have been left as is since there is no requirement to support fronts for apps.Prop-drills
renderingTarget
into a number of components to allowhasBeenSeen
to only be truthy forrenderingTarget === "Apps"
Why?
As part of the migration of the Bridget user service to DCR, this migrates the use of
filterSeenArticles
across, since it was being used to dim cards that had already been read by the mobile user.Potential improvements
The
filterSeenArticles
method is used in a very convoluted way. In this PR, we aren't interested in changing the underlying Bridget methods so this is being shoehorned in.It would be worth addressing what the "ideal" method would be here based on what the native layer needs and what makes most sense in this context.