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

Track unread counts #253

Closed
gnprice opened this issue Aug 3, 2023 · 3 comments · Fixed by #304
Closed

Track unread counts #253

gnprice opened this issue Aug 3, 2023 · 3 comments · Fixed by #304
Assignees
Labels
a-model Implementing our data model (PerAccountStore, etc.)
Milestone

Comments

@gnprice
Copy link
Member

gnprice commented Aug 3, 2023

We want to show how many unread messages the user has in each stream and conversation, how many unread @-mentions they have, and how many unreads they have total, each in various places in the UI.

The data to power this begins with the unread_msgs data structure in the initial data — search for "unread_msgs:" in https://zulip.com/api/register-queue . It then needs to be updated on a variety of events: new message, messages marked read or unread, messages moved or edited (affecting @-mention status), message deleted, and some others.

In zulip-mobile, this is tracked as state.unread. See src/unread/unreadModel.js and src/unread/unreadSelectors.js. The handling there of counts for DMs and @-mentions (and the overall total) is legacy and isn't to be imitated, but the handling for streams and stream conversations — typically the bulk of the data — was overhauled more recently and much of that should translate well.

Then this data should appear in the UI:

For any of those pieces of UI that we've already implemented when we take up this issue, we can add the data to those parts of the UI as part of this issue. For the rest, we can include this data when we first implement those parts of the UI.

@gnprice gnprice added the a-model Implementing our data model (PerAccountStore, etc.) label Aug 3, 2023
@chrisbobbe
Copy link
Collaborator

chrisbobbe commented Aug 3, 2023

Tentatively milestoning this as "alpha" because it's important for daily use to know if there are unreads at a glance; feel free to change.

@chrisbobbe chrisbobbe added this to the Alpha milestone Aug 3, 2023
chrisbobbe added a commit to chrisbobbe/zulip-flutter that referenced this issue Aug 11, 2023
TODO resolve two #api documentation discussions:
  https://chat.zulip.org/#narrow/stream/412-api-documentation/topic/register.3A.20.60unread_msgs.2Epms.5B.5D.2Eunread_message_ids.60/near/1623940
  https://chat.zulip.org/#narrow/stream/412-api-documentation/topic/register.3A.20When.20was.20.60unread_msgs.2Epms.5B.5D.2Eother_user_id.60.20added.3F/near/1623961

Our own data structure in PerAccountStore will be constructed from
this value, and it will probably have quite a different shape; for
example, we're likely to want to collapse the distinction between
1:1 and group DMs.

But now we're validating this part of the /register response and
making it available to feed into those new internal data structures.

Related: zulip#253
chrisbobbe added a commit to chrisbobbe/zulip-flutter that referenced this issue Aug 16, 2023
Our own data structure in PerAccountStore will be constructed from
this value, and it will probably have quite a different shape; for
example, there, we're likely to want to collapse the distinction
between 1:1 and group DMs.

But now we're validating this part of the /register response and
making it available to feed into those new internal data structures.

Related: zulip#253
gnprice pushed a commit to chrisbobbe/zulip-flutter that referenced this issue Aug 17, 2023
Our own data structure in PerAccountStore will be constructed from
this value, and it will probably have quite a different shape; for
example, there, we're likely to want to collapse the distinction
between 1:1 and group DMs.

But now we're validating this part of the /register response and
making it available to feed into those new internal data structures.

Related: zulip#253
@gnprice
Copy link
Member Author

gnprice commented Oct 18, 2023

Then this data should appear in the UI:

I've forked this part off as a followup issue:

So we can close this issue when we complete the model, and use that one to track the remaining task of adding it to the UI there.

@gnprice
Copy link
Member Author

gnprice commented Oct 31, 2023

This was completed when we merged #304.

@gnprice gnprice closed this as completed Oct 31, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
a-model Implementing our data model (PerAccountStore, etc.)
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

2 participants