Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add visual indicator of read/unread news resources #595

Merged
merged 7 commits into from
Apr 19, 2023
Merged

Conversation

rosejr
Copy link
Contributor

@rosejr rosejr commented Feb 14, 2023

Adds indicator dots when a news resource is unread, and when a navigation destination has unread content. Makes necessary data layer changes to track resources that have been read. This makes it easier for users to quickly scan for content that they haven't seen already or identify content that they have already read.

nia-unread

@rosejr rosejr marked this pull request as draft February 14, 2023 01:12
@rosejr rosejr force-pushed the jr/track-viewed branch 3 times, most recently from 0a5d076 to 241e9ce Compare February 14, 2023 19:29
@rosejr rosejr force-pushed the jr/track-viewed branch 2 times, most recently from 9b8cc77 to 973ca2b Compare February 22, 2023 17:19
This moves the responsibility for joining the UserData and the
NewsResources to UserNewsResourceRepository. This way, the work can be
done once and shared with all consumers in a SharedFlow, rather than
having each consumer perform the join itself by invoking the UseCase.
When a news resource is unread, display a dot on its card in the news
feed.  When the For You section has unread resources, display a dot on
its icon in the navigation bar.

Update the read status when a resource is opened.
@rosejr rosejr marked this pull request as ready for review February 27, 2023 21:17
@dturner
Copy link
Collaborator

dturner commented Mar 2, 2023

Please add screenshots of "before" and "after" to the PR description, as well as details about what this change does and why.

Copy link
Collaborator

@dturner dturner left a comment

Choose a reason for hiding this comment

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

Thanks for adding this. From the user's POV this works really well, especially the nav icon, which makes it super clear when you've got content you haven't read.

From an architectural POV there are some issues which are only clear now you've implemented it :)

The main pieces of feedback are:

  • The cold->hot flow adds a lot of complexity for little benefit, let's remove it
  • We need to decide on whether we want to keep UserNewsRepo or refactor this into multiple use cases (jury still out on this).
  • Move the notification state out of NiaApp into NiaAppState

@rosejr rosejr force-pushed the jr/track-viewed branch 3 times, most recently from 8194f7a to 519b82f Compare March 13, 2023 21:05
module; move UserNewsResource to model module. Implement unread dot for
bookmarked articles. Keep the flows cold in UserNewsResourceRepository.
Copy link
Collaborator

@dturner dturner left a comment

Choose a reason for hiding this comment

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

LGTM with some minor method name changes.

@dturner
Copy link
Collaborator

dturner commented Apr 19, 2023

As per internal discussion, let's also set all current news resources to read status so that the user is only notified of new items.

Copy link
Collaborator

@dturner dturner left a comment

Choose a reason for hiding this comment

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

Thanks for doing this. Looking good.

@rosejr rosejr merged commit 3e66e3d into main Apr 19, 2023
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.

None yet

2 participants